How do I know when a user's publish reached subscribers?

In my application users with the role PUBLISHER by default do not publish your stream. First they send a signal to the user with role MODERATOR and this user approves with another signal so that the stream is published for everyone.

In our tests, we noticed that when publishing these users, the streamCreated and streamPlaying events are triggered by the Publisher object but only about 6 seconds after these events are triggered that the subscribers start receiving the audio and image from that Publisher. Because of this, everything that Publisher sent image and audio is lost in those 6 seconds.

So how long does it take for a publisher’s audio to reach subscribers and how do you know for sure that audio is reaching subscribers? We are unable to trust the streamCreated and streamPlaying events issued by Publisher.

We will take a look to know if things can be improved.

Thanks for reporting

1 Like

Any news on this?

Thanks

Hi,

I don’t understand the problematic. One thing is the streamCreated and streamPlaying event on the Publisher side, and the other on the Subscriber.

If you want to know when a Publisher stream has been properly subscribed and started playing in a particular subscriber, then listen first to streamCreated event on the Session object to be able to subscribe the remote user to it, and then if you want so streamPlaying event on the Subscriber object to know when the video element started reproducing media.

Publisher will trigger its own “streamCreated” event before any subscriber, because its local media is able to play before.

1 Like

Thanks, @pabloFuente!
That works for my case.

1 Like