10

I have app with webview and I use ACRA. I receive crash reports from users with errors caused by interaction with HTML5Video.

Error 1:

"java.lang.NullPointerException
    at android.webkit.HTML5VideoViewProxy$VideoPlayer.exitFullScreenVideo(HTML5VideoViewProxy.java:180)
    at android.webkit.HTML5VideoViewProxy.exitFullScreenVideo(HTML5VideoViewProxy.java:770)
    at android.webkit.WebViewClassic$PrivateHandler.handleMessage(WebViewClassic.java:7422)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5039)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
    at dalvik.system.NativeStart.main(Native Method)"

Error 2:

"java.lang.NullPointerException
    at android.webkit.HTML5VideoFullscreen.switchProgressView(HTML5VideoFullscreen.java:455)
    at android.webkit.HTML5VideoView.enterFullscreenVideoState(HTML5VideoView.java:546)
    at android.webkit.HTML5VideoViewProxy$VideoPlayer.enterFullscreenVideo(HTML5VideoViewProxy.java:182)
    at android.webkit.HTML5VideoViewProxy.handleMessage(HTML5VideoViewProxy.java:479)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:155)
    at android.app.ActivityThread.main(ActivityThread.java:5485)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795)
    at dalvik.system.NativeStart.main(Native Method)"

Here are my DropBox logs if needed:

for error 1: http://pastebin.com/w8G1UJvG

seems to be interesting:

11-14 22:19:29.912 E/libEGL  (14744): call to OpenGL ES API with no current context (logged once per thread)
11-14 22:19:29.917 W/dalvikvm(14744): threadid=1: thread exiting with uncaught exception (group=0x40d4a2d0)

for error 2: http://pastebin.com/8BEK1vAm

seems to be interesting:

12-10 00:14:52.542 W/YourLogTag(24823): Couldn't find activity to view mimetype: video/x-m4v

In fact I even don't suggest interaction with HTML5 videos in my webview. I guess, users open them from pages, interaction with which is also not provided. Also I think it's a bad way to try to prohibit users interaction with other webpages (and it may be really hard in case of my app). But also, user definetely don't experience a warm feeling to my app, when crash dialog appears before him...

So I want to block users' interaction with HTML5 Video in my webview or just catch exceptions properly (seems to be not very good approach). What's the best way to do it?

Here are my webview settings, if they're required:

webView.getSettings().setJavaScriptEnabled(false);
webView.getSettings().setUserAgentString("Some user agent"); 
Community
  • 1
  • 1
janot
  • 13,578
  • 1
  • 27
  • 57

1 Answers1

2

Unfortunately I'm not going to be able to provide a direct answer, however, I did find an interesting post that spurred a lot of conversation. WebView and HTML5 Video

It's an old question but you'll notice that as time went on, newer and newer answers were posted that allowed HTML5 video to work. Hopefully reading some of those answers will get you on the right track and ultimately get it working for you.

I also found an open-source project which fixed the issue for you...however it's old and doesn't work for 4.0 and up. HTML5 WebView

Community
  • 1
  • 1
Ifrit
  • 6,791
  • 8
  • 50
  • 79
  • Thanks, I've already read that thread, but solutions mentioned there seem to be too overpowered for my case, because I don't actually need html5 to work. – janot Feb 01 '13 at 09:38