【问题标题】:Is firefox mobile/firefox focus supposed to always autoplay videos?firefox mobile/firefox focus 是否应该始终自动播放视频?
【发布时间】:2021-05-02 10:55:51
【问题描述】:

我添加了一个视频作为背景(您可以找到许多技巧),该视频可以在 chrome 移动设备、桌面设备上自动播放,但不能在 Firefox 移动设备和 Firefox Focus 上自动播放。它是 Mozilla 特有的吗?这是移动视频的规则吗?

video#bgvid {
    position: fixed;
    right: 0; bottom: 0;
    min-width: 100%; min-height: 100%;
    width: auto; height: auto; z-index: -10;
    background-size: cover;
}


<script>
    window.onload = function(){
        document.getElementById('bgvid').play();
    }
</script>


<video id="bgvid" playsinline src="bg3.mp4" autoplay="autoplay" loop autoplay muted>
</video>

【问题讨论】:

    标签: android html firefox video autoplay


    【解决方案1】:

    我已经在所有浏览器上进行了测试,它与 javascript 事件完美配合

    <video onloadeddata="this.play();" poster="poster.png" playsinline loop muted controls>
        <source src="video.mp4" type="video/mp4" />
        <source src="video.mp4.webm" type="video/webm" />
        <source src="video.mp4.ogg" type="video/ogg" />
        Your browser does not support the video tag or the file format of this video.
    </video>
    

    【讨论】:

      猜你喜欢
      • 2018-10-01
      • 2016-10-27
      • 2019-11-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多