Friday 2 June 2017

Event notifications Twilio Video

Is it possible to receive notifications on events from Twilio Video on client side through the token the same way as for the Twilio Voice, aka as room.on('participantConnected'), or every event is coming through the status callback URL set in the Room settings? Through the webhook, the events are arriving as soon as i take an action through the client, but otherwise, no notification appears as per the example from the Twilio Video website:

Twilio.Video.connect('$TOKEN', {name:'my-new-room'}).then(function(room) {
  console.log('Successfully joined a Room: ', room);
  room.on('participantConnected', function(participant) {
    console.log('A remote Participant connected: ', participant);
  })
}, function(error) {
    console.error('Unable to connect to Room: ' +  error.message);
});

Right now i am using a webhook of form

app.post('/video',(req, res) => {
    room = req.body;
room.on('disconnected', function (room, error) {
    console.log('a');
});
});



via Adrian

No comments:

Post a Comment