【问题标题】:Agora Remote view changed when local mute video本地静音视频时,Agora 远程视图发生变化
【发布时间】:2021-10-18 10:07:11
【问题描述】:

这是我的 html 文件

<div id="remote-video-frame">
        <div class="mutedVideo" v-if="remotemutedVideo">{{user}}</div>
        <div id="remote-video" class="remote-video" v-if="!remotemutedVideo" v-if="remoteJoined" ></div>
        <div class="content-center waitremote" v-else>
          <div class="pulse"> <i class="fas fa-phone fa-2x"></i> </div>
          <p>Waiting {{singleUser}} to response to this video call now.</p>
        </div>
      </div>

js文件

handleVideoToggle() {
  if (this.mutedVideo) {
    this.localStream.unmuteVideo();
    this.mutedVideo = false;
    
  } else {
    this.localStream.muteVideo();
    this.mutedVideo = true;
  }

我在我的 js 文件中声明了 remotemutedVideo 并试图在 handleVideoToggle 中声明它的状态,但它仍然无法正常工作,我如何从远程获取静音状态在那里并向本地显示远程用户将他们的视频静音而不是仅仅黑屏

【问题讨论】:

    标签: javascript agora.io agora-web-sdk-ng


    【解决方案1】:

    我假设您使用的是 3.x Web SDK。您可以使用它来了解用户何时将自己静音。

    文档:

    https://docs.agora.io/en/All/API%20Reference/web/interfaces/agorartc.stream.html#mutevideo

    代码:

    // Toggle User Avatar
    client.on("mute-video", function (evt) {
        var remoteId = evt.uid;
        if (remoteId != mainStreamId) {
            toggleVisibility('#' + remoteId + '_no-video', true);
        }
    });
    client.on("unmute-video", function (evt) {
        toggleVisibility('#' + evt.uid + '_no-video', false);
    });```
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-07-08
      • 1970-01-01
      • 2022-10-05
      • 2022-08-09
      • 1970-01-01
      • 1970-01-01
      • 2020-11-04
      相关资源
      最近更新 更多