Logger.d("PlayFlow","播放器出现错误 MediaPlayer onError what=" + what
+ " !!!");
if (mYoukuPlayerView != null)
mYoukuPlayerView.setDebugText("出现错误-->onError:"+ what);
以上代码表示在视频播放出错是能够显示错误信息。
disposeAdErrorLoss(what);
if (isAdPlayError(what)) {
Logger.d("PlayFlow", "出现错误:" + what
+ " 处理结果:跳过广告播放");
return loadingADOverTime();
}
以上代码表示在广告正在播放时,调用相应的广告的损害的埋点,disposeAdErrorLoss,并调用loadingADOVerTime(),其中代码为:
mediaPlayerDelegate.playVideoWhenADOverTime();//调用相关的播放视频
updatePlugin(PLUGIN_SHOW_NOT_SET);
if (pluginManager != null) {
getBaseActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
pluginManager.onVideoInfoGetting();
if(mPlayerListener!=null){
mPlayerListener.onGetInfoSuccess();
}
pluginManager.onVideoInfoGetted();
pluginManager.onLoading();
}
});
}
return true;
if (mediaPlayerDelegate != null
&& !mYoukuPlayerView.realVideoStart) {
getBaseActivity().runOnUiThread(new Runnable() {
public void run() {
detectPlugin();
}
});
}
以上代码检测相应的插件,如果没有全屏和小屏的相应插件的话就设置相应的插件。
/
if (!isSendPlayBreakEvent&& MediaPlayerConfiguration.getInstance().trackPlayError()&& mYoukuPlayerView.realVideoStart&& mediaPlayerDelegate != null&& mediaPlayerDelegate.videoInfo != null) {
final String videoUrl = mediaPlayerDelegate.videoInfo
.getWeburl();
final TaskSendPlayBreak task = new TaskSendPlayBreak(
videoUrl);
task.execute();
isSendPlayBreakEvent = true;
}
以上代码表示视频播放出错时,如果没有发送相关错误,获取相应的videoUrl,并调用异步任务上报给优酷中心。
//
if (mYoukuPlayerView.realVideoStart&& mediaPlayerDelegate.isLoading)
Track.onPlayLoadingEnd();
onLoadingFailError();
if (pluginManager == null) {
Logger.d("PlayFlow", "onError出现错误:" + what
+ " pluginManager == null return false");
return false;
}
// Logger.d("PlayFlow", "出现错误:" + what + " 处理结果:去重�?);"
int nowPostition = mediaPlayerDelegate.getCurrentPosition();
if (nowPostition > 0) {
position = nowPostition;
}
// 系统播放器错误特殊处�?
if (what == -38
&& !MediaPlayerProxyUtil.isUplayerSupported()) {
what = MPPErrorCode.MEDIA_INFO_PLAY_UNKNOW_ERROR;
}
if(mPlayerListener!=null){
mPlayerListener.onError( what, extra);
}
return pluginManager.onError(what, extra);
}
以上代码表示视频加载中时,显示加载出错,并获取播放出错的位置然后返回。