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


Java YouTubePlayer.ErrorReason方法代碼示例

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


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

示例1: onError

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onError(YouTubePlayer.ErrorReason errorReason) {
	Log.e(LOG_TAG, "player error: " + errorReason);
	if (highlightImageView.getVisibility()==View.VISIBLE) {
		highlightImageView.startAnimation(fadeOutSlow);
	}
	currentVideoId = null;
	if (errorReason == YouTubePlayer.ErrorReason.UNEXPECTED_SERVICE_DISCONNECTION) {
		// player has encountered an unrecoverable error - stop the demo
		flipDelayHandler.removeCallbacksAndMessages(null);
		state = State.UNINITIALIZED;
		thumbnailLoader.release();
		thumbnailLoader = null;
		player = null;
	} else {
		state = State.VIDEO_ENDED;
	}
}
 
開發者ID:entertailion,項目名稱:Video-Wall,代碼行數:19,代碼來源:VideoWallActivity.java

示例2: onError

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onError(YouTubePlayer.ErrorReason errorReason) {
    Logger.getInstance().Error(TAG, errorReason.toString());

    if (errorReason == YouTubePlayer.ErrorReason.USER_DECLINED_RESTRICTED_CONTENT) {
        if (_youtubeId == YoutubeId.THE_GOOD_LIFE_STREAM) {
            String url = "https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=1&q=The+Good+Life+24+7&key=" + Keys.YOUTUBE_API_KEY;
            DownloadYoutubeVideoTask task = new DownloadYoutubeVideoTask(_context, null, false, false);
            task.execute(url);
        }
    }
}
 
開發者ID:GuepardoApps,項目名稱:LucaHome-AndroidApplication,代碼行數:13,代碼來源:CenterViewController.java

示例3: onError

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onError(YouTubePlayer.ErrorReason errorReason) {
  if (errorReason == YouTubePlayer.ErrorReason.UNEXPECTED_SERVICE_DISCONNECTION) {
    // player has encountered an unrecoverable error - stop the demo
    flipDelayHandler.removeCallbacksAndMessages(null);
    state = State.UNINITIALIZED;
    thumbnailLoader.release();
    thumbnailLoader = null;
    player = null;
  } else {
    state = State.VIDEO_ENDED;
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:14,代碼來源:VideoWallDemoActivity.java

示例4: onError

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onError(YouTubePlayer.ErrorReason errorReason) {
    logWrapper.d(TAG, "In YouTubePlayer.PlayerStateChangeListener.onError: %s", errorReason);
    if(errorReason == YouTubePlayer.ErrorReason.UNEXPECTED_SERVICE_DISCONNECTION) {
        if(getActivity() != null) {
            getActivity().finish();
        }
    }
}
 
開發者ID:dptsolutions,項目名稱:CustomUIYouTubePlayer,代碼行數:10,代碼來源:CustomUIYouTubePlayerFragment.java

示例5: onError

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onError(YouTubePlayer.ErrorReason errorReason) {
    Utils.doLog("onError " + errorReason.name());
}
 
開發者ID:ttpho,項目名稱:Android-Video-Youtube-View,代碼行數:5,代碼來源:YoutubeVideoView.java

示例6: onError

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onError(YouTubePlayer.ErrorReason errorReason) {
    // Called when an error occurs.
}
 
開發者ID:JimSeker,項目名稱:AudioVideo,代碼行數:5,代碼來源:AdvancedYTActivity.java

示例7: onError

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onError(YouTubePlayer.ErrorReason errorReason) {
    Toast.makeText(this, com.saarang.samples.apps.iosched.R.string.session_livestream_error_playback, Toast.LENGTH_LONG).show();
    LOGE(TAG, errorReason.toString());
}
 
開發者ID:The-WebOps-Club,項目名稱:saarang-iosched,代碼行數:6,代碼來源:SessionLivestreamActivity.java

示例8: onError

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onError(YouTubePlayer.ErrorReason errorReason) {
    Toast.makeText(this, R.string.session_livestream_error_playback, Toast.LENGTH_LONG).show();
    LOGE(TAG, errorReason.toString());
}
 
開發者ID:gdg-bh,項目名稱:AppDevFestSudeste2015,代碼行數:6,代碼來源:SessionLivestreamActivity.java

示例9: onError

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onError(YouTubePlayer.ErrorReason reason) {
    // Called when an error occurs.

}
 
開發者ID:MD2Korg,項目名稱:mCerebrum-Study,代碼行數:6,代碼來源:ActivityYouTube.java

示例10: onError

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onError(YouTubePlayer.ErrorReason reason) {
    Log.e("onError", "onError : " + reason.name());
    if (YouTubePlayer.ErrorReason.NOT_PLAYABLE.equals(reason))
        startVideo(videoId);
}
 
開發者ID:slartus,項目名稱:4pdaClient-plus,代碼行數:7,代碼來源:YoutubeActivity.java

示例11: onError

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onError(YouTubePlayer.ErrorReason errorReason) {
	showErrorToast(errorReason.toString());
}
 
開發者ID:sgehrman,項目名稱:youtubeAPI,代碼行數:5,代碼來源:PlayActivity.java

示例12: onError

import com.google.android.youtube.player.YouTubePlayer; //導入方法依賴的package包/類
@Override
public void onError(YouTubePlayer.ErrorReason errorReason) {
    showErrorToast(errorReason.toString());
}
 
開發者ID:youtube,項目名稱:yt-direct-lite-android,代碼行數:5,代碼來源:PlayActivity.java


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