如何循环嵌入的YouTube视频?

时间:2016-02-05 18:01:22

标签: html css video youtube embed

我正在嵌入没有播放控件或视频标题的YouTube视频,但我希望它能够自动播放和循环播放。一切都有效,除了循环。我究竟做错了什么?

<div class='embed-container'><iframe src="https://www.youtube.com/embed/Yo19ZhO7CAc?autoplay=1&loop=1&cc_load_policy=1rel=0&amp;controls=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe></div>

1 个答案:

答案 0 :(得分:7)

你应该在你的src

添加播放列表= VIDEO_ID
<div class='embed-container'>
  <iframe 
      src="https://www.youtube.com/embed/Yo19ZhO7CAc?autoplay=1&loop=1&cc_load_policy=1rel=0&amp;controls=0&amp;showinfo=0&playlist=Yo19ZhO7CAc" 
      frameborder="0" 
      allowfullscreen>
  </iframe>
</div>