javascript 如何在视频播放结束时删除大播放按钮(VideoJS)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11073705/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 12:01:18  来源:igfitidea点击:

How do I remove the big play button at the end of a video playing (VideoJS)

javascripthtmlvideohtml5-videovideo.js

提问by user1462210

I posted this in the VideoJS forums but have yet to receive a response, I was hoping I could get some assistance here. : )

我在 VideoJS 论坛上发布了这个,但还没有收到回复,我希望我能在这里得到一些帮助。:)

I am trying to remove the "big play button" that shows up once a video is finished playing in video js.

我正在尝试删除视频 js 中的视频播放完毕后显示的“大播放按钮”。

I have tried numerous hides/shows but can't seem to get it to disappear at the end. I've gotten it to hide at the beginning by simply altering the css, but I've found nothing for the end. I am using the most current release of Video JS, and therefore the old fixes that I have found do not work.

我尝试了很多隐藏/表演,但似乎无法让它在最后消失。我已经通过简单地改变 css 让它在开始时隐藏起来,但我最终什么也没找到。我使用的是最新版本的 Video JS,因此我发现的旧修复程序不起作用。

Please help. Thank you in advance!

请帮忙。先感谢您!

回答by heff

The CSS answer is best, though you might be better hiding it in your own stylesheet so you can upgrade to later versions of Video.js without issue. This should do it.

CSS 答案是最好的,尽管您最好将它隐藏在自己的样式表中,以便您可以毫无问题地升级到更高版本的 Video.js。这应该做。

.video-js.vjs-default-skin .vjs-big-play-button { display: none; }

You could also remove the line that includes the bigPlayButton component, but that would really prevent easy upgrading.

您还可以删除包含 bigPlayButton 组件的行,但这确实会妨碍轻松升级。

https://github.com/zencoder/video-js/blob/master/src/core.js#L69

https://github.com/zencoder/video-js/blob/master/src/core.js#L69

回答by Julian Hollmann

Just remove/alter the CSS, it's in there. It's line 328 until 360 in video-js.css

只需删除/更改 CSS,它就在那里。它是 video-js.css 中的第 328 行到 360 行

https://github.com/zencoder/video-js/blob/master/design/video-js.css

https://github.com/zencoder/video-js/blob/master/design/video-js.css

回答by Andrew Junior Howard

Their javascript adds a class on the id to indicate the video has finished playing. Add the following css line:

他们的 javascript 在 id 上添加了一个类来指示视频已播放完毕。添加以下 css 行:

.vjs-paused .vjs-big-play-button { display: none; }