Twilio Programmable video - Custom information when a participant joins a room

百般思念 提交于 2020-01-06 13:10:35

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!