renzifeng / ZFPlayer

Support customization of any player SDK and control layer(支持定制任何播放器SDK和控制层)
MIT License
7.04k stars 1.74k forks source link

player在scrollview中,stopWhileNotVisible=false之后的addPlayerViewToSmallFloatView能否有外界控制? #1417

Open gongqiuwei opened 7 months ago

gongqiuwei commented 7 months ago

scrollView.zf_playerDidDisappearInScrollView = ^(NSIndexPath * _Nonnull indexPath) { @zf_strongify(self) if (self.isFullScreen) return; if (self.zf_playerDidDisappearInScrollView) self.zf_playerDidDisappearInScrollView(indexPath); if ([self.controlView respondsToSelector:@selector(playerDidDisappearInScrollView:)]) { [self.controlView playerDidDisappearInScrollView:self]; }

    if (self.stopWhileNotVisible) { /// stop playing
        if (self.containerType == ZFPlayerContainerTypeView) {
            [self stopCurrentPlayingView];
        } else if (self.containerType == ZFPlayerContainerTypeCell) {
            [self stopCurrentPlayingCell];
        }
    } else { /// add to window
        if (!self.isSmallFloatViewShow) {
            [self addPlayerViewToSmallFloatView];
        }
    }
};

这里,是否addPlayerViewToSmallFloatView交由外界控制?

背景需求: 滑动scrollView只是暂停播放器,不是停止,因此stopWhileNotVisible=false,自己控制播放的暂停,但是滑动后会出现小窗播放