本文介绍了Youtube iframe“循环”不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用生成代码我的视频需要自动播放和循环播放。
但是只有自动播放才起作用,它不会循环播放,演示视频也不起作用。

 < iframe class =embed-responsive-itemid =ytplayer type =text / htmlwidth =640height =360src =https://www.youtube.com/embed/M7lc1UVf-VE?&autoplay=1&loop=1&rel=0& showinfo = 0& color = white& iv_load_policy = 3frameborder =0allowfullscreen> 
< / iframe>


解决方案

尝试添加播放列表参数以及循环。

 < iframe class =embed-responsive-itemid = ytplayertype =text / htmlwidth =640height =360src =https://www.youtube.com/embed/M7lc1UVf-VE?&autoplay=1&loop=1&rel = 0& showinfo = 0& color = white& iv_load_policy = 3& playlist = M7lc1UVf-VE
frameborder =0allowfullscreen>< / iframe>

目前,循环参数仅适用于与播放列表参数配合使用的AS3播放器。要循环播放一个视频,请将循环参数值设置为1,并将播放列表参数值设置为已在Player API网址中指定的相同视频ID: http://www.youtube.com/v/VIDEO_ID?version=3&loop=1&playlist=VIDEO_ID

参考:

I tried to use the YouTube player demo to generate the code necessary for my video to autoplay and loop itself.But only the autoplay works, it doesn't loop, and the demo-video doesn't work either. Here is the code I've used.

<iframe class="embed-responsive-item" id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/M7lc1UVf-VE?&autoplay=1&loop=1&rel=0&showinfo=0&color=white&iv_load_policy=3" frameborder="0" allowfullscreen>
</iframe>
解决方案

Try adding the playlist parameter along with the loop. For playlist, set it's value as the current video id.

<iframe class="embed-responsive-item"id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/M7lc1UVf-VE?&autoplay=1&loop=1&rel=0&showinfo=0&color=white&iv_load_policy=3&playlist=M7lc1UVf-VE"
      frameborder="0" allowfullscreen></iframe>

Currently, the loop parameter only works in the AS3 player when used in conjunction with the playlist parameter. To loop a single video, set the loop parameter value to 1 and set the playlist parameter value to the same video ID already specified in the Player API URL:

http://www.youtube.com/v/VIDEO_ID?version=3&loop=1&playlist=VIDEO_ID

Reference:https://developers.google.com/youtube/player_parameters#loop

这篇关于Youtube iframe“循环”不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 06:56
查看更多