在 WebView 中加载 YouTube 视频时,全屏选项不可用 [英] Full screen option not available when loading YouTube video in WebView
问题描述
我在 Android 应用程序中使用 webview 工作了很多时间.但是这次我在将 YouTube 视频加载到 WebView 时遇到了奇怪的问题.
I have work so many time with the webview with in Android app. But this time I got strange issue with loading YouTube video in to WebView.
看,这是在Chrome浏览器中加载的YouTube视频的屏幕截图,其中有全屏选项.
See, this is the screen shot of YouTube video loaded in Chrome browser, which have full screen option in it.
现在,下面是我在 webview 中加载相同视频的应用的屏幕截图.但它没有全屏选项.
Now, below is the screen shot of my app in which I have loaded same video in webview. But it is not having that full screen option.
您可以在两个图像中看到变化.两个屏幕截图均来自同一设备.但看起来还是不一样.
You can see the changes in both the images. Both the screen shots are taken from same device. But still it looks different.
我的 webView 加载代码是在这个粘贴板上.
My code for webView loading is in this pasteboard.
我还看到 此处报告了相同的问题
I have also seen that the same issue is reported here. But don't know whether is there solution for that available or not.
推荐答案
iFrame
是一个选项,但你可以试试这个
iFrame
is an option but you can try this
Android 的 WebView 和 WebChromeClient 类扩展启用全面支持 HTML5 视频
Android's WebView and WebChromeClient class extensions that enable fully working HTML5 video support
我还没有尝试过,但希望对您有所帮助.
I have not try this yet but hope will help to you.
这篇关于在 WebView 中加载 YouTube 视频时,全屏选项不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!