loops - YouTube视频未循环播放

标签 loops video youtube

我正在使用YouTube嵌入代码来显示视频。但是循环选项不起作用。

我该如何工作?

这是我正在使用的代码

<iframe frameborder="0" height="100%" width="100%"
src="https://www.youtube.com/embed/ejoIgFsmqxA?autoplay=1&controls=0&showinfo=0&autohide=1&loop=1"> </iframe>

最佳答案

如果检查Youtube docs,您将看到loop参数有一些限制:

Note: This parameter has limited support in the AS3 player and in IFrame embeds, which could load either the AS3 or HTML5 player. 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 [...]



因此,如果您像这样在iframe src的末尾添加&playlist=ejoIgFsmqxA,则似乎可以正常工作(未经测试):
<iframe frameborder="0" height="100%" width="100%"
src="https://www.youtube.com/embed/ejoIgFsmqxA?autoplay=1&controls=0&showinfo=0&autohide=1&loop=1&playlist=ejoIgFsmqxA"></iframe>

关于loops - YouTube视频未循环播放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27108286/

相关文章:

video - 为什么容器和编解码器有不同的时基?

javascript - 从JS/JQUERY channel 获取最新的YouTube(和抽搐)视频URL

.net - youtube api v3。自动检查上传的视频是否可供其他用户使用

arrays - 在 matlab 中创建 3D 矩阵

c - 数组中元素的数量

c - 在 C 中处理两个文件

javascript - 如何允许在页面上只播放一个嵌入的 YouTube 视频?

Android:在录制视频时将视频保存到 PC/笔记本电脑

ruby - 通过Ruby流YouTube声音?

loops - SilverStripe 添加到 DataList 子 DataList