Hi all,
I’m using the VideoRoom plugin with a custom C++ client (libwebrtc based) application. I’m handling subscriptions using a single subscriber handle and a single RTCPeerConnection, and performing renegotiation whenever new publishers join.
Work Flow:
- I join the room.
- I subscribe to the existing publishers successfully.
- When new publishers join:
- I send a subscribe request.
- Janus sends a JSEP offer.
- I generate an answer.
- Media works correctly.
This works perfectly until a remote publisher leaves.
Problem Scenario
-
A remote publisher leaves the room.
-
I receive the
leavingevent. -
I clean up the related remote track/transceiver locally.
-
I keep using the same subscriber handle and same PeerConnection (no detach, no recreation).
After this, when a new publisher joins:
-
I send a
subscriberequest. -
Janus responds with the following event:
-
messageBuffer:{
“janus”: “event”,
“session_id”: 5436466648193382,
“transaction”: “subscribe-276006”,
“sender”: 2510429578947704,
“plugindata”: {
“plugin”: “janus.plugin.videoroom”,
“data”: {
“videoroom”: “updating”,
“room”: 5678
}
}
}
- The
"Videoroom": "updating"state is received. - No JSEP offer is sent by Janus after this.
- Therefore renegotiation cannot proceed.
- I am unable to subscribe to any new publishers after the participant leaves.
Questions
-
After receiving a
leavingevent, is additional renegotiation required before subscribing to new publishers? -
Does the
"updating"state mean Janus expects the client to send a new offer instead? -
Is reusing a single subscriber PeerConnection for dynamic subscriptions officially supported?
-
Is it recommended to detach the subscriber handle and create a new one after a publisher leaves?
-
Could this be related to transceiver/m-line reuse or direction state issues?
Note: I am using same RTCPeerConnection and single subscriber handle.