當前位置: 首頁>>代碼示例>>Java>>正文


Java YouTubeInitializationResult.isUserRecoverableError方法代碼示例

本文整理匯總了Java中com.google.android.youtube.player.YouTubeInitializationResult.isUserRecoverableError方法的典型用法代碼示例。如果您正苦於以下問題:Java YouTubeInitializationResult.isUserRecoverableError方法的具體用法?Java YouTubeInitializationResult.isUserRecoverableError怎麽用?Java YouTubeInitializationResult.isUserRecoverableError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.android.youtube.player.YouTubeInitializationResult的用法示例。


在下文中一共展示了YouTubeInitializationResult.isUserRecoverableError方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onActivityResult

import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
  switch (requestCode) {
    // called when playing a movie, could fail and this dialog shows the user how to fix it
    case YouTubeAPI.REQ_PLAYER_CODE:
      if (resultCode != RESULT_OK) {
        YouTubeInitializationResult errorReason = YouTubeStandalonePlayer.getReturnedInitializationResult(data);
        if (errorReason.isUserRecoverableError()) {
          errorReason.getErrorDialog(this, 0).show();
        } else {
          String errorMessage = String.format("PLAYER ERROR!! - %s", errorReason.toString());
          Utils.toast(this, errorMessage);
        }
      }

      break;
    default:
      super.onActivityResult(requestCode, resultCode, data);
  }
}
 
開發者ID:sgehrman,項目名稱:UTubeTV,代碼行數:21,代碼來源:DrawerActivity.java

示例2: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
    if (youTubeInitializationResult.isUserRecoverableError()) {
        LogSaver.appendLog(TAG+" :"+youTubeInitializationResult.toString());
        youTubeInitializationResult.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();
    } else {
        String errorMessage = String.format(
                getString(R.string.error_player), youTubeInitializationResult.toString());
        Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
    }
}
 
開發者ID:rishabh115,項目名稱:Odyssey2017,代碼行數:12,代碼來源:YoutubeActivity.java

示例3: onActivityResult

import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == REQ_START_STANDALONE_PLAYER && resultCode != RESULT_OK) {
        YouTubeInitializationResult errorReason =
                YouTubeStandalonePlayer.getReturnedInitializationResult(data);
        if (errorReason.isUserRecoverableError()) {
            errorReason.getErrorDialog(this, 0).show();
        } else {
            String errorMessage =
                    String.format(getString(R.string.error_player), errorReason.toString());
            Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
        }
    }
}
 
開發者ID:tgbMedia,項目名稱:Android-app,代碼行數:16,代碼來源:OverviewActivity.java

示例4: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@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();
    }
}
 
開發者ID:DameMatiku,項目名稱:damematiku-android,代碼行數:11,代碼來源:YouTubeFailureRecoveryActivity.java

示例5: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
    if (youTubeInitializationResult.isUserRecoverableError()) {
        youTubeInitializationResult.getErrorDialog(getActivity(), RECOVERY_DIALOG_REQUEST).show();
    } else {
        //Handle the failure
        Toast.makeText(getActivity(), "onInitializationFailure", Toast.LENGTH_LONG).show();
    }
}
 
開發者ID:rahulmaddineni,項目名稱:Stayfit,代碼行數:10,代碼來源:Fragment2.java

示例6: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult errorReason) {
    if (errorReason.isUserRecoverableError()) {
        errorReason.getErrorDialog(this, RECOVERY_REQUEST).show();
    } else {
        String error = String.format("player error!", errorReason.toString());
        Toast.makeText(this, error, Toast.LENGTH_LONG).show();
    }
}
 
開發者ID:applicaster,項目名稱:rn-youtube-android,代碼行數:10,代碼來源:YoutubePlayerActivity.java

示例7: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider,
                                    YouTubeInitializationResult errorReason) {
    if (errorReason.isUserRecoverableError()) {
        errorReason.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();
    } else {
        String errorMessage = String.format(
                "There was an error initializing the YouTubePlayer (%1$s)",
                errorReason.toString());
        Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
    }
}
 
開發者ID:SEA2015-GROUP7,項目名稱:projectTetViet,代碼行數:13,代碼來源:YouTubePlayerActivity.java

