Unity 在IOS上播放视频不能跳过

来源:互联网 发布:手机语音读书软件 编辑:程序博客网 时间:2024/05/21 06:49

在Unity生成的Xcode项目找到到FullScreenVideoPlayer.mm

在最后添加

@interface UIWindow(VideoPlay) 
@end

@ UI实现UIWindow(VideoPlay) 
- (void)touchesBegan:(NSSet <UITouch *> *)触摸与事件:(UIEvent *)事件{ 
[super touchesBegan:touches withEvent:event]; 

NSString * version = [UIDevice currentDevice] .systemVersion; 
if(version.doubleValue> = 11 && UnityIsFullScreenPlaying()){ 
UnityStopFullScreenVideoIfPlaying(); 


@end