I am stuck to playing parallel diffrent Media streams in Exoplayer
Scenario:
- I have one Audio MediaSource. and one Video MediaSource.
- I want to play that both mediasource Parallelly in
ExoPlayer
After lots of R&D i found
I am trying but failed to achive that. code of Example here
if (player == null) {
player = ExoPlayerFactory.newSimpleInstance(ChangeAudioActivity.this, new DefaultRenderersFactory(this),
new DefaultTrackSelector(), new DefaultLoadControl());
playerView.setPlayer(player);
player.setPlayWhenReady(playWhenReady);
player.seekTo(currentWindow, playbackPosition);
}
MediaSource audiosource = new ProgressiveMediaSource.Factory(new FileDataSourceFactory()).createMediaSource(Uri.parse(videoModel.getAudio()));
MediaSource videoSource = new ProgressiveMediaSource.Factory(new FileDataSourceFactory()).createMediaSource(Uri.parse(videoModel.getVideo()));
player.prepare(new MergingMediaSource(videoSource , audiosource ), true, false);
I refer Exoplayer Docs also.
Is that Possible with Exoplayer? Thank you in Advance for Your Suggestions.