我在iframe标签中嵌入了一个.mp4视频。我不知道怎么关掉自动播放。我什么都试过了:autoplay=“false”,autoplay=“0”,autoplay=“false”,autoplay=“0”,但似乎什么都没用。这是我的代码:

<div class="embed-responsive embed-responsive-16by9">
  <iframe class="embed-responsive-item behind" src='videos/cloud_computing.mp4' width='640' height='360' style='width:640px;height:360px;'></iframe>
</div>

在此之前有一个YouTube视频(不是自动播放的),代码如下:
<div class="embed-responsive embed-responsive-16by9">
  <iframe class="embed-responsive-item behind" src='https://www.youtube.com/embed/v1uyQZNg2vE?enablejsapi=1&amp;html5=1&amp;hd=1&amp;wmode=transparent&amp;controls=1&amp;showinfo=0;rel=0;' width='640' height='360' style='width:640px;height:360px;'></iframe>
</div>

最佳答案

如果其他方法都不起作用,请尝试添加

&autoStart=false

在你的src结束时。如果这不起作用,那么你可能需要使用不同的媒体来嵌入你的视频。相反,也许用
<video>
   <source src="videos/cloud_computing.mp4" type="video/mp4">
</video>

关于html - 如何关闭自动播放,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31434077/

10-12 21:35