【问题标题】:How to remove related video from YouTube embedded Iframe code in html?如何从 html 中的 YouTube 嵌入式 Iframe 代码中删除相关视频?
【发布时间】:2019-04-28 01:51:34
【问题描述】:

我面临一个问题,当我使用带有给定 iframe 的 youtube 嵌入式代码时,它会显示相关视频,我想从 iframe 隐藏该相关视频栏?

那么有什么办法可以隐藏相关视频吗?

看我下面的图片和代码:

<iframe 
id="ytplayer" 
type="text/html" 
width="720" 
height="405"
src="https://www.youtube.com/embed/M7lc1UVf-VE?autoplay=1&controls=0&disablekb=1&fs=0&modestbranding=1&iv_load_policy=3";
frameborder="0" 
allowfullscreen>

另外,我也使用了下面的代码。但它仍然显示更多视频链接。

<iframe 
id="ytplayer" 
type="text/html" 
width="720" 
height="405"
src="https://www.youtube.com/embed/M7lc1UVf-VE?rel=0";
frameborder="0" 
allowfullscreen>

【问题讨论】:

标签: javascript iframe youtube


【解决方案1】:

您必须使用“?”向 url 添加参数时。使用以下更新 src

"https://www.youtube.com/embed/M7lc1UVf-VE?rel=0"

【讨论】:

【解决方案2】:

你可以用css隐藏它

.html5-endscreen{
display: none !important;
}

【讨论】:

    猜你喜欢
    • 2012-05-07
    • 1970-01-01
    • 2019-06-14
    • 1970-01-01
    • 2017-01-19
    • 2021-10-12
    • 2013-12-04
    • 2020-11-17
    • 2011-06-26
    相关资源
    最近更新 更多