javascript - 在网页中嵌入视频后如何删除 youtube 品牌?

标签 javascript html youtube-iframe-api

我正在使用

<iframe width="550" height="314" src="https://www.youtube.com/embed/vidid?modestbranding=1&amp;rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>

这会删除右侧底部的“Youtube” Logo 。 并且还删除了悬停时出现的“标题栏”。

但这个问题是,当我将鼠标悬停在视频上时,然后在右侧底部“Youtube”缩略图/文本后面出现,当我移开鼠标时,它就会消失。

当我使用“autohide=1”时,控制栏被隐藏,并且在右下角悬停时显示“Youtube”的一个图标/图像/ Logo 。我正在使用

iframe.setAttribute("src", "youtube.com/embed/" + youtube.id + "?modestbranding=1&;showinfo=0&;autohide=1&;rel=0;"); 

这个。有了这个,我可以从控制栏中删除/隐藏标题栏和 Logo ,但是在右下角,悬停时屏幕上出现了另一个 Logo ,我应该使用哪个参数来隐藏它?

Consider red square mark part

最佳答案

您可以将 ?modestbranding=1 添加到您的网址。这将删除 Logo 。

modestbranding (supported players: AS3, HTML5)

This parameter lets you use a YouTube player that does not show a YouTube logo. Set the parameter value to 1 to prevent the YouTube logo from displaying in the control bar. Note that a small YouTube text label will still display in the upper-right corner of a paused video when the user's mouse pointer hovers over the player.

&showinfo=0 将删除标题栏。

showinfo (supported players: AS3, AS2, HTML5)

Values: 0 or 1. The parameter's default value is 1. If you set the parameter value to 0, then the player will not display information like the video title and uploader before the video starts playing.

您可以在 Google Developers 上找到所有选项网站。

注意事项:

它没有完全删除 Logo 。左下角还有一个小logo。

showinfo 已弃用,2018 年 9 月 25 日后将被忽略:https://developers.google.com/youtube/player_parameters

关于javascript - 在网页中嵌入视频后如何删除 youtube 品牌?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18893902/

相关文章:

javascript - 等效的 Javascript substr_count?

javascript - Youtube IFrame API playVideo() 错误

angular - Angular2 上的 onYouTubeIframeAPIReady 找不到名称 'YT'

iframe - 是否可以替换Youtube的iframe视频广告

javascript - 根据点击次数不同的事件

php - Wordpress - 动态 js/css 和 SSL 的问题

javascript - 用图像填充数百个 SVG 路径会导致严重的性能问题

javascript - CSS 转换仅不适用于 IOS

html - 悬停时CSS更改非兄弟或子元素属性

javascript - 如何根据路由更改父组件上的 header