带有https源的Android WebView html5视频标签 [英] Android WebView html5 video tag with https source

查看:238
本文介绍了带有https源的Android WebView html5视频标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于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屋!

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