title: Playing video files from custom local URL using Unity VideoPlayer component
body: <p>I am trying to load a video file at runtime and play that video using the Unitys Video player component.The video is located in a folder on the mobile. i receive the URL to the file location(this is tested correct). While looking for the file Unity even finds the file at location but is not able to play it. I receive the following error :</p>
  <p><strong>AndroidVideoMedia: Error opening extractor: -10002</strong></p>
  <p>There is nothing on the internet regarding this issue as well. One page said something about changing gradle version.</p>
  <p>Please note that this works fine on the editor. I have also noticed if putting a file in the persistent data path of the app, then loading and playing is fine. But if the file is kept in any other custom folder, then even after finding the video Unity is not able to play it.</p>
  <p>Following is a snippet of the code :</p>
  <pre><code>void Start()
  {
      StartCoroutine(&quot;LoadVideoRoutine&quot;);
  }
  
  IEnumerator LoadVideoRoutine()
  {
           if(video==null)
              yield return null;
  
  
          string root = _arManager.VideoURLToPlay;
  
          print(&quot;This is video url : &quot; + root);
  
          if(!File.Exists(root))
          {
              print(&quot;no video&quot;);
              yield return null;
          }
          else if(File.Exists(root))
          {
              print(&quot;Found vid&quot;);
              video.url = root;
              video.Prepare();
             // video.Play();
          }
  
          while(!video.isPrepared)
          {
              print(&quot;preparing&quot;);
              yield return null;
          }
          
          print(&quot;playing&quot;);
          video.Play();
         
  
          
  
          // video.url = root;
          // video.Play();
      }
  </code></pre>
  <p>Following is a sample URL where the video is present :</p>
  <p>&quot;/storage/emulated/0/MyApp/RaceRecordings/3D2A4AF9-A6EB-4D48-92D2-1B2A6ADC968A.mp4&quot;</p>
  <p>In the logs, I got the &quot;Found vid&quot; log indicating that unity finds the file. But immediately when I am setting the URL I got the error.</p>
  <p>I am not sure what this is and would appreciate some help in this regard.</p>