Chrome 64更新 - 静音代码不再适用< video> [英] Chrome 64 Update - muted tag no longer working in <video>
本文介绍了Chrome 64更新 - 静音代码不再适用< video>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
https://jsfiddle.net/kaldenfi/rpmk93wm/3/
<div ng-app="myApp" ng-controller="testCtrl">
<section ng-if="url">
<video id="player1" playsinline autoplay loop muted volume="0.0">
<source ng-src="{{url | trusturl}}" type="video/mp4"> Your browser does not support the video tag.
</video>
</section>
</div>
更新至Chrome 64后,此功能不再让我的视频静音。如果我在ng-if和hardcode以外的地方拍摄视频,它的工作原理应该是这样的
After updated to chrome 64, this is no longer muting my video. If i take the video outside of the ng-if and hardcode the url it works as it should
任何解决方案?
Any solutions?
推荐答案
我在我正在处理的Ember应用程序中遇到同样的问题。
I had the same issue in an Ember application I am working on.
我有两个解决方案:
The 2 solutions I had:
- 将
< video>
标签添加到index.html中,就像您类似地创建了一个可以在init
或window.onload
hook
mutePlayer1VideoHack(){
const player1Video = document.getElementById('player1');
player1Video.setAttribute('muted',true);
}
- move the
<video>
tag(s) to the index.html, like you similarly did - create a function that can be called on an
init
orwindow.onload
hookmutePlayer1VideoHack() { const player1Video = document.getElementById('player1'); player1Video.setAttribute('muted', true); }
我将#2中的函数名用< c $ c> Hack ,如果这是一个真正的Chrome 64 bug将被修复。我将为解决方案#1提供我的案例
I prepended the function name in #2 with Hack
in the case this is a true Chrome 64 bug that will be fixed. I am going with solution #1 for my case
这篇关于Chrome 64更新 - 静音代码不再适用< video>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文