Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

退到后台自动启动画中画功能不生效? #550

Closed
kingstal opened this issue Aug 2, 2022 · 3 comments
Closed

退到后台自动启动画中画功能不生效? #550

kingstal opened this issue Aug 2, 2022 · 3 comments
Labels

Comments

@kingstal
Copy link

kingstal commented Aug 2, 2022

进入后台后,在相关回调中调用[self.player.playbackController startPictureInPicture]开始画中画不生效,请问该如何解决?

@changsanjiang
Copy link
Owner

@kingstal 我在新版增加了一个属性控制, 设置如下:

// BasePlayer 3.7.3 新增加了这个属性
 player.playbackController.canStartPictureInPictureAutomaticallyFromInline = YES;

@kingstal
Copy link
Author

我在example工程中添加了按钮用来切换这个属性的值,设置为yes,退到后台能开启画中画;但重新设置为no,退到后台画中画没有关闭
请问是什么原因呢

@changsanjiang
Copy link
Owner

@kingstal 取消操作暂时如下处理吧:

- (void)cancelPictureInPicture API_AVAILABLE(ios(14.2)) {
    _player.playbackController.canStartPictureInPictureAutomaticallyFromInline = NO;    
    // cancelPictureInPicture 当前版本没有暴露, 下个版本我再把它提出来
    [_player.playbackController performSelector:@selector(cancelPictureInPicture)];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants