Home Integration Usage API FAQ URP14 # Recorder API All classes are under `pmjo.NextGenRecorder` namespace so remember `using pmjo.NextGenRecorder;` ## Properties ``` // Recording state public static bool IsSupported public static bool IsReadyForRecording public static bool IsRecording public static bool IsPaused // Recording options public static int TargetFrameRate public static bool FrameSkipping public static int MinDiskSpaceRequired public static float VideoScale public static int VideoDimensionsDivisibleBy public static bool RecordAudio public static bool RealtimeRecording public static ColorSpace ColorSpace public static bool VerticalFlip // Watermark public static Texture WatermarkTexture public static WatermarkCorner WatermarkCorner public static Vector2 WatermarkOffset ``` ## Functions ``` // Preparing the recording session (optional) public static void PrepareRecording() // Controlling the recording public static void StartRecording() public static void PauseRecording() public static void ResumeRecording() public static void StopRecording() // Marking highlights public static bool SetHighlight(int priority, int preSeconds, int postSeconds) public static bool SetHighlight(int priority, int preSeconds, int postSeconds, long highlightId) // Session handling public static long[] GetAllRecordingSessions() public static long GetLastRecordingSession() public static bool RemoveRecordingSession(long sessionId) // Video and thumbnail export public static void ExportRecordingSession(long sessionId) public static void ExportRecordingSessionHighlights(long sessionId) public static void ExportRecordingSessionHighlights(long sessionId, float targetLength) public static void ExportRecordingSessionHighlights(long sessionId, long[] highlightIdentifiers) public static void ExportRecordingSessionHighlights(long sessionId, long[] highlightIdentifiers, float targetLength) public static void ExportRecordingSessionThumbnail(long sessionId, int maxSideWidth, ThumbnailType type) ``` ## Delegates and events ``` // Delegates public delegate void RecordingStartedDelegate(long sessionId) public delegate void RecordingPausedDelegate(long sessionId) public delegate void RecordingResumedDelegate(long sessionId) public delegate void RecordingStoppedDelegate(long sessionId) public delegate void RecordingExportedDelegate(long sessionId, string path, ErrorCode errorCode) public delegate void HighlightsExportedDelegate(long sessionId, string path, ErrorCode errorCode) public delegate void ThumbnailExportedDelegate(long sessionId, string path, ErrorCode errorCode) public delegate int CustomVideoBitrateDelegate(long sessionId, int width, int height, int frameRate) public delegate int CustomAudioBitrateDelegate(long sessionId, int sampleRate, int channelCount) // Events public static event RecordingStartedDelegate RecordingStarted public static event RecordingPausedDelegate RecordingPaused public static event RecordingResumedDelegate RecordingResumed public static event RecordingStoppedDelegate RecordingStopped public static event RecordingExportedDelegate RecordingExported public static event HighlightsExportedDelegate HighlightRecordingExported public static event ThumbnailExportedDelegate ThumbnailExported // Callbacks public static CustomVideoBitrateDelegate CustomVideoBitrate public static CustomAudioBitrateDelegate CustomAudioBitrate ``` ## Error codes ``` public enum ErrorCode { NoError = 0, NothingToExport, InvalidSession, RecordingFailed } ``` ## Thumbnail types ``` public enum ThumbnailType { JPG = 0, PNG } ``` ## Watermark corner ``` public enum WatermarkCorner : int { TopRight = 0, TopLeft, BottomRight, BottomLeft } ``` # Sharing API All classes are under `pmjo.NextGenRecorder.Sharing` namespace so remember `using pmjo.NextGenRecorder.Sharing;` ## Delegates and events ``` // Delegates public delegate void ShareSheetClosedDelegate public delegate void SavedToPhotosDelegate(ErrorCode errorCode) public delegate void SavedToSelectedFolderDelegate(ErrorCode errorCode) // Events public static event ShareSheetClosedDelegate ShareSheetClosed public static event SavedToPhotosDelegate SavedToPhotos public static event SavedToSelectedFolderDelegate SavedToSelectedFolder ``` ## Functions ``` public static void ShowShareSheet(string path) public static void ShowShareSheet(string path, bool pauseEngine) public static void SaveToPhotos(string path) public static void SaveToPhotos(string path, string albumName) public static void SaveToSelectedFolder(string path) public static void SaveToSelectedFolder(string path, string preferredName) ``` ## Error codes ``` public enum ErrorCode { NoError = 0, UnknownError, NotSupported, FailedToCreateAlbum, FileNotFound, PermissionError, Cancelled } ```