0

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.

Robin
  • 4,902
  • 2
  • 27
  • 43

2 Answers2

0

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

session.on('streamDestroyed', reason => {
    //...
});
PrashantAjani
  • 376
  • 3
  • 6
  • I tested almost every event, May be something wrong with local environment. My project need internet connection to run successfully. When i turn off wifi for testing, my project is also unable to run - may be this is the reason why event is not triggered. Not sure... Everything is all right from server side, i deployed my server on cloud. – Robin Dec 26 '19 at 05:15
0

Try the following:

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

and

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

Both are working for me.

ASANIAN
  • 372
  • 2
  • 8