You must subscribe to the streams individually to receive media streams of other participants connected to a Room. Unless you subscribe a stream, you will not receive anything.
When a new stream is added to the Room a callback streamAdded
is received with Stream Object. The receive the stream, you need to subscribe to it using Enx.subscribe()
method.
Method: Enx.subscribe(remoteStreamID, Callback)
Parameters:
remoteStream
ID- The Remote Stream Object to subscribeCallback
– Error in subscription
Callback: streamSubscribed
– You are notified that the Stream has been subscribed.
// You are notified about new Stream in Room streamAdded:event=>{ // Subscribe Stream Enx.subscribe(event.streamId,error=>{ }); } streamSubscribed :event=>{ // Stream is subscribed }
Note! Please do not subscribe to your local stream. The platform will not return your local audio and video stream. Details can be found in Active Talkers section. However, as a publisher you will receive your own Screen Share and Canvas Streaming.