Created
June 10, 2019 09:02
-
-
Save tizisdeepan/803e3d43818b4994d586b606c013bba7 to your computer and use it in GitHub Desktop.
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
val url = "YOUR_VIDEO_URL" | |
val player = ExoPlayerFactory.newSimpleInstance(this) | |
videoView.player = player | |
val dataSourceFactory = DefaultDataSourceFactory(this, Util.getUserAgent(this, "ZohoSocial")) | |
val mediaSource = if (url.contains(".m3u8")) DashMediaSource.Factory(dataSourceFactory).createMediaSource(Uri.parse(url)) | |
else ExtractorMediaSource.Factory(dataSourceFactory).createMediaSource(Uri.parse(url)) | |
player.prepare(mediaSource) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment