UnityReplayKit.h 1.7 KB

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