Created
February 25, 2019 14:39
-
-
Save navi25/2ce32bd67adaaa5cfa933fbb55a4f000 to your computer and use it in GitHub Desktop.
A simple preparation for exoplayer
This file contains hidden or 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
//Build MediaSource for one video and prepare player | |
private fun preparePlayer(uri: Uri){ | |
val mediaSource = MediaSourceBuilder().build(uri) | |
player?.prepare(mediaSource, true, false) | |
} | |
//Overloaded function to build MediaSource for whole playlist and prepare player | |
private fun preparePlayer(uriList: Array<Uri>){ | |
val mediaSource = MediaSourceBuilder().build(uriList) | |
player?.prepare(mediaSource, true, false) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment