有没有办法为 YouTube 播放列表中的每个视频生成单独的 YouTube 嵌入? [英] Is there a way to generate separate YouTube embeds for each video in a YouTube Playlist?

查看:35
本文介绍了有没有办法为 YouTube 播放列表中的每个视频生成单独的 YouTube 嵌入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何在一个播放器中嵌入来自 YouTube 的播放列表,例如使用以下代码中的播放列表 ID:

I know how to embed a playlist from YouTube in one player, for example by using the playlist ID in the code below:

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

我希望在我的网站上有一个部分从 YouTube 播放列表中提取每个视频,并为每个视频制作一个 单独 YouTube 嵌入的单个视频,而不是在一个播放器中连续播放每个视频.这可能吗?我将如何利用 API 来执行此操作?

I want a section on my website that pulls each video from a YouTube playlist and makes a separate single video YouTube embed for each video, instead of playing each video consecutively in one player. Is this possible? How would I utilize the API to go about doing this?

推荐答案

您需要使用 YouTube Data API 从播放列表中获取每个视频:

You need to use the YouTube Data API to get each video from the playlist:

https://developers.google.com/youtube/v3/docs/播放列表项目/列表

还有 YouTube 播放器 API,用于为您要在网页中显示的每个视频创建视频播放器:

And the YouTube Player API to create a Video Player for each video that you want to show in your web page:

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

这篇关于有没有办法为 YouTube 播放列表中的每个视频生成单独的 YouTube 嵌入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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