Streaming plugin: Cannot watch other mount-point after stopStream

I want to use the same plugin handle to watch different streams. But when I stop, then watch(mtpointId), and start(), the stream does not play.

I observed that when I stop
{event: {janus: event, session_id: 6076152537598841, transaction: e0142190-a972-42c5-ba5b-c9a1137b702f, sender: 5451666764555511, plugindata: {plugin: janus.plugin.streaming, data: {streaming: event, result: {status: stopping}}}}, jsep: null}

{event: {janus: hangup, session_id: 6076152537598841, sender: 5451666764555511, reason: Close PC}, jsep: null}

Is it okay to get hangup after stopping? But after getting hangup. I cannot use the handle to watch any other stream.

I tried pause(), but I did not get hangup. And when I reopen the stream I can play the stream just fine.

So, as I explained above, I did not get it to work. But I realized that I can only watchstart using the same handle once. After that, I should switch the mount points. That is for RTP mount points only, which was my case.

Closed.

You can definitely watch different mountpoints from the same handle, if you close the previous PeerConnection: try the stock demo, which does exactly that when you stop a mountpoint and then select a different one. To re-use the same PeerConnection, you can use the “switch” request too, but that only works if the mountpoints have the same codecs and media order.

Thank you for replying.

Yes, I read that I can play unlimited mount points concurrently using the same handle, which works while doing a switch.

But when I stop, watch,

wait for preparing
{streaming: event, result: {status: preparing}}

and then start
{streaming: event, result: {status: starting}}

I never get the started response.

This mostly happens when user A is watching a mount point and user B destroys the mount point. Now, user A cannot watch another mount point.

Check the Admin API for user A’s handle after the mountpoint is destroyed. The WebRTC PeerConnection should be closed: if it isn’t, maybe you’re trying to subscribe to something new and it doesn’t work because you still have something active.