Add a native Twilio Video chat interface to your app and join video call rooms from your website with the JavaScript Bridge.
Add a native Twilio Video chat interface to your app. It gives your users an integrated video chat experience that performs better than a web-based client.
Implementation guide
To join a video call, define a callback function in JavaScript, for example:
function twilio_callback(data) { if (data.error) { console.log('Twilio Error: ' + data.error); } else if (data.status) { console.log('Twilio Status: ' + data.status); }}
Then, run the following JavaScript function, passing in the name of your callback function along with the other parameters displayName, token, and identity.
// This command returns a promise if 'callback' is passedmedian.twilio.video.join({'displayName': 'room', 'token': 'token', 'identity': 'identity', 'callback': twilio_callback});
Details of the query parameters:
displayName: The name of the video call room to join.
identity: The name that will be shown on the video call room for the user joining the room.
token: The Access Token received from Twilio after authenticating with Twilio. For more information about how to obtain the access token: Twilio API: Access Tokens
PromisesSome JavaScript Bridge commands return promises. They are usually declared as such
through a comment to help you identify them. See
promises in the JavaScript Bridge.