title: Android download HLS
body: <p>i am trying to download a hls file using the HLSDownloader, but i am not getting the best results yet. My code:</p>
  
  <pre><code>// Main download function
  AsyncTask&lt;Void, Void, Void&gt; asyncTask = new AsyncTask&lt;Void, Void, Void&gt;() {
        @Override
        protected Void doInBackground(Void... voids) {
          downloadHls(VIDEO_URL);
          return null;
        }
      };
      asyncTask.execute();
  </code></pre>
  
  <p>...    </p>
  
  <pre><code>  // This is the main tool to download hls
    private HlsDownloader hlsDownloader;
    private void downloadHls(String masterHLS) {
  
  
      hlsDownloader = getHlsDownloader(masterHLS);
  
      try {
        hlsDownloader.download(this);
      } catch (IOException e) {
        e.printStackTrace();
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
  
    }
  
    private HlsDownloader getHlsDownloader(String mediaPlaylistUri) {
  
      File downloadFolder = new File(getFilesDir(), "video_id_2");
  
      SimpleCache cache = new SimpleCache(downloadFolder, new NoOpCacheEvictor());
      DefaultHttpDataSourceFactory factory = new DefaultHttpDataSourceFactory("ExoPlayer", null);
  
      CacheDataSource cacheDataSource =
              new CacheDataSource(cache, factory.createDataSource(), CacheDataSource.FLAG_BLOCK_ON_CACHE);
  
      // Create a downloader for the first variant in a master playlist.
      return new HlsDownloader(
              Uri.parse(mediaPlaylistUri), new DownloaderConstructorHelper(cache, factory));
    }
  </code></pre>
  
  <p>It seems the download starts and i am getting the progress of the downloading, but i can not access the downloaded file (maybe not exists), so i do not know if i am coding well. Some help it would be appreciated.</p>
  
  <p><strong>EDITED:</strong></p>
  
  <p>Currently i've got the download in multiple chunks (i forgotten to add the write permission in the manifest) all named like *.ve.exo extension files, but i do not know how to play them, any idea? </p>