Robin
Robin

Reputation: 5427

openVidu - connectionDestroyed / sessionDisconnected event doesn't trigger when websocket connection lost because of network problem

Publisher doesn't notify when connection is destroyed or diconnected. In Openvidu docs, they suggest connectionDestroyed & sessionDisconnected event but it doesn't trigger anymore. How can i solve this issue ? From publisher side i need to inform publisher while network is lost and connection is destroyed.

session.on('connectionDestroyed', reason => {
    //...
    //Doesn't trigger
});

session.on('sessionDisconnected', reason => {
    //...
    //Doesn't trigger
});

Updated:

sessionDisconnected event is invoked when i reconnect successfully or gracefully close the session. But i need to inform publisher immediately when internet connection is lost.

Upvotes: 0

Views: 593

Answers (2)

ASANIAN
ASANIAN

Reputation: 400

Try the following:

session.on('streamCreated', event => { }

and

session.on('sessionDisconnected', (event) => { }

Both are working for me.

Upvotes: 0

PrashantAjani
PrashantAjani

Reputation: 396

Not sure if Openvidu has changed the event names but you can also try following as per doc - here

session.on('streamDestroyed', reason => {
    //...
});

Upvotes: 0

Related Questions