In this final part, we will send the download request, retrieve the downloaded media and also play the media offline.
To grasp this concepts you need to read the Part one of this post Downloading Media through Exoplayer Part 1
Downloading Media through Exoplayer Part 1
Exoplayer provides a method, through which we can cache a media source for playback through the app as seen on YouTube…
We will not only be caching the media for offline playback, but we will also be storing some of the media’s metadata with it. To do that, we use DownloadHelper class and the request is sent using the DownloadService sendAddDownload static method.
The DownloadService also has a static method for pausing and resuming downloads.
Below is a method for retrieving all the downloaded items.
Having retrieved the cached media item, we can now play them.