Be sure when user is unsubscribed

Hey,

In our application, we are suffering from problems with publishers not being heard by some subscribers, with frozen media. In 100% of cases if subscribers who are not listening refresh the page, they will be able to hear the publisher again. Likewise, if the publisher refresh the page, subscribers can hear the publisher again.

We tried to use openvidu-browser solutions to solve the problem, but we were unsuccessful. So we decided to deal with these problems in the logic of our application.
Every 2 seconds, if the publisher has said something, he sends a signal to all subscribers informing that he is speaking.

Upon receiving this signal, the subscriber checks when was the last time he received the publisherStartSpeaking event and if it was more than 10 seconds, the subscriber performs a session.unsubscribe() and then performs a session.subscribe(). We verified that the unsubscribe function does not trigger any event indicating when the user was actually unsubscribed. For now, with a 2-second setTimeout after session.unsubscribe() we managed to perform session.subscribe() from the same stream. But if we try to use session.unsubscribe() and immediately afterwards execute a session.subscribe() from the same stream we receive an error.

The videoElementDestroyed event is never been fired. I think that is because we handle the videos by our app. We use Vue.js.

We are sorry @Levi_Nobrega,

So your current app is able to detect broken audio, right? Can you help us to solve to issue in OpenVidu? I mean, can you create a report for us with KMS logs and OpenVidu logs when problems appear so we are able to detect the problem? It is not reasonable that application has to “reset” things to make it work.

Regards

Already included in master branch. Available in 2.18.0