title: Exoplayer changing subtitle on the fly
body: <p>I am trying to change a subtitle for a video in <code>Exoplayer</code>. Video can already have a subtitle or user can add a new subtitle from internal storage. I know that before starting the player we can create <code>Mediasource</code> for both subtitle and video and merge using <code>MergingMediaSource</code>. However, I am not sure how to replace/add new subtitles to the currently playing video? Is it possible using <code>DynamicConcatenatingMediaSource</code> or any other way to do so? </p>
  
  <pre><code> MediaSource[] subTitleMediaSources = new MediaSource[uris.length];
          Format subtitleFormat = Format.createTextSampleFormat(
                  null,
                  MimeTypes.APPLICATION_SUBRIP,
                  C.SELECTION_FLAG_DEFAULT,
                  null);
          for (int i = 0; i &lt; uris.length; i++) {
              String subTitle = getSubtitleFile(subs, uris[i]);
              if (subTitle != null) {
                  subTitleMediaSources[i] = new SingleSampleMediaSource.Factory(mediaDataSourceFactory).
                          createMediaSource(Uri.parse(subTitle), subtitleFormat,
                                            C.TIME_UNSET);
              } else {
                  subTitleMediaSources[i] = new SingleSampleMediaSource.Factory(mediaDataSourceFactory).
                          createMediaSource(Uri.parse("dummy"), subtitleFormat, C.TIME_UNSET);
              }
          }
  
          MediaSource mediaSource = mediaSources.length == 1 ? mediaSources[0]
                  : new ConcatenatingMediaSource(mediaSources);
  
          MediaSource subsMediaSource = subTitleMediaSources.length == 1 ? subTitleMediaSources[0]
                  : new ConcatenatingMediaSource(subTitleMediaSources);
  
          MediaSource mergedSource;
  
          if (subsMediaSource == null) {
              mergedSource = mediaSource;
          } else {
              mergedSource = new MergingMediaSource(mediaSource, subsMediaSource);
          }
  </code></pre>