title: E/ExoPlayerImplInternal: Source error com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 404
body: <p>I am trying the play the video by the exo Player, but it gives me this error:-</p>
  
  <blockquote>
    <p>E/ExoPlayerImplInternal: Source error.<br>
                                                                                   InvalidResponseCodeException: Response code: 404</p>
  </blockquote>
  
  <p>This is my Activity Class :-</p>
  
  <pre><code>public class VideoActivity extends AppCompatActivity implements VideoRendererEventListener {
      private String mVideoUrl;
      private SimpleExoPlayerView simpleExoPlayerView;
      private SimpleExoPlayer player;
      private static final String TAG = "AMAN";
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_video);
  
      if (getIntent() != null)
          mVideoUrl = getIntent().getStringExtra("VideoUrl");
  
  
  
  
      BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
      TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);
      TrackSelector trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);
  
  
      LoadControl loadControl = new DefaultLoadControl();
  
  
      player = ExoPlayerFactory.newSimpleInstance(this, trackSelector, loadControl);
      simpleExoPlayerView = new SimpleExoPlayerView(this);
      simpleExoPlayerView = (SimpleExoPlayerView) findViewById(R.id.player_view);
  
  
      simpleExoPlayerView.setUseController(true);
      simpleExoPlayerView.requestFocus();
  
  
      simpleExoPlayerView.setPlayer(player);
  
  
  
      Uri mp4VideoUri =Uri.parse(mVideoUrl);
  
      DefaultBandwidthMeter bandwidthMeterA = new DefaultBandwidthMeter();
  
      DefaultDataSourceFactory dataSourceFactory = new DefaultDataSourceFactory(this, Util.getUserAgent(this, "exoplayer2example"), bandwidthMeterA);
  
      ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory();
  
  
      MediaSource videoSource = new HlsMediaSource(mp4VideoUri, dataSourceFactory, 1, null, null);
      final LoopingMediaSource loopingSource = new LoopingMediaSource(videoSource);
  
  
  
  
     player.prepare(loopingSource);
                      player.setPlayWhenReady(true);
  
  }  
  </code></pre>
  
  <p>Does anyone know what is wrong here?</p>