Search in sources :

Example 1 with GoplayException

use of com.youku.player.base.GoplayException in project SimplifyReader by chentao0707.

the class PluginFullScreenPauseAD method showPauseAD.

/**
	 * 开始获取暂停广�?
	 */
public void showPauseAD() {
    Logger.e("PlayFlow", "暂停广告showPauseAD id:" + mMediaPlayerDelegate.videoInfo.getVid());
    if (mMediaPlayerDelegate.isADShowing) {
        return;
    }
    if (isVideoNoAdv() || Profile.from == Profile.PHONE_BROWSER) {
        return;
    }
    final boolean isOfflineAd = isLocalVideo(mMediaPlayerDelegate.videoInfo);
    // 只有youku请求离线广告
    if (isOfflineAd && !MediaPlayerConfiguration.getInstance().showOfflineAd())
        return;
    pauseADcanceled = false;
    //		IGetVideoAdvService getVideoAdvService = new GetVideoAdvService();
    PlayerCustomInfoManager customInfoManager = new PlayerCustomInfoManager();
    customInfoManager.getPlayerCustomInfo(mMediaPlayerDelegate.videoInfo.getVid(), new IPlayerCustomCallback() {

        @Override
        public void onSuccess(PlayerCustomInfo playerCustomInfo) {
            // TODO Auto-generated method stub
            Logger.d("PlayFlow", "pause ad, get player custom info atm: " + playerCustomInfo.getAtm());
            String atm = playerCustomInfo.getAtm();
            String token = playerCustomInfo.getToken();
            getPauseAd(atm, isOfflineAd);
        }

        @Override
        public void onError(PlayerCustomErrorInfo errorInfo) {
            // TODO Auto-generated method stub
            int errorCode = errorInfo.getErrorCode();
            Logger.e("PlayFlow", "pause ad, verify client_id:" + errorCode + " des: " + errorInfo.getDescription());
            getPauseAd("", isOfflineAd);
        }

        @Override
        public void onFailed(GoplayException e) {
            // TODO Auto-generated method stub
            Logger.e("PlayFlow", "pause ad, get atm error:" + e.getErrorInfo());
            getPauseAd("", isOfflineAd);
        }
    });
}
Also used : PlayerCustomInfoManager(com.youku.player.goplay.PlayerCustomInfoManager) PlayerCustomErrorInfo(com.youku.player.module.PlayerCustomErrorInfo) PlayerCustomInfo(com.youku.player.module.PlayerCustomInfo) IPlayerCustomCallback(com.youku.player.ui.interf.IPlayerCustomCallback) GoplayException(com.youku.player.base.GoplayException)

Aggregations

GoplayException (com.youku.player.base.GoplayException)1 PlayerCustomInfoManager (com.youku.player.goplay.PlayerCustomInfoManager)1 PlayerCustomErrorInfo (com.youku.player.module.PlayerCustomErrorInfo)1 PlayerCustomInfo (com.youku.player.module.PlayerCustomInfo)1 IPlayerCustomCallback (com.youku.player.ui.interf.IPlayerCustomCallback)1