title: YoutubePlayer Initialize Fail
body: <p>I have found this code here [<a href="https://stackoverflow.com/questions/33807072/how-to-view-youtube-list-of-a-specific-playlist][1]">how to view youtube list of a specific playlist?</a></p>
  
  <p>I have added the YoutubeAndroidPlayerAPI.jar, but it doesn't play it says 'An Error occurred while initializing the YouTube Player'
  I don't know what is wrong here..
  Please help me</p>
  
  <p>My Java Code</p>
  
  <pre><code>public class MainActivity extends YouTubeBaseActivity implements YouTubePlayer.OnInitializedListener {
  
  
  public static final String API_KEY = "API KEy";
  //http://youtu.be/&lt;VIDEO_ID&gt;
  public static final String VIDEO_ID = "PlayList ID";
  
  public void onFullscreen(boolean isFullscreen) {
      if (isFullscreen)
          playbackEventListener.onPlaying();
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      /** Initializing YouTube player view **/
      YouTubePlayerView youTubePlayerView = (YouTubePlayerView) findViewById(R.id.youtube_player);
      youTubePlayerView.initialize(API_KEY, this);
  
  
  }
  
  @Override
  public void onInitializationSuccess(YouTubePlayer.Provider provider, final YouTubePlayer youTubePlayer, boolean b) {
      /** add listeners to YouTubePlayer instance **/
      youTubePlayer.setPlayerStateChangeListener(playerStateChangeListener);
      youTubePlayer.setPlaybackEventListener(playbackEventListener);
      youTubePlayer.setOnFullscreenListener(new YouTubePlayer.OnFullscreenListener() {
          @Override
          public void onFullscreen(boolean c) {
              if(c)
                  youTubePlayer.play();
              else
                  youTubePlayer.play();
          }
      });
  
  
      /** Start buffering **/
      if (!b) {
  
          youTubePlayer.loadPlaylist(VIDEO_ID);
  
  
      }
  }
  
  @Override
  public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
      Toast.makeText(this, "Failured to Initialize!", Toast.LENGTH_LONG).show();
  }
  private YouTubePlayer.PlaybackEventListener playbackEventListener = new YouTubePlayer.PlaybackEventListener() {
  
  
  
      @Override
      public void onBuffering(boolean arg0) {
      }
  
      @Override
      public void onPaused() {
      }
  
      @Override
      public void onPlaying() {
      }
  
      @Override
      public void onSeekTo(int arg0) {
      }
  
      @Override
      public void onStopped() {
      }
  
  };
  
  
  private YouTubePlayer.PlayerStateChangeListener playerStateChangeListener = new YouTubePlayer.PlayerStateChangeListener() {
  
      @Override
      public void onAdStarted() {
      }
  
      @Override
      public void onError(YouTubePlayer.ErrorReason arg0) {
      }
  
      @Override
      public void onLoaded(String arg0) {
      }
  
      @Override
      public void onLoading() {
      }
  
  
      @Override
      public void onVideoEnded() {
      }
  
      @Override
      public void onVideoStarted() {
      }
  };
  </code></pre>
  
  <p>}</p>
  
  <p>My XML Code</p>
  
  <pre><code>&lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context="com.example.dfddf.ytplayerdemo.MainActivity"&gt;
  
  &lt;com.google.android.youtube.player.YouTubePlayerView
      android:id="@+id/youtube_player"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#000000"/&gt;
  </code></pre>
  
  <p></p>