title: Android - Exoplayer shows blank screen instead of Playing video
body: <p>I am trying to integrate Exoplayer library to my android app.</p>
  
  <p>Below are the following code i have implemented in android app.</p>
  
  <p><strong>Layout.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context="com.ayalus.exoplayer2example.MainActivity"&gt;
      &lt;com.google.android.exoplayer2.ui.SimpleExoPlayerView
          android:id="@+id/player_view"
          android:focusable="true"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_below="@+id/resolution_textView"
          android:layout_marginTop="10dp" /&gt;    
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>MainActivity.java</strong></p>
  
  <pre><code>package com.ayalus.exoplayer2example;
  
  import android.net.Uri;
  import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  import android.util.Log;
  import android.view.Surface;
  import android.widget.TextView;
  
  import com.google.android.exoplayer2.ExoPlaybackException;
  import com.google.android.exoplayer2.ExoPlayer;
  import com.google.android.exoplayer2.ExoPlayerFactory;
  import com.google.android.exoplayer2.Format;
  import com.google.android.exoplayer2.PlaybackParameters;
  import com.google.android.exoplayer2.SimpleExoPlayer;
  import com.google.android.exoplayer2.Timeline;
  import com.google.android.exoplayer2.decoder.DecoderCounters;
  import com.google.android.exoplayer2.source.LoopingMediaSource;
  import com.google.android.exoplayer2.source.MediaSource;
  import com.google.android.exoplayer2.source.TrackGroupArray;
  import com.google.android.exoplayer2.source.hls.HlsMediaSource;
  import com.google.android.exoplayer2.trackselection.AdaptiveTrackSelection;
  import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
  import com.google.android.exoplayer2.trackselection.TrackSelection;
  import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
  import com.google.android.exoplayer2.trackselection.TrackSelector;
  import com.google.android.exoplayer2.ui.PlayerView;
  import com.google.android.exoplayer2.ui.SimpleExoPlayerView;
  import com.google.android.exoplayer2.upstream.DataSource;
  import com.google.android.exoplayer2.upstream.DefaultBandwidthMeter;
  import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
  import com.google.android.exoplayer2.util.Util;
  import com.google.android.exoplayer2.video.VideoRendererEventListener;
  
  
  public class MainActivity extends AppCompatActivity implements VideoRendererEventListener {
  
  
      private static final String TAG = "MainActivity";
      private PlayerView simpleExoPlayerView;
      private SimpleExoPlayer player;
      private TextView resolutionTextView;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          resolutionTextView = new TextView(this);
          resolutionTextView = (TextView) findViewById(R.id.resolution_textView);
  
  
  
  
  Uri mp4VideoUri =Uri.parse("http://live.field59.com/wwsb/ngrp:wwsb1_all/playlist.m3u8");
          DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter(); //test
  
          TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);
          TrackSelector trackSelector =
                  new DefaultTrackSelector(videoTrackSelectionFactory);
  
          // 2. Create the player
          player = ExoPlayerFactory.newSimpleInstance(this, trackSelector);
          simpleExoPlayerView = new SimpleExoPlayerView(this);
          simpleExoPlayerView = (SimpleExoPlayerView) findViewById(R.id.player_view);
  
          int h = simpleExoPlayerView.getResources().getConfiguration().screenHeightDp;
          int w = simpleExoPlayerView.getResources().getConfiguration().screenWidthDp;
          Log.v(TAG, "height : " + h + " weight: " + w);
          ////Set media controller
          simpleExoPlayerView.setUseController(false);//set to true or false to see controllers
          simpleExoPlayerView.requestFocus();
          // Bind the player to the view.
          simpleExoPlayerView.setPlayer(player);
          MediaSource videoSource = new HlsMediaSource(mp4VideoUri, dataSourceFactory, 1, null, null);
          final LoopingMediaSource loopingSource = new LoopingMediaSource(videoSource);
          // Prepare the player with the source.
          player.prepare(videoSource);
          player.setPlayWhenReady(true); //run file/link when ready to play.
          player.setVideoDebugListener(this);
      }
     }
  </code></pre>
  
  <p>I have given internet permision in AndroidManifest.xml.</p>
  
  <p>The Problem is when i run the android app, Instead of playing video, its giving me black screen.</p>
  
  <p><a href="https://i.stack.imgur.com/kGZSj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kGZSj.png" alt="enter image description here"></a></p>
  
  <p>Please Help</p>