HTML视频不会在谷歌浏览器上播放,但可以在火狐上播放,但不同



尝试在谷歌浏览器上的文本中播放视频, 它只显示视频的屏幕截图,但不播放整个剪辑。 它能够在文本中显示视频的显示。 但是,在Firefox上,它会播放整个视频,但不会在文本中显示。 似乎找不到我在脚本中的文本信息,或者只是忽略它。 很奇怪。

document.getElementById('bg').play();
body {
margin: 0px;
padding: 0px;
background-color: #fff;
}

#bg {
height: 700px;
width: 1250px;
margin: 0px;
padding: 0px;
position: fixed;
top: 0;
left: 0;
z-index: -1;

}

#info {
font-family: Arial, Helvetica, sans-serif;
font-size: 30em;
letter-spacing: 15px;
margin: 15px 0px;
padding: 0;
fill: #000;
}

#masked {
mask:url("#maskLayer");
}
<svg width="100%" height="100vh">
<mask id="maskLayer">
<rect width="100%" height="100%" fill="#fff"></rect>
<text x="8%" y="55%" id="info">
JSC
</text>
</mask>
<rect id="masked" width"100%" height="100%" fill="#f5f5f5"></rect>
</svg>
<video src="Untitled.mov" id="bg" autoplay="autoplay"></video>

nevermind! managed to work out what was wrong with it. just needed to mute the video! 
<svg width="100%" height="100vh">
<mask id="maskLayer">
<rect width="100%" height="100%" fill="#fff"></rect>
<text x="8%" y="55%" id="info">JSC
</mask>
<rect id="masked" width"100%" height="100%" fill="#f5f5f5"></rect>
</svg>
<video src="Untitled.mp4" id="bg" autoplay loop
muted>
</video>

我不确定">静音"是否是问题所在。

在你的第一篇文章中,你使用了"无标题。移动"。

在你的第二篇文章中,你使用了"无题。MP4"。

如果问题是格式 - 您可以使用未静音的视频。

亲切问候

最新更新