opentok / opentok-react

React components for OpenTok.js
https://www.npmjs.com/package/opentok-react
MIT License
107 stars 105 forks source link

How to disconnect the call when not on the video call page? #186

Open meljason opened 3 years ago

meljason commented 3 years ago

I currently have the vonage video call implemented on a path /videocall. However, the call does not disconnect when I press the back button on the browser or when I router switch to other pathnames. Is there a way to disconnect the call if the pathname is not equal to /videocall ?

meljason commented 3 years ago

@enricop89 Maybe you could help me with this? Thanks!!

shadab14meb346 commented 3 years ago

@meljason if you are using createSession then the returned object sessionHelper has the method disconnect which you can call to disconnect the call. Also the session has same disconnect method which can be used,