Пример #1
0
 // 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();
   }
 }
Пример #2
0
 @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();
   }
 }