LiteAVSDK / Player_iOS

Super player for iOS...
https://trtc.io/
1.11k stars 225 forks source link

直播 TXLivePlayer 使用 enablePictureInPicture 开启画中画后没有反应 #322

Closed Monkeyzc closed 6 months ago

Monkeyzc commented 6 months ago

SuperPlayerView version: pod 'TXLiteAVSDK_Player', '11.4.14530' 直播中, 点击画中画按钮, 开启画中画 , app在前台没有出现画中画, 但是退到后台后, 有画中画

//画中画
- (void)controlViewPip:(UIView *)controlView {
    if (![TXVodPlayer isSupportPictureInPicture]) {
        [self setPipLoadingWithText:superPlayerLocalized(@"SuperPlayer.notsupportpip")];
        [self.pipLoadingView startAnimating];

        dispatch_time_t time = dispatch_time(DISPATCH_TIME_NOW, (ino64_t)(0.5 * NSEC_PER_SEC));
        dispatch_after(time, dispatch_get_main_queue(), ^{
            [self.pipLoadingView stopAnimating];
        });
        return;
    }

    if (_hasStartPip) {
        return;
    } else {

        if (_hasStartPipLoading) {
            return;
        }

        if (self.state == StateStopped) {
            return;
        }

        [self setPipLoadingWithText:PIP_START_LOADING_TEXT];
        [self.pipLoadingView startAnimating];
        _hasStartPipLoading = YES;

        if (self.isLive) {
            // 直播
            BOOL result = [_livePlayer enablePictureInPicture: true];
            NSLog(@"画中画: %d", result);
        } else {
            [_vodPlayer enterPictureInPicture];
        }
    }
}
Tencent-Alice commented 6 months ago

嗨 ,您这问题解决了吗 ? 如果未解决,一起排查看下 技术问题 欢迎交流 Q2562367495 注明来意

tgitpushping commented 6 months ago

直播的画中画不一样,直播走的是TXLivePlayer2 不用点播的画中画方案