视频src标签不适用于chrome但在mozilla上工作正常

时间:2017-10-11 21:10:29

标签: javascript

我正致力于在Chrome上制作此视频自动播放,但它无效。它在mozilla上运行良好

<div id="dialog" style="display: none" align = "center">
  <video autoplay="autoplay" controls="controls" poster  width="600" height="340">
    <source src="https://holisticneurodevelopment.com/wp-content/uploads/2017/10/Directions-0-jWvIA2RoWs_beta.webm" type="video/webm">
    <source src="https://holisticneurodevelopment.com/wp-content/uploads/2017/10/Directions-0-jWvIA2RoWs_beta.mp4" type="video/mp4">

    Your browser does not support the video tag.
  </video> 
</div>
<div id="dialog2" style="display: none" align = "center">
  <video autoplay loop preload="auto" poster  width="600" height="340" >
    <source src="https://holisticneurodevelopment.com/wp-content/uploads/2017/10/Directions-0-jWvIA2RoWs_beta.webm" type="video/webm">
    <source src="https://holisticneurodevelopment.com/wp-content/uploads/2017/10/Directions-0-jWvIA2RoWs_beta.mp4" type="video/mp4">

    Your browser does not support the video tag.
  </video>
</div>

他们都没有使用chrome请帮忙

1 个答案:

答案 0 :(得分:0)

当我禁用显示时,它在我的chrome上工作:没有你的造型。这是我的代码

&#13;
&#13;
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<div id="dialog" style="display: one" align = "center">
  <video autoplay="autoplay" controls="controls" poster  width="600" height="340">
    <source src="https://holisticneurodevelopment.com/wp-content/uploads/2017/10/Directions-0-jWvIA2RoWs_beta.webm" type="video/webm">
    <source src="https://holisticneurodevelopment.com/wp-content/uploads/2017/10/Directions-0-jWvIA2RoWs_beta.mp4" type="video/mp4">

    Your browser does not support the video tag.
  </video> 
</div>
<div id="dialog2" style="display: one" align = "center">
  <video autoplay loop preload="auto" poster  width="600" height="340" >
    <source src="https://holisticneurodevelopment.com/wp-content/uploads/2017/10/Directions-0-jWvIA2RoWs_beta.webm" type="video/webm">
    <source src="https://holisticneurodevelopment.com/wp-content/uploads/2017/10/Directions-0-jWvIA2RoWs_beta.mp4" type="video/mp4">

    Your browser does not support the video tag.
  </video>
</div>

</body>
</html>
&#13;
&#13;
&#13;