如何将 YouTube 视频嵌入为播放列表 [英] How to embed youtube videos as playlist

查看:41
本文介绍了如何将 YouTube 视频嵌入为播放列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有许多 youtube 视频剪辑,我想知道是否可以将它们作为 youtube 播放列表嵌入网站,以便在剪辑完成后自动开始播放下一个视频.YouTube API 是否有这样的功能.如果不可能,最好的方法是什么.提前致谢.

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.

推荐答案

实际上有两种方法可以从 youtube 嵌入播放列表.在第一种方法中,您可以直接指定要在嵌入播放器中播放的所有视频.

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>

每个视频 ID 必须使用逗号分隔.

Each video ID must be separated by using comma.

其次,您可以使用播放列表 ID 嵌入已存在于 youtube 中的播放列表

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>

这篇关于如何将 YouTube 视频嵌入为播放列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