title: Cordova 3.6.3 File plugin - get local video file on android
body: <p>What I'd like to do is</p>
  
  <ol>
  <li>get the URI of a video file on the device via cordovas javascript API</li>
  <li>set the URI as value of a HTML5 <code>video</code> tag's <code>src</code> attribute.</li>
  </ol>
  
  <p>The second part shouldn’t be a problem.<br/>
  Concerning the first task, there are a lot of good structured tutorials like <a href="https://github.com/cfjedimaster/Cordova-Examples/blob/master/getfiledata/www/js/app.js" rel="nofollow">Raymond Camden's</a> demonstrating how to get local files through javascript in an <a href="http://plugins.cordova.io/#/package/org.apache.cordova.file" rel="nofollow">cordova</a> environment.</p>
  
  <p>However, with the newest version of cordova, I could not get it to work.</p>
  
  <h2>The video file</h2>
  
  <p>The video is located either in <code>assets/www/videos/testvid.webm</code> or <code>res/raw/testvid.webm</code> in the built apk file. Both variations did not work.</p>
  
  <h2>The javascript</h2>
  
  <pre><code>myPath = cordova.file.applicationDirectory; // -&gt; file:///android_asset/
  //myPath += "www/videos/testvid.webm";
  </code></pre>
  
  <p>respectively</p>
  
  <pre><code>myPath = cordova.file.applicationStorageDirectory; // -&gt; file:///data/data/com.example.MyPackage/
  //myPath += "raw/testvid.webm";
  </code></pre>
  
  <p>Then:</p>
  
  <pre><code>window.resolveLocalFileSystemURL(myPath, gotFile, fail);
  function gotFile(entry){
    if(entry.isDirectory)
      alert JSON.stringify(entry.getFile("testvid.webm"));
  }
  </code></pre>
  
  <h2>The permissions</h2>
  
  <p>In <code>res/xml/config.xml</code> access permissions are added</p>
  
  <pre><code>&lt;preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,root" /&gt;
  </code></pre>
  
  <p>The error is {code:1} -> NOT_FOUND_ERR</p>
  
  <p>What am I doing wrong? How to navigate to the file, or where can one put it to be found?</p>