It triggers streamDestroyed after connecting

I am working on a local demo client, but with an openvidu server deployed. It happens that after a connection a few seconds, two or three elapse, the streamDestroyed of a connection is launched, but I do not lose my video or audio transmission. Every time a new client enters the same thing happens. What can be caused by this behavior that starts and then disappears.

Every time I receive a subscription I push it to my subscribers state, and the appearance of those volatile subscriptions makes it have ghost structures inside my design = (.

Have you tested with the official demo application? Do you have the same issue?

I am having the same issue with react-native open-vidu. “the streamDestroyed of a connection is launched, but I do not lose my video or audio transmission”.
To put it more clearly, “streamDestroyed” is fired, even when none of the stream is destroyed.
Because of this I am having trouble listening to the “streamDestroyed”.

    mySession.on('streamDestroyed', (event) => {
        event.preventDefault();
        //cannot put any thing in this function because of the issue
})

Hi, in the react insecure demo It does not happen, I am implementing it with react hooks, the only thing different is the following (what is trying to solve here?):

componentDidMount() {
    window.addEventListener('beforeunload', this.onbeforeunload);
}

componentWillUnmount() {
    window.removeEventListener('beforeunload', this.onbeforeunload);
}

onbeforeunload(event) {
    this.leaveSession();
}

It could be solved by implementing the pattern. Which leads me to assume that those past sessions that were not programmatically disconnected stay alive on the OpenVidu server, and only when another new connection enters does it realize that they no longer exist, then it destroys them.

1 Like

That was helpful. Thank you.