我尝试将userinteractionEnabled: AVPlayerViewController设置为“否”
[playerViewController setUserInteractionEnabled:NO];但我有个错误
"No visible @interface for 'AVPlayerViewController' declares the selector 'setUserInteractionEnabled:'"这里没有可见的@接口,这是我的完整代码:
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];我只是希望人们不能在视频中点击屏幕。
提前谢谢。
发布于 2018-04-27 14:24:28
试试这个:
[[UIApplication sharedApplication] beginIgnoringInteractionEvents];
[[UIApplication sharedApplication] endIgnoringInteractionEvents];或者这个:
playerViewController.view.userInteractionEnabled = NO;发布于 2018-04-27 13:48:12
也许这能帮你:
[[UIApplication sharedApplication] beginIgnoringInteractionEvents];
[[UIApplication sharedApplication] endIgnoringInteractionEvents];https://stackoverflow.com/questions/50063770
复制相似问题