Janus(三)VideoRoom 文檔

VideoRoom plugin documentation

房間配置文件

room-<unique room ID>: {
        description = This is my awesome room
        is_private = true|false (private rooms don't appear when you do a 'list' request)
        secret = <optional password needed for manipulating (e.g. destroying) the room>
        pin = <optional password needed for joining the room>
        require_pvtid = true|false (whether subscriptions are required to provide a valid
                                 a valid private_id to associate with a publisher, default=false)
        publishers = <max number of concurrent senders> (e.g., 6 for a video
                                 conference or 1 for a webinar, default=3)
        bitrate = <max video bitrate for senders> (e.g., 128000)
        fir_freq = <send a FIR to publishers every fir_freq seconds> (0=disable)
        audiocodec = opus|g722|pcmu|pcma|isac32|isac16 (audio codec to force on publishers, default=opus
                                can be a comma separated list in order of preference, e.g., opus,pcmu)
        videocodec = vp8|vp9|h264 (video codec to force on publishers, default=vp8
                                can be a comma separated list in order of preference, e.g., vp9,vp8,h264)
        opus_fec = true|false (whether inband FEC must be negotiated; only works for Opus, default=false)
        video_svc = true|false (whether SVC support must be enabled; only works for VP9, default=false)
        audiolevel_ext = true|false (whether the ssrc-audio-level RTP extension must be
                negotiated/used or not for new publishers, default=true)
        audiolevel_event = true|false (whether to emit event to other users or not)
        audio_active_packets = 100 (number of packets with audio level, default=100, 2 seconds)
        audio_level_average = 25 (average value of audio level, 127=muted, 0='too loud', default=25)
        videoorient_ext = true|false (whether the video-orientation RTP extension must be
                negotiated/used or not for new publishers, default=true)
        playoutdelay_ext = true|false (whether the playout-delay RTP extension must be
                negotiated/used or not for new publishers, default=true)
        transport_wide_cc_ext = true|false (whether the transport wide CC RTP extension must be
                negotiated/used or not for new publishers, default=true)
        record = true|false (whether this room should be recorded, default=false)
        rec_dir = <folder where recordings should be stored, when enabled>
        notify_joining = true|false (optional, whether to notify all participants when a new
                                participant joins the room. The Videoroom plugin by design only notifies
                                new feeds (publishers), and enabling this may result extra notification
                                traffic. This flag is particularly useful when enabled with \c require_pvtid
                                for admin to manage listening only participants. default=false)
}

API 分類

  • 同步請(qǐng)求:直接在事務(wù)(transacation)的上下文里獲取響應(yīng),即直接響應(yīng)(transaction綁定即可)
    • create:動(dòng)態(tài)創(chuàng)建一個(gè)新的房間,作為使用配置文件的替代方法
    • destroy:移除并銷毀房間,同時(shí)剔除房間里的所有用戶
    • edit:動(dòng)態(tài)修改一些房間屬性
    • exists:查詢是否存在指定的房間
    • list:列出所有可用的房間
    • allowed:配置觀眾進(jìn)入房間權(quán)限
    • kick:管理員踢除用戶操作
    • listparticipants:列出所有指定房間中活躍(比如當(dāng)前正在發(fā)布)的參與者和他們的詳細(xì)信息
  • 異步請(qǐng)求:在事件(event)通知中獲取成功(success)與失敗(failure)事件,先發(fā)一個(gè)ask后再發(fā)一個(gè)event進(jìn)行響應(yīng)(必須使用handle_id綁定)
    • join:加入指定的房間,并指定連接用于發(fā)布或觀看音視頻
    • joinandconfigure:對(duì)于發(fā)布者,將前兩個(gè)請(qǐng)求合成一個(gè)
    • configure:修改一些參與者的設(shè)置,例如 bitrate cap
    • publish:開(kāi)始發(fā)送媒體并廣播給其他參與者
    • unpublish:停止發(fā)送媒體并廣播給其他參與者
    • start:開(kāi)始接收來(lái)自發(fā)布者的媒體數(shù)據(jù)
    • pause:停止傳遞媒體數(shù)據(jù)
    • switch:修改媒體連接的來(lái)源
    • leave:離開(kāi)房間

Video Room

create - 創(chuàng)建房間

請(qǐng)求用 body

{
        "request" : "create",
        "room" : <unique numeric ID, optional, chosen by plugin if missing>,
        "permanent" : <true|false, whether the room should be saved in the config file, default=false>,
        "description" : "<pretty name of the room, optional>",
        "secret" : "<password required to edit/destroy the room, optional>",
        "pin" : "<password required to join the room, optional>",
        "is_private" : <true|false, whether the room should appear in a list request>,
        "allowed" : [ array of string tokens users can use to join this room, optional],
        ...
}

更多房間創(chuàng)建參數(shù)可參考房間配置文件——conf/janus.plugin.videoroom.jcfg

成功響應(yīng) created

{
        "videoroom" : "created",
        "room" : <unique numeric ID>,
        "permanent" : <true if saved to config file, false if not>
}

(通用)失敗回調(diào) event

{
        "videoroom" : "event",
        "error_code" : <numeric ID, check Macros below>,
        "error" : "<error description as a string>"
}

Janus 中所有用戶都可以創(chuàng)建房間,我們可以在插件中配置admin_key,只有在create攜帶了正確的admin_key才可以創(chuàng)建成功。

注意,您也可以選擇將此功能擴(kuò)展到RTP轉(zhuǎn)發(fā),以便只允許受信任的客戶端使用此功能。

edit - 編輯房間

在房間被創(chuàng)建后,我們可以使用edit編輯房間的屬性(例如room description、secret、pinprivate or not),但不能修改一些靜態(tài)的屬性(例如room ID、sampling rate)。

請(qǐng)求用 body

{
        "request" : "edit",
        "room" : <unique numeric ID of the room to edit>,
        "secret" : "<room secret, mandatory if configured>",
        "new_description" : "<new pretty name of the room, optional>",
        "new_secret" : "<new password required to edit/destroy the room, optional>",
        "new_pin" : "<new password required to join the room, optional>",
        "new_is_private" : <true|false, whether the room should appear in a list request>,
        "new_require_pvtid" : <true|false, whether the room should require private_id from subscribers>,
        "new_bitrate" : <new bitrate cap to force on all publishers (except those with custom overrides)>,
        "new_fir_freq" : <new period for regular PLI keyframe requests to publishers>,
        "new_publishers" : <new cap on the number of concurrent active WebRTC publishers>,
        "permanent" : <true|false, whether the room should be also removed from the config file, default=false>
}

成功響應(yīng) edited

{
        "videoroom" : "edited",
        "room" : <unique numeric ID>
}

destroy - 銷毀房間

無(wú)論是靜態(tài)還是動(dòng)態(tài)的房間,都可以用destroy進(jìn)行銷毀。

請(qǐng)求用 body

{
        "request" : "destroy",
        "room" : <unique numeric ID of the room to destroy>,
        "secret" : "<room secret, mandatory if configured>",
        "permanent" : <true|false, whether the room should be also removed from the config file, default=false>
}

成功響應(yīng) destoryed

{
        "videoroom" : "destroyed",
        "room" : <unique numeric ID>
}

房間用戶接收的事件 event

用戶可能在房間使用中銷毀房間,其他觀眾會(huì)收到這個(gè)事件,獲知房間被銷毀

{
        "videoroom" : "destroyed",
        "room" : <unique numeric ID of the destroyed room>
}

exists - 房間是否存在

請(qǐng)求用 body

{
        "request" : "exists",
        "room" : <unique numeric ID of the room to check>
}

成功響應(yīng) - success

{
        "videoroom" : "success",
        "room" : <unique numeric ID>,
        "exists" : <true|false>
}

allowed - 出入管理

用于配置是否啟用token驗(yàn)證,添加或移除允許進(jìn)入房間的用戶。

請(qǐng)求用 body

{
        "request" : "allowed",
        "secret" : "<room secret, mandatory if configured>",
        "action" : "enable|disable|add|remove",
        "room" : <unique numeric ID of the room to update>,
        "allowed" : [
                // Array of strings (tokens users might pass in "join", only for add|remove)
        ]
}

成功響應(yīng) success

{
        "videoroom" : "success",
        "room" : <unique numeric ID>,
        "allowed" : [
                // Updated, complete, list of allowed tokens (only for enable|add|remove)
        ]
}

kick - 踢出房間

房間的管理員可以通過(guò)kick方法將指定參與者踢出房間。注意,只是能將他踢出房間,并不能阻止他再次進(jìn)入。若想阻止他再次進(jìn)入,則需要使用allowed對(duì)他進(jìn)行限制。

請(qǐng)求用 body

{
        "request" : "kick",
        "secret" : "<room secret, mandatory if configured>",
        "room" : <unique numeric ID of the room>,
        "id" : <unique numeric ID of the participant to kick>
}

成功響應(yīng) - success

{
        "videoroom" : "success",
}

list - 房間列表

用于展示公開(kāi)的所有房間

請(qǐng)求用 body

{
        "request" : "list"
}

成功響應(yīng) - success

{
        "videoroom" : "success",
        "rooms" : [             // Array of room objects
                {       // Room #1
                        "room" : <unique numeric ID>,
                        "description" : "<Name of the room>",
                        "pin_required" : <true|false, whether a PIN is required to join this room>,
                        "max_publishers" : <how many publishers can actually publish via WebRTC at the same time>,
                        "bitrate" : <bitrate cap that should be forced (via REMB) on all publishers by default>,
                        "bitrate_cap" : <true|false, whether the above cap should act as a limit to dynamic bitrate changes by publishers>,
                        "fir_freq" : <how often a keyframe request is sent via PLI/FIR to active publishers>,
                        "audiocodec" : "<comma separated list of allowed audio codecs>",
                        "videocodec" : "<comma separated list of allowed video codecs>",
                        "record" : <true|false, whether the room is being recorded>,
                        "record_dir" : "<if recording, the path where the .mjr files are being saved>",
                        "num_participants" : <count of the participants (publishers, active or not; not subscribers)>
                },
                // Other rooms
        ]
}

listparticipants

請(qǐng)求用 body

{
        "request" : "listparticipants",
        "room" : <unique numeric ID of the room>
}

成功響應(yīng) participants

{
        "videoroom" : "participants",
        "room" : <unique numeric ID of the room>,
        "participants" : [              // Array of participant objects
                {       // Participant #1
                        "id" : <unique numeric ID of the participant>,
                        "display" : "<display name of the participant, if any; optional>",
                        "talking" : <true|false, whether user is talking or not (only if audio levels are used)>,
                        "internal_audio_ssrc" : <audio SSRC used internally for this active publisher>,
                        "internal_video_ssrc" : <video SSRC used internally for this active publisher>
                },
                // Other participants
        ]
}

異步請(qǐng)求

角色梳理

  • 發(fā)布者 Publisher
    • 活躍的發(fā)布者 active publisher
    • 不活躍的發(fā)布者 passive publisher
  • 訂閱者 Subscriber

VideoRoom Publishers

在音頻房間中,發(fā)布者(Publisher)是將多媒體數(shù)據(jù)發(fā)布在房間中的參與者,他們可以成為feed讓其他用戶進(jìn)行訂閱(subscribe)。

join - 加入房間

我們可以通過(guò)join請(qǐng)求將指定的handle指定為publishersubscriber。

  • 指定為publisher:Janus 會(huì)將指定用戶添加到房間中的參與者列表(the list of participants)中,此后,參與者可以接受到房間中關(guān)于handle的一系列通知(包括流的可用與移除)。
  • 指定為subscriber

請(qǐng)求用 body

{
        "request" : "join",
        "ptype" : "publisher",
        "room" : <unique ID of the room to join>,
        "id" : <unique ID to register for the publisher; optional, will be chosen by the plugin if missing>,
        "display" : "<display name for the publisher; optional>",
        "token" : "<invitation token, in case the room has an ACL; optional>"
}

成功響應(yīng) joined

成功join入房間后,將會(huì)接收到當(dāng)前房間中活躍的publishers的列表。

{
        "videoroom" : "joined",
        "room" : <room ID>,
        "description" : <description of the room, if available>,
        "id" : <unique ID of the participant>,
        "private_id" : <a different unique ID associated to the participant; meant to be private>,
        "publishers" : [
                {
                        "id" : <unique ID of active publisher #1>,
                        "display" : "<display name of active publisher #1, if any>",
                        "audio_codec" : "<audio codec used by active publisher #1, if any>",
                        "video_codec" : "<video codec used by active publisher #1, if any>",
                        "simulcast" : "<true if the publisher uses simulcast (VP8 and H.264 only)>",
                        "talking" : <true|false, whether the publisher is talking or not (only if audio levels are used)>,
                },
                // Other active publishers
        ],
        "attendees" : [         // Only present when notify_joining is set to TRUE for rooms
                {
                        "id" : <unique ID of attendee #1>,
                        "display" : "<display name of attendee #1, if any>"
                },
                // Other attendees
        ]
}

當(dāng)房間配置了notify_joiningTRUE時(shí),也會(huì)返回不推流的參與者。

private_id:該屬性用于訂閱,便于插件對(duì)其進(jìn)行關(guān)聯(lián)。

關(guān)于不活躍的發(fā)布者進(jìn)出通知

不活躍的發(fā)布者加入房間不會(huì)通知其他參與者,因?yàn)橐粋€(gè)大房間中可能會(huì)有很多參與者,如果每一個(gè)進(jìn)入離開(kāi)都需要通知所有人的話會(huì)顯得太過(guò)于繁瑣。如果開(kāi)發(fā)者它進(jìn)出房間也通知所有人,那么需要將房間的notify_joining配置為true。通知的事件如下:

