private void handleMedia(Intent intent){
  int intentMediaType=intent.getIntExtra(Config.YOUTUBE_TYPE,Config.YOUTUBE_MEDIA_NO_NEW_REQUEST);
switch (intentMediaType) {
case Config.YOUTUBE_MEDIA_NO_NEW_REQUEST:
    mMediaPlayer.start();
  break;
case Config.YOUTUBE_MEDIA_TYPE_VIDEO:
mediaType=Config.YOUTUBE_MEDIA_TYPE_VIDEO;
videoItem=(YouTubeVideo)intent.getSerializableExtra(Config.YOUTUBE_TYPE_VIDEO);
if (videoItem.getId() != null) {
playVideo();
}
break;
case Config.YOUTUBE_MEDIA_TYPE_PLAYLIST:
mediaType=Config.YOUTUBE_MEDIA_TYPE_PLAYLIST;
youTubeVideos=(ArrayList<YouTubeVideo>)intent.getSerializableExtra(Config.YOUTUBE_TYPE_PLAYLIST);
int startPosition=intent.getIntExtra(Config.YOUTUBE_TYPE_PLAYLIST_VIDEO_POS,0);
iterator=youTubeVideos.listIterator(startPosition);
playNext();
break;
default :
Log.d(TAG,"Unknown command");
break;
}
}

private void handleMedia ( Intent intent ) { int intentMediaType = intent . getIntExtra ( Config . YOUTUBE_TYPE , Config . YOUTUBE_MEDIA_NO_NEW_REQUEST ) ; switch ( intentMediaType ) { case Config . YOUTUBE_MEDIA_NO_NEW_REQUEST : mMediaPlayer . start ( ) ; break ; case Config . YOUTUBE_MEDIA_TYPE_VIDEO : mediaType = Config . YOUTUBE_MEDIA_TYPE_VIDEO ; videoItem = ( YouTubeVideo ) intent . getSerializableExtra ( Config . YOUTUBE_TYPE_VIDEO ) ; if ( videoItem . getId ( ) != null ) { playVideo ( ) ; } break ; case Config . YOUTUBE_MEDIA_TYPE_PLAYLIST : mediaType = Config . YOUTUBE_MEDIA_TYPE_PLAYLIST ; youTubeVideos = ( ArrayList < YouTubeVideo > ) intent . getSerializableExtra ( Config . YOUTUBE_TYPE_PLAYLIST ) ; int startPosition = intent . getIntExtra ( Config . YOUTUBE_TYPE_PLAYLIST_VIDEO_POS , 0 ) ; iterator = youTubeVideos . listIterator ( startPosition ) ; playNext ( ) ; break ; default : Log . d ( TAG , "Unknown command" ) ; break ; } }
handles media - playlists and videos sent from fragments
