Append to an Xcode .mm file from a PostProcess functions?
Hello,
I was wondering if there was a way to write a post-process function in a Unity script that would append to a .mm file in xcode? Specifically, I'm trying to append this block of code:
@interface UIWindow (VideoPlay)
@end
@implementation UIWindow (VideoPlay)
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
[super touchesBegan: touches withEvent: event];
NSString *version = [UIDevice currentDevice].systemVersion;
if(version.doubleValue >= 11 && UnityIsFullScreenPlaying()) {
UnityStopFullScreenVideoIfPlaying();
}
}
@end
To the end of FullScreenVideoPlayer.mm in the Xcode project generated by Unity. This solution is suggested by Quinxx to get around this Unity bug: https://issuetracker.unity3d.com/issues/ios-fullscreenmoviecontrolmode-dot-canceloninput-does-not-work-on-ios11. However, since our team's pipeline revolves around using Unity Cloud Build, it isn't very feasible, currently, for us to go through Xcode every time and do this manually.
Thanks for the help! Hopefully there's a way to do this :)
Chris
Your answer
![](https://koobas.hobune.stream/wayback/20220612142553im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Handheld.PlayFullScreenMovie - when I hit maximise in the video controls does not return to game. 0 Answers
Update Unity FFMpeg in iOS 0 Answers
Handheld.PlayFullScreenMovie double tap 0 Answers
Recording audio and video to stock it into a local file 0 Answers
(Videoplayer component) What file format and resolution do I need for iOS? 0 Answers