{
        "videoroom" : "event",
        "room" : <room ID>,
        "joining" : {
                "id" : <unique ID of the new participant>,
                "display" : "<display name of the new participant, if any>"
        }
}

publish - 發(fā)布(開(kāi)始發(fā)布1)

發(fā)布者帶著 Offer 向 Janus 進(jìn)行協(xié)商

publish請(qǐng)求必須攜帶著 JSEP SDP offer去協(xié)商一個(gè)新的 PeerConnection,即插件會(huì)檢查編碼器和碼率是否是房間所支持的,之后將會(huì)回應(yīng)一個(gè) JSEP SDP acswer 來(lái)關(guān)閉循環(huán)并完成配置一個(gè) PeerConnection。當(dāng)指定的 PeerConnection 搭建好后,該指定的 publisher 才會(huì)變成一個(gè)活躍的 publisher,之后其他參與者才可以訂閱它。

請(qǐng)求用 Body

{
        "request" : "publish",
        "audio" : <true|false, depending on whether or not audio should be relayed; true by default>,
        "video" : <true|false, depending on whether or not video should be relayed; true by default>,
        "data" : <true|false, depending on whether or not data should be relayed; true by default>,
        "audiocodec" : "<audio codec to prefer among the negotiated ones; optional>",
        "videocodec" : "<video codec to prefer among the negotiated ones; optional>",
        "bitrate" : <bitrate cap to return via REMB; optional, overrides the global room value if present>,
        "record" : <true|false, whether this publisher should be recorded or not; optional>,
        "filename" : "<if recording, the base path/file to use for the recording files; optional>",
        "display" : "<new display name to use in the room; optional>"
}

