Video Room subscriber in janus

397 views
Skip to first unread message

Rani Yaroshinski

unread,
Dec 28, 2021, 4:37:57 AM12/28/21
to meetecho-janus

As we understand now , subscribers are not participants in the room, but rely on the publisher which is supposed to be the participant.
However, something seems missing in the model :
[1] Can we enlist a passive publisher to the room which is only there to consume data of other, and doesn't publish anything on its own.
How can we do this ? As the documentation is missing. We want to avoid the use of the SDP negotiation when listing a publisher.
[2] Assume that we subscribe to a stream and then we want to update something in the subscription, this should be possible using the "subscribe" command to janus. However, there is no id in this subscription request which make us wonder what is supposed to happen there, in the subscription model. The same is true for the "unsubscribe", I cannot find any id there ?
[3] Is there a reason why joining a video-room with type subscriber doesn't return any unique id for this subscriber which will make it possible to stop this specific subscriber, change it, or unsubscribe it ? There must be some kind of unique handle for it to do this.

Maybe there is even a model which allows for putting only subscriber with no "publisher" (behind the scene), and be able to control it.

Sarsaparilla Sunset

unread,
Dec 29, 2021, 2:53:57 AM12/29/21
to meetecho-janus
You'll want to attach to the VideoRoom plugin twice: once as a publisher, and once as a subscriber.  You'll create 2 handles: a publisher handle, and a subscriber handle.

[1] The publisher handle is the participant, and it is initially passive.  When you are ready, you call "publish()" to make it an active publisher, otherwise it remains passive.  SDP negotiation doesn't happen until you call "publish".  This handle is also used to listen for events, such as to know who joins/leaves the room.

[2] The subscriber handle is used to actually consume the video/audio streams of other publishers.  Each publisher has a unique ID, and when you call "subscribe" command, you specify the publisher IDs (in the "streams" field) to tell Janus which publishers you want to receive media from.  Simiarly, when you call "unsubscribe", you specify the publisher IDs you want to stop receiving media from.

Note: previously you needed to create multiple subscriber handles, once for each publisher.  But with the "multistream" update (see the @multistream branch), Janus is able to use a single handle (i.e. peer connection) to receive streams from multiple publishers.
Reply all
Reply to author
Forward
0 new messages