UnityReplayKit.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef UnityReplayKit_h
  2. #define UnityReplayKit_h
  3. #if UNITY_REPLAY_KIT_AVAILABLE
  4. #import <Foundation/Foundation.h>
  5. #import <ReplayKit/ReplayKit.h>
  6. @interface UnityReplayKit : NSObject<RPPreviewViewControllerDelegate, RPScreenRecorderDelegate>
  7. {
  8. }
  9. + (instancetype)sharedInstance;
  10. @property(nonatomic, readonly) BOOL apiAvailable;
  11. @property(nonatomic, readonly) NSString* lastError;
  12. @property(nonatomic, readonly) RPPreviewViewController* previewController;
  13. @property(nonatomic, readonly) BOOL recordingPreviewAvailable;
  14. @property(nonatomic, readonly, getter = isRecording) BOOL recording;
  15. - (BOOL)startRecording:(BOOL)enableMicrophone;
  16. - (BOOL)stopRecording;
  17. - (BOOL)showPreview;
  18. - (BOOL)discardPreview;
  19. - (void)screenRecorder:(RPScreenRecorder*)screenRecorder didStopRecordingWithError:(NSError*)error previewViewController:(RPPreviewViewController*)previewViewController;
  20. - (void)previewControllerDidFinish:(RPPreviewViewController*)previewController;
  21. @property(nonatomic, readonly) BOOL broadcastingApiAvailable;
  22. @property(nonatomic, readonly) BOOL isBroadcasting;
  23. @property(nonatomic, readonly) NSURL* broadcastURL;
  24. @property(nonatomic, setter = setCameraEnabled:, getter = isCameraEnabled) BOOL cameraEnabled;
  25. @property(nonatomic, setter = setMicrophoneEnabled:, getter = isMicrophoneEnabled) BOOL microphoneEnabled;
  26. - (void)startBroadcastingWithCallback:(void *)callback;
  27. - (void)stopBroadcasting;
  28. - (BOOL)showCameraPreviewAt:(CGPoint)position;
  29. - (void)hideCameraPreview;
  30. @end
  31. #endif // UNITY_REPLAY_KIT_AVAILABLE
  32. #endif // UnityReplayKit_h