问题
So there is a webhook for STATUS CALLBACKS. I was wondering if I can add custom parameters to this callback especially when a participant joins. I need to know which user gets assigned which participant id. I am using video-quickstart-js. Would be great to have it somewhere here?
回答1:
In the callback when you get a join-event and get the sid of a participant joining, did you try using the Participant API to look up the participant by their sid?
https://www.twilio.com/docs/video/api/participants
As I see it, there is a necessary change to the video quickstart for you to be able to work with identity passed from client side -
// Obtain a token from the server in order to connect to the Room.
$.getJSON('/token', function(data) {
identity = data.identity;
You can modify the url to /token?identity=<whatever>
. Then at the /token
handler, you would use the identity to generate the token.
Hope this helps
来源:https://stackoverflow.com/questions/51909313/twilio-programmable-video-custom-information-when-a-participant-joins-a-room