我们已经将Videogular2库集成到我们的Range7项目中。无论是Chrome还是Safari,桌面上的一切都很好。但是当我在Iphone和iPad上测试同样的功能时,Mute功能就不起作用了。它在Android设备上运行良好。
视频开始播放后,如果我点击静音图标,我仍然听到音量声音和图标仍然显示为非静音在用户界面。
<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‘我无法听到声音,但仍然图标显示为’非静音‘在用户界面。
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
发布于 2019-07-25 07:41:32
在<vgMute>之后插入下面的标记
<vg-volume vgFor="singleVideo"></vg-volume>https://stackoverflow.com/questions/54908385
复制相似问题