删除“在 YouTube 上播放”覆盖嵌入视频
有没有办法在嵌入视频时使用覆盖在视频上的“在 YouTube 上播放”按钮?我研究过使用无铬 YouTube 播放器,但无法找到删除覆盖层的方法。有没有人尝试过或听说过一种方法来做到这一点?
Is there a way to get ride of the "play on youtube" button that is overlayed on videos when they are embedded? I looked into using the chromeless youtube player but couldn't figure out a way to remove the overlay. Has anyone tried or heard of a way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
我发现有用的三个参数是:
showinfo=0
确保视频不会在视频帧的顶部显示标题。controls=0
隐藏带有播放按钮、音量等的底部栏。autohide=1
隐藏控件,直到您将鼠标悬停在它们上方,这可能是最有用的。所有官方文档都位于此处。
The three parameters I found useful are:
showinfo=0
makes sure the video does not display the title on the top of the video frame.controls=0
hides the bottom bar with the play button, volume, etc.autohide=1
hides the controls until you hover over them, which is probably the most useful.All the official docs are here.
我发现这是不可能的。因此,隐藏“播放”按钮的唯一方法是将视频图像放置在视频上方,该视频可以从 YouTube 获取,如下所示。
每个 YouTube 视频都有 4 个生成的图像。它们的格式如下:
但是一旦添加了覆盖层,单击屏幕而不是控件将不会播放视频,为此,请添加以下播放视频的 jQuery
I found it not possible. So the only way to hide Play button is to place video image above the video which can be fetched from youtube as follow.
Each YouTube video has 4 generated images. They are predictably formatted as follows:
But once you add the overlay, clicking on the screen instead of control will not play the video, To do this add the following jQuery which plays the video
得票最多的答案现在效果很好! (2015 年 9 月 9 日星期三)
你应该把
我想你们几乎都错过了上述情况。
以下是我的示例代码。
这意味着......不要这样做,
或者像这样,
以及我的示例的结果截图。
(由于我的声誉,我无法发布图片......请参见此处:https://i.sstatic。 net/zC5lz.jpg)
别忘了!
The most voted answer works well now! (Wed Sep 9 '15)
You should put the
I think almost of you missed at above cases.
Followings are my example code.
It means... don't do like this,
or like this,
and my example's result screenshot.
(I couldn't post images because of my reputation... See here: https://i.sstatic.net/zC5lz.jpg)
Don't forget!
无法从 YouTube 播放器中删除播放按钮,有三种解决方法
1:自动播放视频
2:单击按钮后,在播放器上添加您自己的带有自定义按钮的叠加层,然后处理播放和暂停video using javascript
3 :提取视频内容 URL(违反 YouTube 政策,但它有效,并且可能在将来随时中断)
embedd url :
如果您使用 HTML,上述 URL 将自动播放视频5.默认情况下它不会自动播放,为此您需要使用javascript来自动播放视频。
另一件事:视频结束后,它会再次显示播放按钮和视频信息,据我所知,这是不可避免的。
It is not possible to remove play button from youtube player, Hear are three workarounds for that
1 : autoplay the video
2 : add your own overlay with custom button on over the player using once the button is clicked, then handle the playing and pausing the video using javascript
3 : extract the video content URL (against the youtube policy, but it works and may break at any moment in future)
embedd url :
The above URL will auto play the video if you are using HTML 5 it will not autoplay by default, For that you need to make use of the javascript to autoplay the video.
One more thing : Once the video ends it once again displays the Play Button and Video Info, As pre my knowledge it is unavoidable.
更新:
您是否尝试过使用“modestbranding”播放器参数,请参阅 https://developers.google.com/youtube/ player_parameters
示例:
http://www.youtube.com /v/lT0ReYP3fDA?version=3&controls=0&modestbranding=1&showsearch=0
删除“继续播放”手动覆盖“youtube”违反了服务条款。
它没有很好的记录,但如果您以任何方式违反服务条款,YouTube 可能会将您的网站列入黑名单。基本上每个视频都会返回 105 错误代码并停止工作。这种情况发生在我曾经工作过的一个网站上,并且很难与 Google 联系以撤销黑名单(在进行更改以再次符合 ToS 之后)。
UPDATE:
Have you tried using the "modestbranding" player parameter see https://developers.google.com/youtube/player_parameters
Example:
http://www.youtube.com/v/lT0ReYP3fDA?version=3&controls=0&modestbranding=1&showsearch=0
Removing the “play on youtube” overlay manually is against the Terms of Service.
It isn't very well documented but if you break the Terms of Service in anyway Youtube may blacklist your website. What happens is basically every video will return a 105 error code and stop working. This happened to a site I worked on once and it wasn't easy to get in contact with Google to get the blacklisting revoked (after making changes to be in line with the ToS again).
2017年答案:
如果你指的是右下角的“YouTube”标志,可以使用
info
参数将其删除:当然,这会导致其他信息(例如视频标题) )也会被显示,这可能是不可取的。尽管如此,标志还是被隐藏了! :)
2017 Answer:
If you're referring to the "YouTube" logo in the bottom-right corner, this can be removed with the
info
parameter:Of course, this causes other info (such as the video title) to be shown as well, which might be undesirable. Still, the logo is hidden! :)
不幸的是,2015 年 8 月 19 日,
autohide
属性已被正式弃用。如果不使用适量的 JavaScript,您将无法再删除播放按钮。在这里也可以找到同样的内容 https://developers.google.com/youtube/player_parameters#autohide
Unfortunately, on August 19, 2015 the
autohide
attribute has been officially depreciated. You can no longer remove the play button, without using a modest amount of JavaScript.The same can be found over here https://developers.google.com/youtube/player_parameters#autohide
有一个现成的解决方案可以将“在 youtube 上播放”删除到后台(您可以看到一点,但无法按下它)。
就我个人而言,我在一个有关俄罗斯文案交流的网站上工作。
这是一个示例 - https://beecopy.ru/zakazchiku/sovet-workzilla-drobim-bolshie-proekty-na-podjomnye-zadachi/
There is a ready-made solution that removes “play on youtube” into the background (you can see it a little, but you won't be able to press it).
Personally, I work on a website about Russian copywriting exchanges.
Here is an example - https://beecopy.ru/zakazchiku/sovet-workzilla-drobim-bolshie-proekty-na-podjomnye-zadachi/