Issue
So I have two urls one for audio and one for video. I want to play them together but really couldn't find any documentation about this.
Solution
I just found the answer just build it like below in kotlin:
val dataSourceFactory: DataSource.Factory =
DefaultHttpDataSource.Factory()
val videoSource: MediaSource = ProgressiveMediaSource.Factory(dataSourceFactory)
.createMediaSource(fromUri(videoInPlayer.videoStreams[0].url))
val audioSource: MediaSource = ProgressiveMediaSource.Factory(dataSourceFactory)
.createMediaSource(fromUri(videoInPlayer.audioStreams[0].url))
val mergeSource: MediaSource = MergingMediaSource(videoSource,audioSource)
Answered By - Weston
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.