title: Play Different MediaSource Together in Exoplayer
body: <p>I am stuck to playing parallel diffrent Media streams in Exoplayer</p>
  
  <p>Scenario: </p>
  
  <ul>
  <li>I have one Audio MediaSource. and one Video MediaSource.</li>
  <li>I want to play that both mediasource Parallelly in <code>ExoPlayer</code></li>
  </ul>
  
  <p>After lots of R&amp;D i found</p>
  
  <ul>
  <li><a href="https://github.com/google/ExoPlayer/issues/1828" rel="nofollow noreferrer">https://github.com/google/ExoPlayer/issues/1828</a></li>
  <li><a href="https://github.com/google/ExoPlayer/issues/4793" rel="nofollow noreferrer">https://github.com/google/ExoPlayer/issues/4793</a></li>
  </ul>
  
  <p>I am trying but failed to achive that. 
  code of Example here</p>
  
  <pre><code>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);
  </code></pre>
  
  <p>I refer Exoplayer Docs also.</p>
  
  <ul>
  <li><a href="https://exoplayer.dev/media-sources.html" rel="nofollow noreferrer">https://exoplayer.dev/media-sources.html</a></li>
  </ul>
  
  <p>Is that Possible with Exoplayer? Thank you in Advance for Your Suggestions.</p>