【发布时间】:2019-02-08 11:22:34
【问题描述】:
当我尝试将视频用作网站背景时,标题和按钮会出现在 Youtube 视频的顶部。我希望从嵌入的 Youtube 顶部删除标题、观看和分享按钮。我已经尝试了所有方法,但没有任何效果。
我已附上我的代码。我尝试用 jQuery 注入它,但一点运气都没有。
<iframe src="https://www.youtube.com/embed/5iNr0Tp13hY?mode=opaque&rel=0&autohide=1&showinfo=0&controls=0&wmode=transparent" frameborder="0" width="100%" height="100%"></iframe>
$('iframe').load(function() {
$('iframe').contents().find("head").append($("<style type='text/css'> .ytp-chrome-top.ytp-show-watch-later-title.ytp-share-button-visible.ytp-show-share-title.ytp-show-cards-title { display: none !important; } </style>"));
});
【问题讨论】:
-
从 youtube 嵌入代码中禁用它 :)
-
youtube 从 2018 年 9 月开始弃用 showinfo 参数,因此这将不起作用
标签: javascript jquery html youtube