title: Exoplayer unable to play DASH video android
body: <p>I'm trying to play DASH video with the help of <code>Uri</code> obtained from <code>exoplayer</code> demo app <a href="https://github.com/google/ExoPlayer/blob/release-v2/demos/main/src/main/assets/media.exolist.json" rel="nofollow noreferrer">https://github.com/google/ExoPlayer/blob/release-v2/demos/main/src/main/assets/media.exolist.json</a></p>
  
  <p>When I change my network from WIFI to mobile data , video quality doesn't change instead it starts buffering.</p>
  
  <p><strong>My code</strong></p>
  
  <pre><code>private void initializePlayer() {
          if (player == null) {
  
              player = ExoPlayerFactory.newSimpleInstance(
                      new DefaultRenderersFactory(this),
                      new DefaultTrackSelector(), new DefaultLoadControl());
  
              exoPlayerView.setPlayer(player);
  
              player.setPlayWhenReady(playWhenReady);
              player.seekTo(currentWindow, playbackPosition);
          }
  
  
          Uri uri = Uri.parse("http://www.youtube.com/api/manifest/dash/id/3aa39fa2cc27967f/source/youtube?as=fmp4_audio_clear,fmp4_sd_hd_clear&amp;sparams=ip,ipbits,expire,source,id,as&amp;ip=0.0.0.0&amp;ipbits=0&amp;expire=19000000000&amp;signature=A2716F75795F5D2AF0E88962FFCD10DB79384F29.84308FF04844498CE6FBCE4731507882B8307798&amp;key=ik0");
          MediaSource mediaSource = buildMediaSource(uri);
          player.prepare(mediaSource, true, false);
  
          player.addListener(new PlayerEventListener());
          player.setRepeatMode(Player.REPEAT_MODE_ALL);
          //exoPlayerView.setUseController(false);
  
      }
  
      private MediaSource buildMediaSource(Uri uri) {
          DataSource.Factory manifestDataSourceFactory = new DefaultHttpDataSourceFactory("ua");
          DashChunkSource.Factory dashChunkSourceFactory = new DefaultDashChunkSource.Factory(new DefaultHttpDataSourceFactory("ua", BANDWIDTH_METER));
          return new DashMediaSource.Factory(dashChunkSourceFactory, manifestDataSourceFactory).createMediaSource(uri);
      }
  </code></pre>
  
  <p><strong>gradle</strong></p>
  
  <pre><code>compile 'com.google.android.exoplayer:exoplayer-core:2.7.0'
      compile 'com.google.android.exoplayer:exoplayer-dash:2.7.0'
      compile 'com.google.android.exoplayer:exoplayer-ui:2.7.0'
  </code></pre>
  
  <p><strong>Is there Anything I missed ?</strong></p>