我尝试将 AVPlayerViewController 的 userinteractionEnabled: 设置为 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];
我只是希望人们在视频期间不能点击屏幕。
提前致谢。