【问题标题】:Youtube iframe Userlist autoplayYoutube iframe 用户列表自动播放
【发布时间】:2018-07-21 03:25:12
【问题描述】:
我如何autoplay 和loop 用户的最后一个视频?
<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>
【问题讨论】:
标签:
html
iframe
youtube
youtube-api
【解决方案1】:
根据YouTube API,您需要获取用户的视频列表并存储最后一个视频的ID,并将其放在playlist = 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>