首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Videogular2: iphone和ipad不具备静音功能

Videogular2: iphone和ipad不具备静音功能
EN

Stack Overflow用户
提问于 2019-02-27 15:00:49
回答 1查看 555关注 0票数 0

我们已经将Videogular2库集成到我们的Range7项目中。无论是Chrome还是Safari,桌面上的一切都很好。但是当我在Iphone和iPad上测试同样的功能时,Mute功能就不起作用了。它在Android设备上运行良好。

视频开始播放后,如果我点击静音图标,我仍然听到音量声音和图标仍然显示为非静音在用户界面。

代码语言:javascript
复制
<vg-player (onPlayerReady)="onPlayerReady($event)">
          <vg-overlay-play></vg-overlay-play>
          <vg-buffering></vg-buffering>
          <vg-controls>
            <vg-play-pause></vg-play-pause>
            <vg-playback-button></vg-playback-button>
            <vg-time-display vgProperty="current" vgFormat="mm:ss"></vg-time-display>
            <vg-time-display vgProperty="total" vgFormat="mm:ss"></vg-time-display>
            <vg-mute vgFor="singleVideo" (click)="betterMute(media)"></vg-mute>
            <vg-fullscreen></vg-fullscreen>
          </vg-controls>
          <video #media [vgMedia]="media" id="singleVideo" preload="auto" playsinline>
            <source src="https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" type="video/mp4" />
          </video>
  </vg-player>

我还尝试将点击事件附加到VG-静音component.By设置音量到'0‘我无法听到声音,但仍然图标显示为’非静音‘在用户界面。

代码语言:javascript
复制
betterMute(media) {
    console.log(this.api);
    console.log(this.target);
    if (typeof this.target['muted'] === 'undefined' || this.target['muted'] === false) {
      this.target['muted'] = true;
      this.target.elem.muted = true;
      this.api.volume = 0;
      this.target.volume = 0;
    } else {
      this.target['muted'] = false;
      this.target.elem.muted = false;
      this.api.volume = 1;
      this.target.volume = 1;
    }
  }

版本

Videogular2: 6.4.0角:7 Safari: 12 Mac : 10

EN

回答 1

Stack Overflow用户

发布于 2019-07-25 07:41:32

<vgMute>之后插入下面的标记

代码语言:javascript
复制
<vg-volume vgFor="singleVideo"></vg-volume>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54908385

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档