title: Playing local/in-app mp4 files in a HTML5 videoplayer in a Cordova PhoneGap app on both Android 4.4 AND lower
body: <p>I got the video to work on Android 4.0.3 (API 15) and up using <a href="https://github.com/jaeger25/Html5Video" rel="nofollow">Jaeger 25's Html5Video plugin</a>. However, With the addition of Android 4.4 and its revised Chromium-based WebView, this plugin no longer suffices, <a href="https://github.com/jaeger25/Html5Video/issues/18#issuecomment-38365443" rel="nofollow">as mentioned by its awesome developer</a>. </p>
  
  <p>Now, I would much rather play these video's without any plugins anyway (which works perfectly on iOS...), so I went back to trying that. Is was hoping that this Chromium-based webview would be friendlier with basic HTML5 playback, but instead, I just get the exact same error as before: <code>MediaPlayer(30579): Error (1,-2147483648)</code>.</p>
  
  <p>I've spent hours trying several different approaches, all to no avail. I'll list a few things that I've tried below. Please, does anyone have any clues to point me in the right direction? I'm out of ideas...</p>
  
  <p><strong>Normal file reference using <em>file:///</em></strong> </p>
  
  <p>Code:</p>
  
  <pre><code>    &lt;video id="whoismad" width="75%" height="75%" loop class="videoplayer"&gt;
          &lt;source src="file:///android_asset/www/res/raw/whoismad.mp4" type="video/mp4"&gt;
      &lt;/video&gt;
  </code></pre>
  
  <p>Results in:</p>
  
  <pre><code>04-24 11:24:30.111: D/HTML5VideoViewProxy(30579): handleMessage - PLAY
  04-24 11:24:30.119: D/HTML5VideoInline(30579): HTML5VideoInline created
  04-24 11:24:30.127: V/MediaPlayer-JNI(30579): native_setup
  04-24 11:24:30.127: V/MediaPlayer(30579): constructor
  04-24 11:24:30.142: V/MediaPlayer(30579): setListener
  04-24 11:24:30.189: V/MediaPlayer(30579): setVideoSurfaceTexture
  04-24 11:24:30.189: V/MediaPlayer-JNI(30579): reset
  04-24 11:24:30.189: V/MediaPlayer(30579): reset
  04-24 11:24:30.236: V/MediaPlayer(30579): setVideoSurfaceTexture
  04-24 11:24:30.236: V/MediaPlayer(30579): prepareAsync
  04-24 11:24:30.244: V/MediaPlayer(30579): message received msg=100, ext1=1, ext2=-2147483648
  
  04-24 11:24:30.244: E/MediaPlayer(30579): error (1, -2147483648)
  
  04-24 11:24:30.244: V/MediaPlayer(30579): callback application
  04-24 11:24:30.244: V/MediaPlayer(30579): back from callback
  
  04-24 11:24:30.252: E/MediaPlayer(30579): Error (1,-2147483648)
  
  04-24 11:24:30.267: D/HTML5VideoViewProxy(30579): handleMessage - ERROR
  04-24 11:24:30.267: D/CordovaWebView(30579): Hidding Custom View
  04-24 11:24:30.267: D/HTML5VideoViewProxy(30579): handleMessage - ENDED
  04-24 11:24:30.283: D/HTML5VideoViewProxy(30579): handleMessage - SEEK
  </code></pre>
  
  <p><strong>File reference using Phonegap's Filesystem API</strong></p>
  
  <p>Code: </p>
  
  <pre><code>    &lt;video id="whoismad" width="75%" height="75%" loop class="videoplayer"&gt;
          &lt;source src="cdvfile://android_asset/www/res/raw/whoismad.mp4" type="video/mp4"&gt;
      &lt;/video&gt;
  </code></pre>
  
  <p>Results in (contains that same MediaPlayer (1, -2147483648) error):</p>
  
  <pre><code>04-24 11:30:56.705: V/WebViewInputDispatcher(30579): blockWebkitDraw
  04-24 11:30:56.705: V/WebViewInputDispatcher(30579): blockWebkitDraw lockedfalse
  04-24 11:30:57.033: D/webview(30579): blockWebkitViewMessage= false
  04-24 11:30:57.056: D/HTML5VideoViewProxy(30579): handleMessage - PLAY
  04-24 11:30:57.064: V/MediaPlayer-JNI(30579): reset
  04-24 11:30:57.064: V/MediaPlayer(30579): reset
  04-24 11:30:57.064: D/HTML5VideoInline(30579): HTML5VideoInline created
  04-24 11:30:57.080: V/MediaPlayer(30579): setVideoSurfaceTexture
  04-24 11:30:57.080: V/MediaPlayer-JNI(30579): reset
  04-24 11:30:57.080: V/MediaPlayer(30579): reset
  04-24 11:30:57.080: I/MediaPlayer(30579): path is null
  04-24 11:30:57.095: D/MediaPlayer(30579): setDataSource IOException happend : 
  04-24 11:30:57.095: D/MediaPlayer(30579): java.io.FileNotFoundException: No content provider: cdvfile://android_asset/www/res/raw/usm.mp4
  04-24 11:30:57.095: D/MediaPlayer(30579):   at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:713)
  04-24 11:30:57.095: D/MediaPlayer(30579):   at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:617)
  04-24 11:30:57.095: D/MediaPlayer(30579):   at android.media.MediaPlayer.setDataSource(MediaPlayer.java:962)
  04-24 11:30:57.095: D/MediaPlayer(30579):   at android.webkit.HTML5VideoView.prepareDataCommon(HTML5VideoView.java:326)
  04-24 11:30:57.095: D/MediaPlayer(30579):   at android.webkit.HTML5VideoView.prepareDataAndDisplayMode(HTML5VideoView.java:363)
  04-24 11:30:57.095: D/MediaPlayer(30579):   at android.webkit.HTML5VideoInline.prepareDataAndDisplayMode(HTML5VideoInline.java:72)
  04-24 11:30:57.095: D/MediaPlayer(30579):   at android.webkit.HTML5VideoViewProxy$VideoPlayer.play(HTML5VideoViewProxy.java:286)
  04-24 11:30:57.095: D/MediaPlayer(30579):   at android.webkit.HTML5VideoViewProxy.handleMessage(HTML5VideoViewProxy.java:462)
  04-24 11:30:57.095: D/MediaPlayer(30579):   at android.os.Handler.dispatchMessage(Handler.java:99)
  04-24 11:30:57.095: D/MediaPlayer(30579):   at android.os.Looper.loop(Looper.java:175)
  04-24 11:30:57.095: D/MediaPlayer(30579):   at android.app.ActivityThread.main(ActivityThread.java:5279)
  04-24 11:30:57.095: D/MediaPlayer(30579):   at java.lang.reflect.Method.invokeNative(Native Method)
  04-24 11:30:57.095: D/MediaPlayer(30579):   at java.lang.reflect.Method.invoke(Method.java:511)
  04-24 11:30:57.095: D/MediaPlayer(30579):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
  04-24 11:30:57.095: D/MediaPlayer(30579):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
  04-24 11:30:57.095: D/MediaPlayer(30579):   at dalvik.system.NativeStart.main(Native Method)
  04-24 11:30:57.095: D/MediaPlayer(30579): Couldn't open file on client side, trying server side
  04-24 11:30:57.095: V/MediaPlayer(30579): setVideoSurfaceTexture
  04-24 11:30:57.103: V/MediaPlayer(30579): prepareAsync
  04-24 11:30:57.103: V/MediaPlayer(30579): message received msg=100, ext1=1, ext2=-2147483648
  
  04-24 11:30:57.103: E/MediaPlayer(30579): error (1, -2147483648)
  
  04-24 11:30:57.103: V/MediaPlayer(30579): callback application
  04-24 11:30:57.103: V/MediaPlayer(30579): back from callback
  
  04-24 11:30:57.111: E/MediaPlayer(30579): Error (1,-2147483648)
  
  04-24 11:30:57.142: D/HTML5VideoViewProxy(30579): handleMessage - ERROR
  04-24 11:30:57.142: D/CordovaWebView(30579): Hidding Custom View
  04-24 11:30:57.142: D/HTML5VideoViewProxy(30579): handleMessage - ENDED
  04-24 11:30:57.158: D/HTML5VideoViewProxy(30579): handleMessage - SEEK
  </code></pre>