HTML5 video won't maximize beyond container dimensions in native full screen mode

空扰寡人 提交于 2019-12-04 16:05:31

Adding the following CSS should take care of this problem:

:-webkit-full-screen-ancestor {
    animation: none;
    -webkit-animation-fill-mode: none;
    animation-fill-mode: none;
}

Via: https://bugs.chromium.org/p/chromium/issues/detail?id=501246#c13

Give dimension of height and width in percentage .

for eg : width : 100%

I had the same issue, but only in webkit browsers. I give a specific class to the body tag when anything goes fullscreen, and remove it on exiting;

$(document).on('webkitfullscreenchange', function(){
   if(document.webkitFullscreenElement !== null) {
      $('body').addClass('in-fullscreen');
   } else {
      $('body').removeClass('in-fullscreen');
   }
});

Now it's easy to overwrite the problematic css property;

.in-fullscreen .container {
    -webkit-animation-fill-mode: none;
    animation-fill-mode: none;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!