示例8: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
    if (youTubeInitializationResult.isUserRecoverableError()) {
        youTubeInitializationResult.getErrorDialog(getActivity(), RECOVERY_DIALOG_REQUEST).show();
    } else {
        Toast.makeText(getActivity(), "The Youtube Player could'nt be initialized", Toast.LENGTH_LONG).show();
    }
}
 
開發者ID:muddassir235,項目名稱:Pop-Movies-Android-App,代碼行數:9,代碼來源:YoutubeFailureRecoveryFragment.java

示例9: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
    if (youTubeInitializationResult.isUserRecoverableError()) {
        youTubeInitializationResult.getErrorDialog(getActivity(), RECOVERY_DIALOG_REQUEST).show();
    } else {
        if (isAdded()) {
            Toast.makeText(getActivity().getApplicationContext(), getString(R.string.error_init_failure_msg), Toast.LENGTH_SHORT).show();
        }
    }
}
 
開發者ID:ganesh2shiv,項目名稱:yt-channel-list-android,代碼行數:11,代碼來源:YoutubePlayerFragment.java

示例10: onActivityResult

import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  super.onActivityResult(requestCode, resultCode, data);
  if (requestCode == REQ_START_STANDALONE_PLAYER && resultCode != RESULT_OK) {
    YouTubeInitializationResult errorReason =
        YouTubeStandalonePlayer.getReturnedInitializationResult(data);
    if (errorReason.isUserRecoverableError()) {
      errorReason.getErrorDialog(this, 0).show();
    } else {
      String errorMessage =
          String.format(getString(R.string.error_player), errorReason.toString());
      Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
    }
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:16,代碼來源:StandalonePlayerDemoActivity.java

示例11: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(
    YouTubeThumbnailView thumbnailView, YouTubeInitializationResult errorReason) {
  if (errorReason.isUserRecoverableError()) {
    if (errorDialog == null || !errorDialog.isShowing()) {
      errorDialog = errorReason.getErrorDialog(this, RECOVERY_DIALOG_REQUEST);
      errorDialog.show();
    }
  } else {
    String errorMessage =
        String.format(getString(R.string.error_thumbnail_view), errorReason.toString());
    Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:15,代碼來源:VideoWallDemoActivity.java

示例12: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@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();
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:11,代碼來源:YouTubeFailureRecoveryActivity.java

示例13: checkYouTubeApi

import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
private void checkYouTubeApi() {
  YouTubeInitializationResult errorReason =
      YouTubeApiServiceUtil.isYouTubeApiServiceAvailable(this);
  if (errorReason.isUserRecoverableError()) {
    errorReason.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();
  } else if (errorReason != YouTubeInitializationResult.SUCCESS) {
    String errorMessage =
        String.format(getString(R.string.error_player), errorReason.toString());
    Toast.makeText(this, errorMessage, Toast.LENGTH_LONG).show();
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:12,代碼來源:VideoListDemoActivity.java

示例14: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult errorResult) {
    if (errorResult.isUserRecoverableError()) {
        errorResult.getErrorDialog(getActivity(), RECOVERY_REQUEST).show();
    } else {
        String error = String.format(getString(R.string.player_error), errorResult.toString());
        Toast.makeText(getActivity(), error, Toast.LENGTH_LONG).show();
    }
}
 
開發者ID:JimSeker,項目名稱:AudioVideo,代碼行數:10,代碼來源:MainFragment.java

示例15: onInitializationFailure

import com.google.android.youtube.player.YouTubeInitializationResult; //導入方法依賴的package包/類
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult errorResult) {
    if (errorResult.isUserRecoverableError()) {
        errorResult.getErrorDialog(this, RECOVERY_REQUEST).show();
    } else {
        String error = String.format(getString(R.string.player_error), errorResult.toString());
        Toast.makeText(this, error, Toast.LENGTH_LONG).show();
    }
}
 
開發者ID:JimSeker,項目名稱:AudioVideo,代碼行數:10,代碼來源:BasicYTActivity.java


注:本文中的com.google.android.youtube.player.YouTubeInitializationResult.isUserRecoverableError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。