Join a Video Room

If you are building a Video application, you can use the Video Room Token you obtained in the authentication step to join a room from the JS client:

const roomSession = new SignalWire.Video.RoomSession({
  token: '<YourJWT>',
  rootElement: document.getElementById('myRoot'), // an html element to display the video
  audio: true,
  video: true,
})

try {
  await roomSession.join()
} catch (error) {
  console.error('Error', error)
}
const roomSession = new SignalWire.Video.RoomSession({
  token: '<YourJWT>',
  rootElement: document.getElementById('myRoot'), // an html element to display the video
  audio: true,
  video: true,
})

roomSession.join().then(() => {
  // Use roomSession ...
}).catch(error => {
  console.error('Error', error)
})

You can then use the roomSession object to interact with the room.


Did this page help you?