循环播放嵌入式YouTube视频 [英] Play an embedded youtube video in loop
问题描述
有人知道如何制作嵌入式YouTube视频以进行循环播放吗?
我试过从官方youtube开发者网站,但它根本不起作用。视频在Firefox和Chrome中结束后不会重播。
< object style =height:390px; width:640px> ;
< param name =movievalue =https://www.youtube.com/v/u1zgFlCw8Aw?version=3&feature=player_embedded&loop=1>
< param name =allowFullScreenvalue =true>
< param name =allowScriptAccessvalue =always>
< embed src =https://www.youtube.com/v/u1zgFlCw8Aw?version=3&feature=player_embedded&loop=1type =application / x-shockwave-flashallowfullscreen = trueallowScriptAccess =alwayswidth =425height =344>
< / object>
我试过Google,但没有任何好的指令。
请尝试在此处查看 https:// developers.google.com/youtube/player_parameters#loop
取自链接
目前,loop参数仅在与播放列表参数配合使用时才起作用。要循环播放单个视频,请将循环参数值设置为1,并将播放列表参数值设置为相同的视频ID已在Player API网址中指定:
http://www.youtube.com/v/VIDEO_ID?version=3&loop=1& ; playlist = VIDEO_ID
您可能会错过与循环参数配合使用的播放列表参数。
演示链接: http://jsfiddle.net/E3Euv/
Does anyone know how to make an embedded youtube video to play in loop?
I have tried the code generated from official youtube developer website but it does not work at all. It doesn't replay after the video ends in both Firefox and Chrome. Here is the generated code that doesn't work.
<object style="height: 390px; width: 640px">
<param name="movie" value="https://www.youtube.com/v/u1zgFlCw8Aw?version=3&feature=player_embedded&loop=1">
<param name="allowFullScreen" value="true">
<param name="allowScriptAccess" value="always">
<embed src="https://www.youtube.com/v/u1zgFlCw8Aw?version=3&feature=player_embedded&loop=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344">
</object>
I have tried to google it but there aren't any good instruction.
Try taking a look here https://developers.google.com/youtube/player_parameters#loop
Taken from the link
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
It appears that you may be missing the playlist parameter needed in conjunction with the loop paramenter.
Demo link: http://jsfiddle.net/E3Euv/
这篇关于循环播放嵌入式YouTube视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!