title: Exoplayer not looping the video
body: <p>I'm using Exoplayer in my android app to play video and audio files. according to <a href="https://google.github.io/ExoPlayer/guide.html" rel="noreferrer">Exoplayer developer's guide,</a>in order to loop a video/audio, this is what you have to do</p>
  
  <pre><code>MediaSource mediaSource = new ExtractorMediaSource(videoUri, ...);
  // Loops the video indefinitely.
  LoopingMediaSource loopingSource = new LoopingMediaSource(mediaSource);
  </code></pre>
  
  <p>So I implemented it like this in my Activity's onCreate method</p>
  
  <pre><code>    BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
      TrackSelection.Factory factory = new AdaptiveTrackSelection.Factory(bandwidthMeter);
      TrackSelector trackSelector = new DefaultTrackSelector(factory);
  
      simpleExoPlayer = ExoPlayerFactory.newSimpleInstance(this,trackSelector);
      simpleExoPlayer.setPlayWhenReady(true);
      simpleExoPlayerView.setPlayer(simpleExoPlayer);
  
      // Measures bandwidth during playback. Can be null if not required.
      bandwidthMeter2 = new DefaultBandwidthMeter();
  
  // Produces DataSource instances through which media data is loaded.
      dataSourceFactory = new DefaultDataSourceFactory(this,
        Util.getUserAgent(this, applicationName), bandwidthMeter2);
  
  // Produces Extractor instances for parsing the media data.
      extractorsFactory = new DefaultExtractorsFactory();
      mediaSource = new ExtractorMediaSource(videoUri,dataSourceFactory, extractorsFactory, null, null);
  
      loopingSource = new LoopingMediaSource(mediaSource);
      simpleExoPlayer.prepare(mediaSource);
  </code></pre>
  
  <p>But looping of my video file is not taking place. it just plays once.</p>