class MAGES::Recorder::RecorderModule

Overview

The root module for the XR recorder. More…

class RecorderModule: public MAGES::HubModule
{
public:
    // classes

    class Recording;

    // properties

    int FrameSkip;
    bool IsRecording;
    string AudioCodec;
    long CurrentFrame;
    string GetRecordingsDataURL;
    string PutRecordingsDataURL;
    string DownloadRecordingURL;
    string DeleteRecordingURL;
    string PatchRecordingURL;
    bool Armed;
    GameObject PlayerMenu;
    GameObject Proxy;
    Utilities.EventDelegator Events;
    Recorder RecorderInstance;
    Player PlayerInstance;
    GameObjectPathCache PathCache;

    // methods

    static int GetRecordingLength(string file);
    override void Startup();
    override void Shutdown();
    virtual override void UpdateModule(UpdatePhase updatePhase);
    async TaskRecording>> GetRecordingsAsync();
    IEnumerable<Recording> GetRecordings();
    Recording StopRecording();

    void UploadRecording(
        Recording recording,
        System.Action onUploadComplete = null,
        System.Action onUploadUpdate = null,
        bool asInstructor = false
    );

    async Task<(bool, string)> UploadRecordingAsync(
        Recording recording,
        System.Action onUpdate,
        bool asPublic = false
    );

    async Task<(bool, string)> PlayRecordingAsync(
        Recording recording,
        System.Action onUpdate
    );
};

Inherited Members

public:
    // properties

    int Version;

    // methods

    void Startup();
    void Shutdown();
    virtual void UpdateModule(UpdatePhase updatePhase);

Detailed Documentation

The root module for the XR recorder.

Properties

int FrameSkip

Gets or sets the number of frames to skip between polling.

bool IsRecording

Gets a value indicating whether the recorder is recording.

string AudioCodec

Gets or sets the audio codec.

long CurrentFrame

Gets the current frame of recording/playback.

string GetRecordingsDataURL

Gets the url to get recordings data.

string PutRecordingsDataURL

Gets the url to put recordings data.

string DownloadRecordingURL

Gets the url to download recordings data.

string DeleteRecordingURL

Gets the url to delete recordings data.

string PatchRecordingURL

Gets the url to patch recordings data.

bool Armed

Gets or sets a value indicating whether the recorder will start recording when appropriate.

This doesn’t mean you can start/stop recording whenever - only before the start action).

GameObject PlayerMenu

Gets the gameobject that is used as the menu of the recorder.

GameObject Proxy

Gets the proxy gameobject.

Utilities.EventDelegator Events

Gets the event delegator.

Recorder RecorderInstance

Gets the recorder instance.

Player PlayerInstance

Gets the player instance.

GameObjectPathCache PathCache

Gets the path cache.

Methods

static int GetRecordingLength(string file)

Gets the length of a recording in seconds.

Parameters:

file

The file to read.

Returns:

The amount of seconds the recording takes.

virtual override void UpdateModule(UpdatePhase updatePhase)

Called while the module is active.

Parameters:

updatePhase

The phase of the update.

IEnumerable<Recording> GetRecordings()

Gets all recordings.

Returns:

An enumerable of recordings.

Recording StopRecording()

Stop Recording.

Returns:

The recording files.

void UploadRecording(
    Recording recording,
    System.Action onUploadComplete = null,
    System.Action onUploadUpdate = null,
    bool asInstructor = false
)

Uploads a recording.

The onUploadUpdate action is invoked from a background thread, so no use of any Unity API call is allowed.

Parameters:

recording

The recording to upload.

onUploadComplete

Action invoked when the upload completed or failed.

onUploadUpdate

Action invoked when the upload is in progress.

asInstructor

A value indicating whether the recording is an instructor recording.