Is it possible to hide youtube#39;s big red play button with a parameter?(是否可以使用参数隐藏 youtube 的红色大播放按钮?)
问题描述
我目前用于创建 YouTube iframe 的代码的快速示例:
Quick example of the code I'm using at the moment to create my YouTube iframe:
player = new YT.Player('[PLAYER ID]', {
height: '300',
width: '480',
videoId: '[VIDEO ID]',
playerVars: { 'controls': 0, 'showinfo': 0 },
});
到目前为止一切都很好,它可以在没有控件或信息条的情况下正常加载视频,我正在使用 javascript手动"播放视频.
It's all working great so far, it's loading the video fine without controls or the info strip and I'm 'manually' playing the video using javascript.
问题是现在不需要在视频开始时立即显示的红色大播放"按钮.
The problem is that there's now no need for the big red 'play' button that is momentarily displayed as the video's starting.
有什么办法可以解决这个问题吗?我浏览了文档,找不到合适的参数来隐藏它.
Is there any way I can get rid of this? I've looked through the documentation and can't find a suitable parameter that would allow me to hide it.
推荐答案
我发现不可能.因此,隐藏播放按钮的唯一方法是将视频图像放在可以从 youtube 获取的视频上方,如下所示.每个 YouTube 视频都有 4 个生成的图像.可以预见,它们的格式如下:
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:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
但是一旦你添加了叠加层,点击屏幕而不是控件将不会播放视频,为此添加以下播放视频的 jQuery
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
jQuery('#overlay').click(function(){
jQuery(this).hide();
jQuery('#youtube_id').get(0).playVideo();
});
这篇关于是否可以使用参数隐藏 youtube 的红色大播放按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:是否可以使用参数隐藏 youtube 的红色大播放按钮?


- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01