美文网首页
GSYVideoPlayer全屏与非全屏的同步问题

GSYVideoPlayer全屏与非全屏的同步问题

作者: 妖精的尾巴_3be1 | 来源:发表于2022-09-29 16:16 被阅读0次

外部获取当前播放器,推荐使用

 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;
    }
}

相关文章

网友评论

      本文标题:GSYVideoPlayer全屏与非全屏的同步问题

      本文链接:https://www.haomeiwen.com/subject/ysccartx.html