无法在chrome的webview中全屏显示html5视频 [英] Can't fullscreen html5 videos in chrome's webview

查看:387
本文介绍了无法在chrome的webview中全屏显示html5视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找这个答案一段时间,但我并没有真正到达任何地方。我的问题是关于计算机上的Chrome应用程序内部的webview,而不是Android。如果我在webview中嵌入了html5视频,全屏按钮不起作用。所有其他的视频控制工作正常。我已经做了一些搜索,人们都说webview并不完全支持html5 API。这仍然是这样吗?我看到的答案是相当老的,我一直没能找到任何最近的。



任何建议/答案将不胜感激!

解决方案

它从版本43支持html5全屏,可以使用全屏权限API:
请参阅 event-permissionrequest FullscreenPermissionRequest
基本上,你必须允许()权限,例如:
$ b $ p -hide =false>

  webview.addEventListener('permissionrequest',function (e){if(e.permission ==='fullscreen'){e.request.allow();}});  


I've been searching around for this answer for a while but I'm not really getting anywhere. My question is regarding a webview inside of a chrome application on a computer, not for Android. If I have any embedded html5 video inside the webview, the fullscreen button does not work. All of the other video controls are working properly. I've done some searching and people are saying that webview doesn't fully support the html5 API. Is this still the case? The answers I saw are fairly old and I haven't been able to find anything recent.

Any suggestions/answers would be greatly appreciated! Thanks!

解决方案

It supports html5 fullscreen from version 43, you can use fullscreen permission API: See event-permissionrequest and FullscreenPermissionRequest. Basically, you have to "allow()" the permission, sth like:

webview.addEventListener('permissionrequest', function(e) {
  if (e.permission === 'fullscreen') {
    e.request.allow();
  }
});

这篇关于无法在chrome的webview中全屏显示html5视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