Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to disable interaction with html5 videos in webview or properly catch their exceptions?
    text
    copied!<p>I have app with webview and I use <a href="https://github.com/ACRA/acra" rel="nofollow noreferrer">ACRA</a>. I receive crash reports from users with errors caused by interaction with <code>HTML5Video</code>. <em><p>Error 1:</em></p> <pre><code>"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)" </code></pre> <p><em><p>Error 2:</em></p> <pre><code>"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)" </code></pre> <p>Here are my <a href="https://stackoverflow.com/a/4445105/1548085">DropBox</a> logs if needed: <p>for error 1: <a href="http://pastebin.com/w8G1UJvG" rel="nofollow noreferrer">http://pastebin.com/w8G1UJvG</a> <p> seems to be interesting:</p> <pre><code>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) </code></pre> <p>for error 2: <a href="http://pastebin.com/8BEK1vAm" rel="nofollow noreferrer">http://pastebin.com/8BEK1vAm</a> <p> seems to be interesting: </p> <pre><code>12-10 00:14:52.542 W/YourLogTag(24823): Couldn't find activity to view mimetype: video/x-m4v </code></pre> <p>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... <p> <strong>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?</strong></p> <p>Here are my webview settings, if they're required:</p> <pre><code>webView.getSettings().setJavaScriptEnabled(false); webView.getSettings().setUserAgentString("Some user agent"); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload