Youtube iframe用户列表自动播放

时间:2018-02-10 13:35:35

标签: html iframe youtube youtube-api

我如何autoplayloop来自用户的最后一个视频?

<iframe width="720" height="480" src="http://www.youtube.com/embed?max-results=1&showinfo=0&rel=0&controls=0&autoplay=1&listType=user_uploads&list=DchRussia" frameborder="0" allowfullscreen></iframe>

1 个答案:

答案 0 :(得分:0)

根据YouTube API,您需要获取用户视频列表并存储上一个视频的ID,并将其放在播放列表后面= VIDEO_ID

所以你的iframe看起来像这样

<iframe width="720" height="480" src="https://www.youtube.com/embed/LAST_VIDEO_ID?rel=0&showinfo=0&rel=0&controls=0&autoplay=1&loop=1&playlist=LAST_VIDEO_ID" frameborder="0" allowfullscreen></iframe>
相关问题