如何将多个参数添加到嵌入式 youtube 视频

How to add multiple parameters to an embeded youtube video

我有这段代码,我希望视频自动播放(现在正在执行),但我也希望它循环播放,但我似乎找不到同时执行这两项操作的方法。

<iframe width="1280" height="720" src="https://www.youtube.com/embed/x5zQ5dr1qR4?autoplay=1" frameborder="0" allowfullscreen></iframe>

这些是我要添加的参数

playlist=x5zQ5dr1qR4&loop=1

只需添加参数 loop=1 和具有原始视频代码值的播放列表:

The docs

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:

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

https://www.youtube.com/embed/x5zQ5dr1qR4?autoplay=1&loop=1&playlist=x5zQ5dr1qR4

它对我来说很好。