1

I'm using WebViews in my apps, and many users reported some issues. It appears that most of them seem to happen on 4.1.1, not before.

The configuration:

  • A Webview, inside a HW accelerated activity.
  • JS enabled, Plugins enabled, File access enabled, DOM storage enabled.
  • Custom WebChromeClient and WebViewClient.
  • Webview has a transparent background (0X00000000) but removing it seems to have no good improvement.

The problem:

  • Random black outs when showing some URLs: black out meaning, the activity just dies, there is no JAVA exception.
  • Usually, logs report a SIGSEGV, in glDrawArrays(), but could also be somewhere else (not enough information from users).

A workaround?

Simply disable the HW acceleration on the webview! Yeah, no more black out, that's right... But then (even if we consider this workaround is just so so, as the display performance decreases quite a lot):

A new problem:

  • Without HW acceleration, HTML5 videos (youtube) are not working: Sound starts, but video doesn't.
  • A solution could be to catch a playback starting event, to make the video play in a videoView, the same way we can do for fullscreen playback (using onShowCustomView, see Playing HTML5 video on fullscreen in android webview). Nevertheless, I'm currently not able to catch such an event. Please note that I'm not owner of the HTML pages, and the HTML code cannot be changed to append some kind of Javascript code in it.

Questions:

  • Does anyone has the same kind of crash, using HW acceleration + webview, on many devices? If so, how do you solve that?
  • About the workaround, deos anyone know how to solve this problem? Would be great to do like on IOS: clicking on the does not try to play the video inline, but instead it just opens the video application.

Thanks for reading!

Community
  • 1
  • 1
Benjamin Piette
  • 3,645
  • 1
  • 27
  • 24
  • do you have a sample showing the problem> On Android 4.2 and 4.3 I've not seen this problem, but may be just the devices I'm using. For opening the native player via an intent check this for an example http://stackoverflow.com/questions/1572107/android-intent-for-playing-video, you can use the overrideURL override to respond to video URIs that way – Offbeatmammal Sep 23 '13 at 05:32
  • Unfortunately I don't have a sample code to provide, I'm not allowed to deliver it. It seems that this happens mostly on 4.1 Android versions. About question 2, it seems like overrideURL is not called when youtube video starts, as it starts inline, probably using javascript, without reloading a new page. But maybe there is a way to tell the page to NOT load the video inline, at page loading time (not when clicking the video). – Benjamin Piette Sep 23 '13 at 08:56

0 Answers0