VideoGular2:静音功能在iPhone,iPad中不起作用

时间:2019-02-27 15:00:49

标签: angular videogular

我们已经将Videogular2库集成到了Angular 7项目中。对于Chrome和Safari,在Desktop上一切正常。但是,当我在Iphone和iPad上测试相同功能时,静音功能无法正常工作。在Android设备上运行正常。

视频开始播放后,如果我单击静音图标,我仍然会听到音量声音,并且UI中的图标仍显示为未静音。

<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-mute组件。通过将音量设置为“ 0”,我听不到声音,但UI中图标仍然显示为“未静音”。

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;
    }
  }

enter image description here

版本

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

1 个答案:

答案 0 :(得分:0)

<vgMute>之后插入以下标签:

<vg-volume vgFor="singleVideo"></vg-volume>