gpt4 book ai didi

video - YouTube嵌入具有自动播放功能的视频,并且仅循环触发两次

转载 作者:行者123 更新时间:2023-12-03 06:18:59 25 4
gpt4 key购买 nike

我使用以下代码将YT视频以及autoplayloop嵌入到我的网站中,一切都工作顺利,但我发现它仅循环一次。所以autoplay触发,然后视频触发,仅此而已-接下来,我只能看到无限加载器。任何想法为什么这样以及如何使它成为无限循环?我基于https://developers.google.com/youtube/player_parameters?hl=en上的信息

<iframe width="1000px" height="560px" src="https://www.youtube.com/v/VIDEOID/?playlist=VIDEOID&controls=0&showinfo=0&loop=1&autoplay=1" frameborder="0"></iframe>

先感谢您。

最佳答案

在IFrame Player API documentation中,这里声明:

The loop 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.



如果您想了解嵌入式播放器不同参数的工作方式,可以检查此 link

如果适用于您的情况,也请尝试使用此功能。
<iframe width="1000px" height="560px" src="https://www.youtube.com/embed/VIDEOID/?playlist=VIDEOID&controls=0&showinfo=0&loop=1&autoplay=1" frameborder="0"></iframe>

有关更多信息,请检查此相关的 SO question

关于video - YouTube嵌入具有自动播放功能的视频,并且仅循环触发两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39021696/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com