How to embed youtube videos as playlist

I have numerous youtube video clips, and I was wondering if it is possible to embed them on the site as youtube playlist, so that the next video starts playing automatically once the clip finishes. Is there such functionality either with YouTube API or without. If not possible, what would be the best approach. Thanks in advance.


Actually there are two ways to embed playlists from youtube. In the first method you can directly specify all the videos that you want to play in the embed player.

<iframe width="720" height="405" src="https://www.youtube.com/embed/VIDEO_ID?playlist=VIDEOID_1,VIDEOID_2"frameborder="0" allowfullscreen>

Each video ID must be separated by using comma.

Secondly, you can embed a playlist that is already present in youtube using the playlist ID

<iframe width="720" height="405" src="https://www.youtube.com/embed/?listType=playlist&list=PLAYLIST_ID" frameborder="0" allowfullscreen>

在这里输入图像描述


I found the solution,

http://www.youtube.com/v/PRIMARYVIDEO_ID?version=3&loop=1&playlist=VIDEO_ID1,VIDEO_ID2

Where the VIDEO_ID1, and VIDEO_ID2... are the videos i want to include in the playlist.


You can simply use embedded playlists.

Here is an example of one of my playlists!

<iframe width="560" height="315" src="http://www.youtube.com/embed/videoseries?list=PLZtX_kbNpbDjYSUj-huH5pOKxifUNDi1O" frameborder="0" allowfullscreen></iframe>

In addition you could use the Javascript Player API to create custom behavior.

链接地址: http://www.djcxy.com/p/28948.html

上一篇: 使用youtube v3 API检索YouTube播放列表中的所有视频

下一篇: 如何将YouTube视频嵌入播放列表