成功響應(yīng) event

Janus 會(huì)在準(zhǔn)備好 Answer 后進(jìn)行響應(yīng),該 event 中也會(huì)帶著 JSEP SDP answer

{
        "videoroom" : "event",
        "configured" : "ok"
}

configure - 配置(開(kāi)始發(fā)布2)

publishconfigure在功能上時(shí)等價(jià)的,他們都有開(kāi)始發(fā)布的功能。從語(yǔ)義上,publish更加合適。但是configure可以更新發(fā)布者會(huì)話的一些屬性??偟膩?lái)說(shuō)configure的功能更加強(qiáng)大,用它就沒(méi)錯(cuò)了。

請(qǐng)求用 body

{
        "request" : "configure",
        "audio" : <true|false, depending on whether or not audio should be relayed; true by default>,
        "video" : <true|false, depending on whether or not video should be relayed; true by default>,
        "data" : <true|false, depending on whether or not data should be relayed; true by default>,
        "bitrate" : <bitrate cap to return via REMB; optional, overrides the global room value if present (unless bitrate_cap is set)>,
        "keyframe" : <true|false, whether we should send this publisher a keyframe request>,
        "record" : <true|false, whether this publisher should be recorded or not; optional>,
        "filename" : "<if recording, the base path/file to use for the recording files; optional>",
        "display" : "<new display name to use in the room; optional>"
}

