// handle error if player doesn't not initialize successfully
 @Override
 public void onInitializationFailure(
     YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
   if (youTubeInitializationResult.isUserRecoverableError()) {
     youTubeInitializationResult.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();
   } else {
     String errorMessage = "onInitializationFailure of YouTubeFragment";
     Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
   }
 }
 @Override
 public void onInitializationFailure(
     YouTubePlayer.Provider provider, YouTubeInitializationResult errorReason) {
   if (errorReason.isUserRecoverableError()) {
     errorReason.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();
   } else {
     String errorMessage = String.format(getString(R.string.error_player), errorReason.toString());
     Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
   }
 }