How to detect whether the broadcast is over?

Max

Administrator
Staff member
Hello
I needed to know how can I detect whether the broadcast is over from the subscriber screen?
There are three ways to know what stream has been published:
1. By stream name.
When you broadcast your stream, it has an unique stream name and you can set this name.
Example: https://wcs5-eu.flashphoner.com/demo2/two-way-streaming
As you can see you can set any arbitrary stream name (id) and you can pass the stream name to another screen using your custom method.
When you publish a stream, you know stream name:
Code:
session.createStream({name:'stream1', display:video1}).publish();
Therefore you can send name 'stream1' to any connected user, and he or she can play the 'stream1'
Code:
session.createStream({name:'stream1', display:video2}).play();
2. Via room API.
When you have 2 or more users in the room, second user aware all published streams in the room.
You can see how Conference sample works:
https://wcs5-eu.flashphoner.com/demo2/conference
https://github.com/flashphoner/flas...cs_api-2.0/examples/demo/streaming/conference
https://flashphoner.com/docs/wcs5/w...ide-2/index.html?video_conference_web_sdk.htm

3. Via REST Methods
When you do stream publish
Code:
session.createStream({name:'stream1', display:video1}).publish();
WCS sends REST / JSON notification over HTTP
So you can receive such notification on your server-side
https://flashphoner.com/docs/wcs5/wcs_docs/html/en/wcs-rest-methods/
 
Top