包含视频的 YouTube 播放器 API 列表 [英] YouTube Player API list with videos

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

问题描述

我正在使用 YouTube 播放器 API.

I am using the YouTube Player API.

我想直接在我的代码中制作我自己的自定义播放列表(不要使用来自 youtube 的播放列表 ID)

I want to make my own custom playlist directly in my code (not to use playlist ID from youtube)

这是我的播放列表代码,它不起作用

Here is my playlist code which doesn't work

player.loadPlaylist({
    list:['mGalEx6ufUw', 'TaCUBtzKAnA', '4v8SPz4VfsU'], 
    listType: 'playlist', 
    index:0, 
    startSeconds:0, 
    suggestedQuality:'medium'
});

正如文档所说,我可以将播放列表 ID 或带有视频 ID 的数组传递给参数 list,但它不起作用.

As the documentation says I can pass playlist ID or array with video IDs to parameter list, but it's not working.

如果我写播放列表 ID 而不是带有视频 ID 的数组,它就可以工作.

If I write playlist ID instead of the array with video IDs it works.

推荐答案

我在 Google 网上论坛.

您可以使用参数语法而不是对象语法使其工作.更多信息此处

You can make this working with the argument syntax instead of object syntax. More info here

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

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