成功響應(yīng) event

{
        "videoroom" : "event",
        "configured" : "ok"
}

joinandconfigure - 加入并配置(加入并且發(fā)布)

我們可以通過(guò)使用joinandconfigure在一個(gè)請(qǐng)求中進(jìn)行加入和發(fā)布兩個(gè)操作。

請(qǐng)求用 body

參考join請(qǐng)求用的 body,并且攜帶 JSEP SDP offer

成功響應(yīng) - joined

成功響應(yīng)將是一個(gè)joined事件,并且攜帶 JSEP SDP answer。

發(fā)布成功后推送

當(dāng)一個(gè)用戶在房間中發(fā)布成功后,Janus 將會(huì)發(fā)送一個(gè)關(guān)于新對(duì)端的事件給所有參與者,事件如下:

{
        "videoroom" : "event",
        "room" : <room ID>,
        "publishers" : [
                {
                        "id" : <unique ID of the new publisher>,
                        "display" : "<display name of the new publisher, if any>",
                        "audio_codec" : "<audio codec used the new publisher, if any>",
                        "video_codec" : "<video codec used by the new publisher, if any>",
                        "simulcast" : "<true if the publisher uses simulcast (VP8 and H.264 only)>",
                        "talking" : <true|false, whether the publisher is talking or not (only if audio levels are used)>,
                }
        ]
}

