Created
March 9, 2018 01:14
-
-
Save nazmulidris/f25efd1aa80fca79872f363d7e49b0d4 to your computer and use it in GitHub Desktop.
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
| player = ExoPlayerFactory.newSimpleInstance(context, DefaultTrackSelector()) | |
| .apply { | |
| ... | |
| } | |
| fun buildMediaSource(): MediaSource { | |
| val uriList = mutableListOf<MediaSource>() | |
| MediaCatalog.list.forEach { | |
| uriList.add(createExtractorMediaSource(it.mediaUri!!)) | |
| } | |
| return ConcatenatingMediaSource(*uriList.toTypedArray()) | |
| } | |
| private fun createExtractorMediaSource(uri: Uri): MediaSource { | |
| return ExtractorMediaSource.Factory( | |
| DefaultDataSourceFactory(context, "videoapp")).createMediaSource(uri) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment