2
votes

Here is the situation: I have no access to the android code. I can only work on the web that will be loaded to android webview via a url. I find that using mp4 or mp4 with H.264, webview html5 video plays on new devices but not on older devices such as the ones before 2013 (although they all play on the browser).

My questions are

  1. Is there a android version cut off point to this type of behavior. Or it is device specific.

  2. is there anything I can do on the web side such as js/html and video encoding?

1
They all play in browser, because it can be updated and has nothing to do with webview. Since lolipop, webview can also be updated, thus making it possible for google to fix their initial bugs and update it's core components to meet current security requirements.Bojan Kseneman
So for android 4.1.x , the webview doesn't support html5 video out of the box?Flmhdfj
The problem goes beyond 4.1.x, it doesn't work on 4.4.x either in our project. Works fine on lolipop. I am also looking for the solution, but at this point, I have no solution.Bojan Kseneman
I see. Thank you for the information.Flmhdfj

1 Answers

1
votes

The best I could do is to check if the users support playing html5 in webview by doing the following

var test = document.createElement('video');
var androidSupport =  (
    test.canPlayType( 'video/mp4; codecs="avc1.42E01E"' ) == "probably" || 
    test.canPlayType( 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"' ) == "probably");