Video API
Overview
Release Notes
Discover & Test
Build Your Solution
Client SDKs
Migration Guides
OpenTok Server SDK Transition Guides
Guides
Overview
Create a Token
Create a Session
Joining a Session
Getting Started
Initializing a Session Object
Connecting to a session
Disconnect from a Session
Detecting when you have disconnected
Automatic reconnection
Detecting when clients have connected and disconnected
Troubleshooting session connection issues (Javascript)
Troubleshooting session connection issues (React Native)
Audio fallback
Moderation
Publishing Streams
Subscribe to Streams
Overview
Detect when streams are created in a session
Subscribe to a stream
Automatic reconnection
Detecting when streams end and a subscriber's video is disabled
Getting information about a stream
Unsubscribe from a stream (Javascript only)
Managing subscriber streams (Javascript Only)
Managing subscriber streams (React Native)
Troubleshooting (Javascript Only)
UI Customization
General customization
Swift
Web Only
Directly accessing the video element for a Publisher or Subscriber
Displaying a custom UI element when Subscriber audio is blocked
Adjusting video cropping and letterboxing
Hiding all built-in user interface controls for videos
Displaying or hiding the name in a video
Setting an image to display in audio-only mode
Setting the initial position and dimensions of a video
Accessing MediaStream objects
Accessing MediaStream objects for Subscribers
Resizing or repositioning a video
Getting a snapshot image of a video
Management & Signaling
Video Session Customization
Archiving
Broadcast
Experience Composer
SIP Interconnect
AI Connectors
Media Processor
Additional Resources
Security
Networking & Environment
Tools & Debugging
Tutorials
API Reference
Developer Tools
Vonage Video API Reference App for React
Manage & Support
Video Express
Video + AI
Detecting when you have disconnected
You setup an EventListner to execute a function if a user is disconnected from a session.
For example, the function can notify the user whenever they loose connection and are no longer connected to the session.
When your client disconnects from a session, the Session object dispatches a sessionDisconnected event:
The reason property of the event is a string that describes why the session disconnected. For example, the previous example notifies the user if they were disconnected due to the network connection terminating.
For details, see SessionDisconnectEvent.
When your client disconnects from a session, the OTSession component dispatches a sessionDisconnected event:
Navigation
Detecting when you have disconnected