隐藏“更多视频"在youtube iframe中停止视频时 [英] hide "more videos" within youtube iframe when stop video

查看:122
本文介绍了隐藏“更多视频"在youtube iframe中停止视频时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户停止视频时,如何在YouTube iframe中隐藏更多视频"部分?

How to hide the "more videos" section in Youtube iframes, when the user stops the video?

示例:

<iframe width="750" height="420" src="https://www.youtube/embed/cZnsLVArIt8?rel=0&iv_load_policy=3" frameborder="0" allowfullscreen></iframe>

我无法在此处找到任何解决方案.

I cant find any solution here.

推荐答案

按照 https://developers.google.com/youtube/player_parameters#release_notes_08_23_2018

rel参数的行为在9月或之后改变 2018年2月25日.更改的结果是,您将无法 禁用相关视频.但是,您可以选择 指定播放器中显示的相关视频应来自 与刚刚播放的视频相同的频道.

The behavior for the rel parameter is changing on or after September 25, 2018. The effect of the change is that you will not be able to disable related videos. However, you will have the option of specifying that the related videos shown in the player should be from the same channel as the video that was just played.

更具体地说:在更改之前,如果参数的值为 设置为0,则播放器不会显示相关视频.之后 更改,如果rel参数设置为0,则播放器将显示相关 来自同一频道的视频 玩过.

To be more specific: Prior to the change, if the parameter's value is set to 0, then the player does not show related videos. After the change, if the rel parameter is set to 0, the player will show related videos that are from the same channel as the video that was just played.

似乎YouTube打算不提供禁用相关视频功能的功能.

It seems that it is youtubes intention to not give the ability to disable related videos functionality.

由于CORS,jQuery方式似乎也不起作用,就像我猜的CSS一样.

jquery way seems to not work either due to CORS, as would be css I guess.

$(".media-youtube-player").contents().find(".ytp-pause-overlay").remove();

导致阻止了源为"xxx"的帧访问跨源帧.

causing blocked a frame with origin "xxx" from accessing a cross-origin frame.

不确定是否有办法做到这一点,除非youtube再次允许.也要禁用此功能,以感谢您的帮助.

Not sure if there is a way doing this, unless youtube allows it again. Want to disable this too so any help is appreciated.

这篇关于隐藏“更多视频"在youtube iframe中停止视频时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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