Reputation: 1062
The <amp-youtube>
extension supports embedding an individual YouTube video but how do you embed a YouTube playlist on an AMP page?
Upvotes: 1
Views: 1315
Reputation: 56
You can use amp-youtube for playlist like this
<amp-youtube
width="480"
height="270"
layout="responsive"
data-videoid="FIRST VIDEO ID IS HERE"
data-param-listType="playlist"
data-param-list="PLAYLIST ID IS HERE"></amp-youtube>
Upvotes: 3
Reputation: 56
Hey just checked it and it works perfectly
this is an Example code playing a video playlist
<amp-iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLjwWT1Xy3c4UtTRb5Kysk5NHmggxJc1vw" frameborder="0" allowfullscreen="" sandbox="allow-scripts allow-same-origin" sizes="(min-width: 560px) 560px, 100vw" class="amp-wp-enforced-sizes"><div placeholder="" class="amp-wp-iframe-placeholder"></div></amp-iframe>
I tested playing playlist with amp-youtube and it does not work because amp-youtube requires an attribute data-videoid this does not work with playlist ID's
Upvotes: 3
Reputation: 7741
Well, you cannot use the <amp-youtube>
to embed a YouTube Playlist. The <amp-youtube>
is only used to embed a single/individual video.
A playlist in YouTube has this following form.
https://www.youtube.com/embed/videoseries?list=PLlVlyGVtvuVll4Te_6kO4CsI7dcPJKQLt
So instead of <amp-youtube>
, try to use the <amp-iframe>
with it and check if it works.
Upvotes: -1