Android 7+ uses Chrome for the WebView
but yet there are some differences because some videos work on Chrome for Android but they don't work on the WebView
.
Here are two examples:
http://www.americatv.com.ar/vivo
http://www.tvpublica.com.ar/vivo/
I have seen this also with globosat from Brazil, and a few other sites. Seems to be happening more and more. Usually changing the user agent doesn't help.
So what are these pages checking for or what is missing from the WebView that allows these videos to play on Chrome but not the WebView
?
Thanks.
If you attach chrome to a remote instance of your android WebView (in an emulator in my case), you see a few javascript failures (they also show up in the Android Monitor but they're harder to see there).
Particularly poignant is
... I/chromium: [INFO:CONSOLE(7)] "Uncaught ReferenceError: chrome is not defined", source: http://iframe.statics.space/magma/main/js/cast.js (7)
So apparently in a WebView "chrome.X" are not defined (unclear if that's expected or not) but the website is expecting them. So you could try and implement a "fake" chrome object and inject it (maybe), or perhaps try a Firefox useragent instead so it doesn't try chrome-y stuff:
myWebView.getSettings().setUserAgentString("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1");
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments