简体   繁体   English

有没有办法在不成为参与者的情况下订阅房间的“participantConnected”事件?

[英]Is there a way to subscribe to a room's `participantConnected` event without becoming a participant?

One can use the room returned from calling Video.connect to subscribe to a room's participantConnected event, so that all kinds of different logic can be executed when a new participant joins a room.可以使用调用Video.connect返回的room来订阅房间的participantConnected事件,以便在新参与者加入房间时执行各种不同的逻辑。 I can also query rooms remotely without Video.connect to see how many participants are currently connected.我还可以在没有Video.connect的情况下远程查询房间,以查看当前连接了多少参与者。 However, I would like be able to use the participantConnected event to display in real time if someone is in a room, without actually joining the room.但是,我希望能够使用participantConnected事件实时显示某人是否在房间内,而无需实际加入房间。

Is this possible and how would I do that without becoming a participant via Video.connect and without polling twilio's api?这可能吗?如果不通过Video.connect成为参与者并且不轮询 twilio 的 api,我将如何做到这一点?

Preferably, I'd like to do this on the javascript side, but I could use twilio's api wrapper library on the server-side if I had to.最好,我想在 javascript 端执行此操作,但如果必须的话,我可以在服务器端使用 twilio 的 api 包装器库。 I just want the client to get notified somehow when someone enters or leaves a room so I can display whether the room is empty in real time.我只是想让客户在有人进入或离开房间时以某种方式得到通知,这样我就可以实时显示房间是否为空。

In order to receive those events with the client SDK, you would need to join the room as you would need a connection to it in order to receive events from it.为了通过客户端 SDK 接收这些事件,您需要加入房间,因为您需要连接到它才能接收来自它的事件。

You can, however, subscribe to status callback webhooks for rooms .但是,您可以订阅房间的状态回调网络钩子 There are lots of events that a room emits that can be received as webhooks, such as room-created , room-ended , and, as you've asked for, participant-connected .房间发出的许多事件都可以作为 webhook 接收,例如room-createdroom-ended以及您要求的participant-connected

You can set the statusCallback when you create a room with the REST API and you can see all the parameters that are sent as part of the webhook request here .您可以在使用 REST API 创建房间时设置 statusCallback statusCallback您可以在此处看到作为 webhook 请求的一部分发送的所有参数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有什么办法可以避免嵌套订阅吗? - Is there any way to avoid nested subscribe? AWS Lambda 可以订阅多个事件源类型吗 - Can a AWS Lambda Subscribe to Multiple Event Source Types Firebase 实时数据库订阅在 Xamarin Forms 中没有插入/更新时触发 - Firebase Realtime Database subscribe fires Without Insert/Update in Xamarin Forms 如何订阅twilio号码的报错信息? - How to subscribe twilio number's error messages? 如何在不重复读取量的情况下同时订阅整个集合和其中的文档? - How to subscribe to an entire collection and a document within it simultaneously without duplicating the amount of reads? 如何以用户可以使用 URL 订阅的方式通过 NodeJS API 提供 ics 文件? - How to serve an ics file through NodeJS API in a way that user can subscribe using URL? Azure B2C 事件记录 - 是否可以在客户注销时以与在 Azure 门户中看到登录相同的方式进行记录? - Azure B2C event logging - Is it possible to log when customer sign-outs the same way as it's possible to see sing-ins in the Azure Portal? 参与者视频室 - Participant video rooms 控制 S3 的最佳方式是什么? - What's the best way to control S3? 在 S3 事件的自定义事件模式中使用通配符 - Using wildcard in Custom event pattern for the S3 event
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM