外部获取当前播放器,推荐使用
private StandardGSYVideoPlayer getCurPlay() {
if (detailPlayer.getFullWindowPlayer() != null) {
return detailPlayer.getFullWindowPlayer();
}
return detailPlayer;
}
继承默认播放器 重新方法
/**
* 全屏时将对应处理参数逻辑赋给全屏播放器
*
*/
@Override
public GSYBaseVideoPlayer startWindowFullscreen(Context context, boolean actionBar, boolean statusBar) {
SmartPickVideo sampleVideo = (SmartPickVideo) super.startWindowFullscreen(context, actionBar, statusBar);
sampleVideo.mSourcePosition = mSourcePosition;
sampleVideo.mType = mType;
sampleVideo.mTypeText = mTypeText;
return sampleVideo;
}
/**
* 推出全屏时将对应处理参数逻辑返回给非播放器
*
*/
@Override
protected void resolveNormalVideoShow(View oldF, ViewGroup vp, GSYVideoPlayer gsyVideoPlayer) {
super.resolveNormalVideoShow(oldF, vp, gsyVideoPlayer);
if (gsyVideoPlayer != null) {
SmartPickVideo sampleVideo = (SmartPickVideo) gsyVideoPlayer;
mSourcePosition = sampleVideo.mSourcePosition;
mType = sampleVideo.mType;
mTypeText = sampleVideo.mTypeText;
}
}
网友评论