Hi! Everyone, hope you all are fine.
Today in this post I will tell you how you can embed YouTube playlist using iframe tag. As we use iframe tag to embed YouTube videos which also supports HTML5 player. Same way we can use iframe tag to embed YouTube playlist. And embedding playlist instead on multiple YouTube videos in a webpage also help us to reduce page loading time.
This is how old YouTube playlist code look like
<object width="516" height="361"> <param name="movie" value="http://www.youtube.com/p/PLAYLIST_ID"></param> <param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param> <embed src="http://www.youtube.com/p/PLAYLIST_ID" type="application/x-shockwave-flash" width="516" height="361" allowscriptaccess="always" allowfullscreen="true"></embed> </object>
And this above old code looks hard to remember also so let me give you iframe codewhich is simple and easy to remember
<iframe src="http://www.youtube.com/embed/p/PLAYLIST_ID" width="516" height="361" frameborder="0"></iframe>
In the above code you just need to change PLAYLIST_ID with your YouTube playlist ID
Here is a demo of YouTube playlist embedded with iframe tag
If you have any question or problem let me know.