简体   繁体   English

如何在micorostf edge(全屏模式)中隐藏html视频控件

[英]how to hide html video controls in micorostf edge (fullscreen mode)

I'm writing an angular directive for a video player. 我正在为视频播放器编写角度指令。 I'd like to have custom controls that should override the native one. 我想拥有应该覆盖本机控件的自定义控件。
In normal mode all works fine while in fullscreen mode no. 在正常模式下,一切正常,而在全屏模式下,一切正常。

Actually the problems occurs in IE11 and Microsoft Edge. 实际上,该问题发生在IE11和Microsoft Edge中。

  • In IE11: both the native bar (ok) and the custom one (ko) are 在IE11中:本机栏(ok)和自定义栏(ko)均为
    hidden. 隐。 I can't show my bar. 我不能显示我的酒吧。
  • In Edge: I can't hide the native controls bar and I can't show my bar 在Edge中:我无法隐藏本机控件栏,也无法显示我的栏


To hide the bar I tried with 隐藏我尝试过的酒吧

video::-webkit-media-controls {
  display:none !important;
}

video::-webkit-media-controls-enclosure {
  display:none !important;
}

but seems that in microsoft browser doesn't work. 但似乎在Microsoft浏览器中不起作用。

I already read and follow this post about almost the same problem change html5 video controls layout when fullscreen 我已经阅读并遵循了这篇文章,关于全屏时几乎相同的问题更改html5视频控件的布局

The problem has nothing to do with angular, but I can't figure out where put my hands to get things works: in the css or do I have to use javascript (how?) to handle the show/hide behaviour of the native control bar? 问题与角度无关,但我无法弄清楚将手放在哪里可以工作:在css中还是必须使用javascript(如何?)来处理本机控件的显示/隐藏行为酒吧?

This is a plunk http://plnkr.co/edit/zGlMN0Qys2yHdWgGXefk?p=preview where you can find my javascript pure code. 这是一个笨拙的http://plnkr.co/edit/zGlMN0Qys2yHdWgGXefk?p=preview ,您可以在其中找到我的纯JavaScript代码。

I really appreciate any help to get things work! 我真的很感谢任何帮助使事情正常进行!

Luca 路卡

The solution resides in the way the requestFullscreen is called. 该解决方案驻留在调用requestFullscreen的方式中。 Before I called that method on the video element 在视频元素上调用该方法之前

$scope.videoElement.requestFullscreen();        

Instead the requestFullscreen method have to be called on container element in order to ensure that the element's children, eg the custom controls, go fullscreen also 相反,必须在容器元素上调用requestFullscreen方法,以确保该元素的子元素(例如自定义控件)也全屏显示

$scope.videoContainer.requestFullscreen();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM