title: Youtubeapi illegalstateexception player has been released
body: <p>I am using YoutubeAPI on my app but I am getting <code>illegalstateexception</code> of the following code.It says <code>player has been released</code>. How do I overcome this problem</p>
  
  <pre><code>@Override
      protected void onResume() {
  
              if (video_player != null ){
  
                  video_player.seekToMillis(pausedDuration);
  
          }
          // &lt;-- this will cause re-buffer.
          super.onResume();
      }
  </code></pre>
  
  <p><strong>edit 1</strong>
  initialization of player</p>
  
  <pre><code>@Override
      public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer player,boolean wasRestored) {
          if (!wasRestored) {
  
              player.cueVideo(video_URL);
              video_player=player;
              prev_cat=cat_id;
  
          }
      }
  </code></pre>
  
  <p>Also,
  I am unable to watch the video of full screen</p>
  
  <p>full-screen code</p>
  
  <pre><code>12-16 15:02:38.859: D/YouTubeAndroidPlayerAPI(22422): apps.youtube.core.player.Director.a:473 VideoStage: NEW
  12-16 15:02:38.969: E/YouTubeAndroidPlayerAPI(22422): apps.youtube.core.player.Director.F:521 Media progress reported outside media playback
  12-16 15:02:38.979: D/YouTubeAndroidPlayerAPI(22422): apps.youtube.core.player.sequencer.a.&lt;init&gt;:41 SequencerStage: New o
  12-16 15:02:38.979: D/YouTubeAndroidPlayerAPI(22422): apps.youtube.core.player.sequencer.a.a:46 SequencerStage: NEW
  12-16 15:02:38.989: D/YouTubeAndroidPlayerAPI(22422): apps.youtube.core.player.Director.a:627 PlaybackState reset by init
  12-16 15:02:39.019: D/YouTubeAndroidPlayerAPI(22422): apps.youtube.core.player.sequencer.a.a:46 SequencerStage: VIDEO_LOADING 
  </code></pre>