youtube - iframe 嵌入代码中 YouTube "-nocookie: and "rel=0"的含义

标签 youtube

如果我从 YouTube 视频中复制嵌入代码,则会得到以下代码。

<iframe width="560" height="315" src="//www.youtube.com/embed/kk5xfK0ovrk" frameborder="0" allowfullscreen></iframe>

如果我为视频选择 1280x760 大小并复制该嵌入代码,我会得到:
<iframe width="1280" height="720" src="//www.youtube-nocookie.com/embed/kk5xfK0ovrk?rel=0" frameborder="0" allowfullscreen></iframe>

但是如果我只使用原始嵌入代码并且只将宽度更改为 1280 并将高度更改为 720,我也会得到一个完美的 1280x760 视频。所以我想知道 YouTube 为 1280x560 案例生成的代码中的“-nocookie”和“rel=0”的目的是什么。

谢谢

最佳答案

YouTube 的新“nocookie”功能和引自 Youtube's Rel=0文档:

rel (supported players: AS3, AS2, HTML5) Values: 0 or 1. Default is 1. This parameter indicates whether the player should show related videos when playback of the initial video ends.

But after 25 September 2018, you will not be able to disable related videos. Instead, if the rel parameter is set to 0, related videos will come from the same channel as the video that was just played.



如需更多信息,您可以阅读 YouTube Embedded Players and Player Parameters其中列出了所有参数。

关于youtube - iframe 嵌入代码中 YouTube "-nocookie: and "rel=0"的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18922728/

相关文章:

php - 捕获YouTube播放器的开始按钮和观看的秒数

php - 如何从 Youtube channel 获取所有视频 ID

java - fragment 中的 YouTubePlayerSupportFragment

c# - 从Youtube链接检索视频流

javascript - 处理背景YouTube视频不与tubular.js一起播放

php - 如何以分页方式从 YouTube 获取用户视频

wordpress - 从YouTube API将数据保存到自定义字段

php - PHP:如何解析从YouTube JSON响应派生的关联数组?

javascript - 如何为我嵌入的YouTube播放列表添加Facebook分享按钮

youtube - youtube:在网站中使用youtube播放器