use of com.youku.player.ui.interf.IPlayerCustomCallback 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);
}
});
}
Aggregations