gpt4 book ai didi

ios - 如何设置 userinteractionEnabled : to NO for an AVPlayerViewController?

转载 作者:行者123 更新时间:2023-11-28 19:27:50 31 4
gpt4 key购买 nike

我尝试将 userinteractionEnabled: 设置为 AVPlayerViewController 的 NO

[playerViewController setUserInteractionEnabled:NO];

但是我有一个错误

"No visible @interface for 'AVPlayerViewController' declares the selector 'setUserInteractionEnabled:'"

没有可见的@interface这是我的完整代码:

AVPlayer *player = [AVPlayer playerWithURL:videoURL];
AVPlayerViewController *playerViewController = [AVPlayerViewController new];
playerViewController.player = player;
playerViewController.showsPlaybackControls = false;
[playerViewController.player play];
[playerViewController setUserInteractionEnabled:NO];
[self.navigationController pushViewController:playerViewController animated:YES];
[self performSelector:@selector(popToMain) withObject:nil afterDelay:durationInSeconds];

我只是希望人们在观看视频时不能点击屏幕。

提前致谢。

最佳答案

也许这对你有帮助:

[[UIApplication sharedApplication] beginIgnoringInteractionEvents];
[[UIApplication sharedApplication] endIgnoringInteractionEvents];

关于ios - 如何设置 userinteractionEnabled : to NO for an AVPlayerViewController?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50063770/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com