【问题标题】:html5 video in chrome only plays with autoplay?chrome中的html5视频只能自动播放?
【发布时间】:2018-05-08 01:11:15
【问题描述】:

我有以下 HTML5 视频代码,它在除 Chrome 之外的所有浏览器中都能正常工作:

<video id="video-03" preload controls poster="/images/videos/testing.jpg" width="480" height="854">
   <source src="/images/videos/testing.mp4" type="video/mp4">
   <source src="/images/videos/testing.webm" type="video/webm">
   <source src="/images/videos/testing.ogv" type="video/ogg">
</video>

想要开启自动播放。

我可以让它在 Chrome 中工作的唯一方法是,如果自动播放已打开,但仍然没有控制来停止/启动它。

知道为什么 Chrome 不显示控件吗?即使我右键单击视频,它也会在“显示控件”旁边打勾。所以 Chrome 认为它们正在显示,但那里什么都没有。

【问题讨论】:

  • 您是否安装了任何扩展程序?扩展可能会弄乱它。如果没有,请在隐身模式下尝试。

标签: html google-chrome video


【解决方案1】:

你卡在哪里了? 看看下面的代码,它显示了所有控件,也许你的系统有另一个问题。

<!DOCTYPE html>
<html>
<body>

<video width="320" height="240" controls>
  <source src="https://www.w3schools.com/tags/movie.mp4" type="video/mp4">
  <source src="https://www.w3schools.com/tags/movie.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>

<p><strong>Note:</strong> The video tag is not supported in Internet Explorer 8 and earlier versions.</p>

</body>
</html>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-02-25
    • 2014-01-04
    • 2021-11-25
    • 1970-01-01
    • 1970-01-01
    • 2013-10-25
    • 1970-01-01
    • 2019-03-20
    相关资源
    最近更新 更多