Twilio 可编程视频 - 参与者加入房间时的自定义信息 [英] Twilio Programmable video - Custom information when a participant joins a room

查看:27
本文介绍了Twilio 可编程视频 - 参与者加入房间时的自定义信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以有一个用于状态回调的网络钩子.我想知道是否可以向此回调添加自定义参数,尤其是在参与者加入时.我需要知道哪个用户被分配了哪个参与者 ID.我正在使用 video-quickstart-js.在这里有它会很棒?

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?

推荐答案

在收到 join-event 并获取参与者加入的 sid 的回调中,您是否尝试使用 Participant API 通过他们的参与者查找参与者西德?

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;

您可以将 url 修改为 /token?identity=.然后在 /token 处理程序中,您将使用身份生成令牌.

You can modify the url to /token?identity=<whatever>. Then at the /token handler, you would use the identity to generate the token.

希望能帮到你

这篇关于Twilio 可编程视频 - 参与者加入房间时的自定义信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