unpublish - 停止發(fā)布

unpublish請(qǐng)求用于停止發(fā)布并且銷毀相關(guān)的 PeerConnection,并且將發(fā)布者從活躍流列表中移除。

請(qǐng)求用 body

{
        "request" : "unpublish"
}

成功響應(yīng) event

{
        "videoroom" : "event",
        "unpublished" : "ok"
}

其他成員通知 event

發(fā)布者停止訂閱成功后,房間內(nèi)的其他成員會(huì)通過(guò)下面這個(gè)通知得知此事

{
        "videoroom" : "event",
        "room" : <room ID>,
        "unpublished" : <unique ID of the publisher who unpublished>
}

我們可以在同一個(gè) handle 中多次發(fā)布和取消發(fā)布流

VideoRoom Subscribers

在 VideoRoom 中,訂閱者(Subscriber)不是參與者,但是他可以準(zhǔn)確接收指定發(fā)布者的媒體數(shù)據(jù)。通常發(fā)布者發(fā)布了媒體后,訂閱者可以獲取該流進(jìn)行播放。當(dāng)發(fā)布者取消發(fā)布后,訂閱者 handle 也會(huì)隨之被移除。除非給訂閱者正確的信息,不然訂閱者是不能單獨(dú)存在的。

join - 加入房間

請(qǐng)求用 body

{
        "request" : "join",
        "ptype" : "subscriber",
        "room" : <unique ID of the room to subscribe in>,
        "feed" : <unique ID of the publisher to subscribe to; mandatory>,
        "private_id" : <unique ID of the publisher that originated this request; optional, unless mandated by the room configuration>,
        "close_pc" : <true|false, depending on whether or not the PeerConnection should be automatically closed when the publisher leaves; true by default>,
        "audio" : <true|false, depending on whether or not audio should be relayed; true by default>,
        "video" : <true|false, depending on whether or not video should be relayed; true by default>,
        "data" : <true|false, depending on whether or not data should be relayed; true by default>,
        "offer_audio" : <true|false; whether or not audio should be negotiated; true by default if the publisher has audio>,
        "offer_video" : <true|false; whether or not video should be negotiated; true by default if the publisher has video>,
        "offer_data" : <true|false; whether or not datachannels should be negotiated; true by default if the publisher has datachannels>,
        "substream" : <substream to receive (0-2), in case simulcasting is enabled; optional>,
        "temporal" : <temporal layers to receive (0-2), in case simulcasting is enabled; optional>,
        "spatial_layer" : <spatial layer to receive (0-2), in case VP9-SVC is enabled; optional>,
        "temporal_layer" : <temporal layers to receive (0-2), in case VP9-SVC is enabled; optional>
}

如果發(fā)布者對(duì)房間中的媒體進(jìn)行訂閱,則需要傳入private_id。

成功響應(yīng) attached(Offer)

訂閱者成功加入房間并訂閱指定feed成功后,Janus 會(huì)給予一個(gè)attached響應(yīng),并且在這個(gè)event中攜帶 JSEP SDP offer,用于進(jìn)行媒體協(xié)商。

{
        "videoroom" : "attached",
        "room" : <room ID>,
        "feed" : <publisher ID>,
        "display" : "<the display name of the publisher, if any>"
}

start - 開(kāi)始訂閱(Answer 對(duì) attached 的訂閱者響應(yīng))

訂閱者接收到含有attachevent后,獲取里面的 JSEP SDP offer 后,將其設(shè)置為遠(yuǎn)程 SDP 后,然后發(fā)送start請(qǐng)求并攜帶 JSEP SDP answer。

