How is video playing on Chrome different from the Android WebView on Android 7+?

casolorz

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.

rogerdpack

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).

enter image description here

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.

edited at
0

Comments

0 comments
Login to comment

Related

Android How To Get Playing Video Url From WebView

WebView video not playing in Android 2.3

Android: playing youtube video on Webview

HTML5 video not playing in android webview

Playing Video from RAM in Android

video not playing on Android (chrome) and iOS (safari)

Playing HTML5 video on fullscreen in android webview

Android not playing the video file from a given url

Playing a video from res/raw on Android Wear

How to stop video playing in WebView

How to show video in webView on Android

Playing video in videoview android

Webview is not opening links of different domains in chrome Android

Android webview rendering looks different to chrome

Showing html5 Video on Android Webview. Video getting black while playing

How to convert links video from ok.ru to direct links to playing it on VideoPlayer android

How to detect video in Android WebView with HitTestResult?

Android: playing many video simultaneously

Video playing format issue android

Error playing Video in Android Application

DRM WideVine video not playing from android cast sender application

How to keep playing video while changing to landscape mode android

How to get the current minute for playing YouTube video in Android

How to take snapshot of videoview while video is playing in android?

Check if a WebView is playing a video

Android WebView - Youtube videos not playing within the application

React Native Android Webview Video

Android MediaCodec & MediaExtractor For video and audio playing

Android Exoplayer only playing audio without video