带有https源的Android WebView html5视频标签 [英] Android WebView html5 video tag with https source
问题描述
我有一个基于WebView的应用程序,我想在其中显示如下视频标签中的视频:
I have a WebView based application where I want to display a video which is inside a video tag like this:
<video src="https://video.mp4" controls="controls" type="video/mp4"></video>
I want to display the video inline (not fullscreen) and like the documentation says I have hardware acceleration turned on, and set a WebChromeClient.
问题是,当我将URL从 https 替换为 http 时,它可以正常工作,并且我可以正确地观看视频,但是 不起作用使用https.
The thing is when I replace the url from https to http it works and I can see the video correctly, but doesn't work with https.
媒体播放器是否支持https?有什么想法吗?谢谢.
Is https supported by the media player? Any thoughts on this? Thanks.
推荐答案
您是否尝试过设置WebViewClient
myWebView.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler,
SslError error) {
handler.proceed();
super.onReceivedSslError(view, handler, error);
}
这篇关于带有https源的Android WebView html5视频标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!