Created
March 24, 2023 20:39
-
-
Save prateek54/c9c92e8420c112945fd394768e74775b to your computer and use it in GitHub Desktop.
Init Block to play offline downloaded video
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ExoPlayer player = ExoPlayer.Builder(this).build() | |
player?.playWhenReady = true | |
val mediaSource = downloadTracker?.getDownloadRequest(Uri.parse(VIDEO_URL))!!.let { | |
DownloadHelper.createMediaSource( | |
it, | |
DemoUtil.getDataSourceFactory(this) | |
) | |
} | |
player?.setMediaSource(mediaSource) | |
player?.prepare() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment