是否可以远程参与者 track.stop()

发布于 2025-01-14 19:59:47 字数 633 浏览 0 评论 0原文

我尝试通过以下代码

  // remove particaipant tracks
  vm.tc.currentVideoRoom.participants.forEach((remoteParticipant) => {
      remoteParticipant.tracks.forEach((track) => {
        console.log(track); //here i found the remote participant video and audio track. 

        track.stop() // but here i found "track.stop() is not a function" error
       
      })
  });

检查 twilio 视频文档。但在这里没有找到任何解决方案。

我还检查了 GitHub 问题此处的链接。那个人提到远程参与者跟踪停止是不可能的。

那么我如何使用 Twilio 停止远程参与者轨迹?

I tried by following codes

  // remove particaipant tracks
  vm.tc.currentVideoRoom.participants.forEach((remoteParticipant) => {
      remoteParticipant.tracks.forEach((track) => {
        console.log(track); //here i found the remote participant video and audio track. 

        track.stop() // but here i found "track.stop() is not a function" error
       
      })
  });

I check twilio video documentation. but don't found any solution in here.

and i also check GitHub issue here the link. the guy mention remote participants tracks stop is not possible.

then how can i stop remote participant tracks using Twilio?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

海螺姑娘 2025-01-21 19:59:47

你无法像这样停止远程轨道。远程轨道对象是来自远程参与者的作为流的轨道的表示。本地轨道是将轨道表示为来自设备摄像头或麦克风的流,因此当您调用 stop 时,它会停止与硬件交互。

因此,您无法在远程轨道上调用 stop,因为这意味着您正在尝试停止来自远程参与者的摄像头或麦克风的轨道。

如果您想停止看到或听到远程轨道,您可以 从页面分离轨道。如果您想取消订阅该曲目以便停止接收其流,可以使用 跟踪订阅 API。如果您想实际停止远程参与者的设备,则必须向远程参与者发送一条消息(可能通过 DataTrack API)并让它们在本地执行 track.stop()

You can't stop a remote track like that. The remote track object is a representation of the track as a stream from the remote participant as a stream. A local track is a representation of a track as a stream from the device's camera or microphone, so when you call stop, it stops interacting with the hardware.

So you cannot call stop on a remote track, because that would imply you're trying to stop the track coming from the remote participant's camera or microphone.

If you want to stop seeing or hearing a remote track, you can detach the track from the page. If you want to unsubscribe from the track so that you stop receiving the stream of it, you can use the track subscriptions API. And if you want to actually stop the remote participant's device, you would have to send a message to the remote participant (possibly via the DataTrack API) and have them execute the track.stop() locally.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文