在网页中嵌入youtube播放列表

时间:2018-01-20 17:25:24

标签: c# asp.net youtube

如果不使用Youtube API,有没有办法在您的网页中嵌入播放列表?

我知道您可以执行以下操作:

<iframe src="https://www.youtube.com/embed/<%#Eval("MyLinkField")%>?rel=0"></iframe>

其中MyLinkField是youtube用于每个视频的11个字符的ID。

我无法弄清楚如何将播放列表嵌入网页中。

1 个答案:

答案 0 :(得分:0)

我认为这就是你所需要的:

<iframe src="https://www.youtube.com/embed?listType=playlist&list=PLAYLIST_ID"></iframe>

PLAYLIST_ID是查看播放列表时来自查询字符串的ID:

enter image description here

https://jsfiddle.net/71q4pe8v/