How to embed youtube videos as playlist [closed]

ⅰ亾dé卋堺 提交于 2019-11-30 03:28:09

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.

https://developers.google.com/youtube/youtube_player_demo

<iframe id="ytplayer" type="text/html" width="100%" height="405"
src="https://www.youtube.com/embed/?listType=playlist&list=PL590L5WQmH8eYTXiTTjzo4YnK7vkCqZTI"
frameborder="0" allowfullscreen>

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.

From the youtube docs

Embed a playlist

  1. Sign in to your YouTube account on a computer.
  2. On the left side of the page, select the playlist you want to embed.
  3. Copy the playlist ID from the URL.
  4. Modify the embed code for an individual video by doing the following: In the place of the video ID (after "embed/"), substitute "videoseries?list=". Then paste the playlist ID after the "=".
  5. Paste the code into your blog or website HTML.

Example:

<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLx0sYbCqOb8TBPRdmBHs5Iftvv9TPboYG" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!