Mediaelement.js - 想要删除所有控件 - 仅显示视频

发布于 2024-12-13 22:37:45 字数 111 浏览 1 评论 0原文

我正在尝试用 mp4 替换网页中的 swf 标题。我喜欢 MediaElement.js,但无法删除控件。我不想隐藏控件,我想完全删除它们......并且只显示循环视频。

任何建议将不胜感激。

I am trying to replace my swf header in my webpage with mp4. I like MediaElement.js but I can't remove the controls. I don't want to hide the controls, I want to remove them completely... and just display the looping video.

Any suggestions would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

夏至、离别 2024-12-20 22:37:45

我认为更好的解决方案是:

设置 features 属性:

features: []

将其插入您的 css 中:

.mejs-container .mejs-controls { visibility:hidden !important; }

这样您就可以通过单击视频来暂停播放。

I think a better solution is:

Set features property:

features: []

Insert this in your css:

.mejs-container .mejs-controls { visibility:hidden !important; }

That way you can pause-play by clicking the video.

心如荒岛 2024-12-20 22:37:45

您必须结合这些答案:

  1. 设置

    功能:[],
    
  2. 将其插入到您的 css 中:

    .mejs-container .mejs-controls {
      显示:无!重要;
    }
    

重要

当您执行此操作时,您无法通过单击视频来暂停视频。

You have to combine those answers:

  1. set

    features: [],
    
  2. insert this in your css:

    .mejs-container .mejs-controls {
      display: none !important;
    }
    

Important

When you do this, you can't pause the video by clicking on it.

感情旳空白 2024-12-20 22:37:45

当您设置 MediaElement 选项时,您可以设置功能:

要删除所有内容,只需将其设置为空数组

...
features: ['playpause','progress','current','duration','tracks','volume','fullscreen'],
...

becomes
...
features: [],
...

when you set up the MediaElement options you can set features:

to remove everything just set it to an empty array

...
features: ['playpause','progress','current','duration','tracks','volume','fullscreen'],
...

becomes
...
features: [],
...
疧_╮線 2024-12-20 22:37:45

从视频标签中完全删除“controls”属性。

通常在视频标签中,您要设置的任何属性
false,应该完全删除而不是将其设置为“false”
或“”。

从视频标签中删除属性时要小心。从视频标签中删除“controls”属性会在 Safari 中呈现一个错误:Safari 不再播放视频。这与 Safari 在授权播放视频之前等待控件加载(无论是否是本机控件)有关。

Remove the "controls" attribute out of the video tag completely.

Generally in the video tag, any attribute that you want to set to
false, should be removed completely instead of setting it to "false"
or "".

Careful with removing attributes from within the video tag. Removing the "controls" attribute from the video tag renders a bug in Safari : Safari doesn't play the video anymore. It has something to do with Safari waiting for the controls to be loaded -wether native or not- before authorizing the video to be played.

终止放荡 2024-12-20 22:37:45

从视频标签中完全删除“controls”属性。

<video id="my-video" preload="auto" width="860" height="650">

一般来说,在视频标签中,任何要设置为 false 的属性都应该完全删除,而不是设置为“false”或“”。

Remove the "controls" attribute out of the video tag completely.

<video id="my-video" preload="auto" width="860" height="650">

Generally in the video tag, any attribute that you want to set to false, should be removed completely instead of setting it to "false" or "".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文