Project error:
"Mixed Content: The page at 'https://wx.vzan.com/live/tvchat-427320897?v=637539910901869888#/' was loaded over HTTPS,
but requested an insecure video 'http://i3.vzan.cc/m3u8/20200221/a487a8d9b2164043bb632165a0cc129c/v.f24306.m3u8'.
This request has been blocked; the content must be served over HTTPS.",
source: https://wx.vzan.com/live/tvchat-427320897?v=637539910901869888#/ (0)
Error analysis:
Starting from 9.0 (API level 28) on Android, plaintext communication support is disabled by default, which is officially said to be unsafe. Because the video source we play is HTTP protocol, we can’t play it.
Idea 1: add uses cleartext traffic
Indicates whether the application intends to use plaintext network traffic, such as plaintext http. The default value for applications with a target API level of 27 or lower is “true.”. For applications with API level 28 or higher, the default value is “false”.
<!--Android 9.0 video playback function-->>
<application
android:usesCleartextTraffic="true"
>
</application>
After modification, some models are still not feasible.
Idea 2: Android access to x5webview
Better article links: https://www.cnblogs.com/cuichen16/p/10785945.htm
After adding, Android 10.0 or above is not feasible for higher version mobile phones
Idea 3: setmixedcontentmode
//Allow cross-domain
webSetting.setAllowFileAccessFromFileURLs(true);
webSetting.setAllowUniversalAccessFromFileURLs(true);
webSetting.setSupportMultipleWindows(true);
if (Build.VERSION.SDK_INT >= 21) {
webSetting.setMixedContentMode(android.webkit.WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); // This sentence is crucial and can be added after
}
Finally, after adding the above three contents, the last step can be finished. If not, please continue to Baidu and keep looking for the key code.
Read More:
- Android WebView loading HTTP error [How to Solve]
- The local web page in WebView failed to load with XMLHttpRequest
- Error inflating class in WebView in Android 5. X android.webkit.WebView Solutions
- IOS WebView failed to load the web page. Error domain = kcferrodomaincfnetwork code = 310 “there was a problem communicating with the secure web proxy server (HTTPS). “
- Nodejs HTTP call error: socket hang up
- HTTP load failed, 0/0 bytes (error code: -1003 [10:-72000])
- IOS development NSURLSession/NSURLConnection HTTP load failed solution
- [solution] coursera webpage can’t be posted, video can’t be opened -20.05.23-
- R:Error : .onLoad failed in loadNamespace() for ‘rJava’, details: call: dyn.load(file, DLLpa
- “Nsurlsession / nsurlconnection HTTP load failed (kcfstreamerdomainssl, – 9806” appears when afnetworking accesses HTTPS
- An error is reported when an android phone visits the app webpage: net::ERR_PROXY_CONNECTION_FAILED
- HTTP 405 Error: Failed to load resource: the server responded with a status of 405 (Method Not Allowed)
- Solution: DevTools failed to load SourceMap:… net::ERR_HTTP_RESPONSE_CODE_FAILURE problem
- Android error reporting: error inflating class android.webkit.WebView
- python: HTTP Error 505: HTTP Version Not Supported
- WebView loadrequest request request error “nsurlconnection finished with error – Code – 1022”
- Error parsing HTTP request header Note: further occurrences of HTTP header p
- Springboot project: error parsing HTTP request header note: further occurrences of HTTP request parsing
- An Ajax HTTP error occurred in drupal7 installation occurred.HTTP Result Code
- urlopen error unknown url type:httpë/HTTP Error 400:Bad Request