請(qǐng)求用 body

{
        "request" : "start"
}

成功響應(yīng) (event - started)

{
        "videoroom" : "event",
        "started" : "ok"
}

當(dāng)訂閱者與Janus媒體協(xié)商完畢后,雙方就會(huì)建立一條新的 WebRTC PeerConnection。在這之后,Streaming插件將會(huì)開(kāi)始將媒體轉(zhuǎn)發(fā)到訂閱者端。

Notice that the same exact steps we just went through (watch request, followed by JSEP offer by the plugin, followed by start request with JSEP answer by the viewer) is what you also use when renegotiations are needed, e.g., for the purpose of ICE restarts.

pause - 暫停訂閱

我們可以通過(guò)pausestart請(qǐng)求對(duì)訂閱媒體進(jìn)行臨時(shí)的暫停和恢復(fù)

此處的 start 不需要攜帶 JSEP SDP answer

請(qǐng)求用 body

{
        "request" : "pause"
}

成功響應(yīng)(event - paused)

{
        "videoroom" : "event",
        "paused" : "ok"
}

用于恢復(fù)的start其用法和上面是一致的,注意他不用攜帶 JSEP 即可。

configure - 配置

configure請(qǐng)求允許動(dòng)態(tài)修改訂閱者對(duì)于媒體訂閱的一些屬性,比如配置音頻和視頻的啟用與禁用,靈活設(shè)置訂閱內(nèi)容。

請(qǐng)求用 body

{
        "request" : "configure",
        "audio" : <true|false, depending on whether audio should be relayed or not; optional>,
        "video" : <true|false, depending on whether video should be relayed or not; optional>,
        "data" : <true|false, depending on whether datachannel messages should be relayed or not; optional>,
        "substream" : <substream to receive (0-2), in case simulcasting is enabled; optional>,
        "temporal" : <temporal layers to receive (0-2), in case simulcasting is enabled; optional>,
        "spatial_layer" : <spatial layer to receive (0-2), in case VP9-SVC is enabled; optional>,
        "temporal_layer" : <temporal layers to receive (0-2), in case VP9-SVC is enabled; optional>
}
  • audiovideodata:可以在媒體層(media-level)上進(jìn)行暫停與恢復(fù),對(duì)比pausestart直接作用所有音視頻流而言,它更加靈活。
  • substreamtemporal: The substream and temporal properties, instead, only make sense when the mountpoint is configured with video simulcasting support, and as such the viewer is interested in receiving a specific substream or temporal layer, rather than any other of the available ones.
  • spatial_layertemporal_layer:The spatial_layer and temporal_layer have exactly the same meaning, but within the context of VP9-SVC publishers, and will have no effect on subscriptions associated to regular publishers.

switch - 切換

switch適用于已經(jīng)與 Janus 成功建立 PeerConnection 的訂閱者,通過(guò)這個(gè)請(qǐng)求完成訂閱的切換,就像看電視切換頻道一樣。這樣做的好處就是能復(fù)用一條連接,在切換訂閱目標(biāo)的時(shí)候不需要重新建立連接,消耗不必要的資源。但是他也有以下的限制:

  • 不能只換音視頻流的其中一個(gè),要都換
  • 兩個(gè)目標(biāo)發(fā)布者必須使用一樣的配置,比如一樣的編碼器、一樣的數(shù)據(jù)格式(不一樣的話會(huì)導(dǎo)致延遲甚至直接黑屏沒(méi)聲音)

請(qǐng)求用 body

{
        "request" : "switch",
        "feed" : <unique ID of the new publisher to switch to; mandatory>,
        "audio" : <true|false, depending on whether audio should be relayed or not; optional>,
        "video" : <true|false, depending on whether video should be relayed or not; optional>,
        "data" : <true|false, depending on whether datachannel messages should be relayed or not; optional>
}

成功響應(yīng) event

{
        "videoroom" : "event",
        "switched" : "ok",
        "room" : <room ID>,
        "id" : <unique ID of the new publisher>
}

leave - 離開(kāi)房間

請(qǐng)求用 body

leave請(qǐng)求用于停止訂閱并銷毀相關(guān)的 PeerConnection,由于上下文是隱式的,所以不需要其他參數(shù):

{
        "request" : "leave"
}

成功響應(yīng) - left event

{
        "videoroom" : "event",
        "left" : "ok",
}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容