php - Youtube Data API v3 - 禁用播放列表控件

标签 php html youtube youtube-api

我目前正在创建这个只有 200x200 视频播放器空间的网站,所以我需要减少“视频控制面板”上的杂乱程度。
这是播放器现在的样子,我需要删除 |< & >|纽扣


谢谢!

片段:

<iframe id="ytplayer" type="text/html" width="200" height="200" src="https://www.youtube.com/embed/?listType=playlist&list={PLAYLISTIDHERE}" >

最佳答案

这可能取决于您的代码,但您可以尝试“controls=0”,如下所示:
http://www.youtube.com/embed/ $VIDEOID?controls=0
您将 $VIDEOID 替换为有效的视频 ID。

请注意,这也将删除在播放期间在视频中前进和后退的 slider 。
最后要删除相关视频,播放后添加参数“rel=0”,如下:
http://www.youtube.com/embed/ $VIDEOID?controls=0&rel=0

有关可用参数的列表,请参阅:
https://developers.google.com/youtube/player_parameters

尝试:

<iframe id="ytplayer" type="text/html" width="200" height="200" src="https://www.youtube.com/embed/?controls=0&listType=playlist&list={PLAYLISTIDHERE}" />

似乎播放列表选择确实显示在左上角,但不再使用控件 = 0。

一个选项可能是使用 autohide=1。我还按照建议添加了moderatebranding=1。
<iframe id="ytplayer" width="200" height="200" src="https://www.youtube.com/embed/?modestbranding=1&autohide=1&listType=playlist&list={PLAYLISTIDHERE}" />

关于php - Youtube Data API v3 - 禁用播放列表控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18801223/

相关文章:

powershell - 在Windows上的脚本中的浏览器中打开并播放YouTube

html - 如何更改 Bootstrap 按钮组的事件颜色以使每个按钮具有不同的颜色

html - 无法在网页中的元素上设置完整边框

php - 带 printf 的千位分隔符

php - 如何使用 PHP 和 MySQL 从数据库检索数据并缩进返回的结果?

javascript - 如何获取 window.open() 窗口的空闲时间?

youtube - 视频文件上的谷歌语音识别

youtube - 如何一次(而不是一一停用)禁用我的2000 Youtube视频上的评论?

php - 我可以通过 PHP 语言控制硬件吗?

PHP - 在同一个 try-catch 中包装一个变量 block