Trigger API Reference\DCEI Functions\Video


These APIs allow you to record gameplay footage and even let players share these clips with friends.

bool Video.StartRecording(string filename)

bool Video.StartRecording(string filename)

Description


Starts the recording process. Returns true/false if successful or not.

Parameters

Example Usage

function SharingSystem:AttemptStartRecording()
    local filename = "SuperMediaHero"
    local can_record_video = DCEI.Video.StartRecording(filename)

    -- store if video recording started successfully
    self.has_video_to_share = can_record_video
end

void Video.CancelRecording()

void Video.CancelRecording()

Description


Cancels recording.

Example Usage

function SharingSystem:CancelRecording()
    if self:HasVideoToShare() then
        DCEI.Video.CancelRecording()
        self.has_video_to_share = false
    end
end

void Video.StopRecording()

void Video.StopRecording()

Description


Stops recording.

Example Usage

function SharingSystem:StopRecording()
    if self:HasVideoToShare() then
        DCEI.Video.StopRecording()
    end
end

void Video.ViewRecording()

void Video.ViewRecording()

Description


View the recorded video

Example Usage

function SharingSystem:ViewRecording()
    DCEI.Video.ViewRecording()
end

void Video.ShareRecording(string text)

void Video.ShareRecording(string text)

Description


The device will attempt to share the video recording. The result depends on how the users device (or chosen app) responds to the request.

Parameters

Example Usage

function SharingSystem:ShareRecording()
    local text = "I just beat Level 10 with the power of emojis!"
    local hashtag = "#supermediahero"
    local url = "https://www.funovus.com/games/super-media-hero"
    local share_text = text .. " " .. hashtag .. " " .. url
    DCEI.Video.ShareRecording(share_text)
end