Skip to content

Video

The Video class extends the Item class to manage video playback within an engine environment, facilitating precise control over video content. This class is particularly useful for applications requiring interactive video manipulation, such as media players or a game cutscene.

Inherits from

Item

Usage

To use this class, add the following require at the top of your script:

local Video = require 'engine/items/video'

Reference

create

static create(self, attributes)

Create a new video

Parameters

  • self
  • attributes (table): list of attributes. without, the video will be created with default values

Returns

  • Video: of the created video

Properties

You can access these properties directly on the object or through :get("propertyName") or :set("propertyName", value) methods.

Property Type Default Description
encoding Enum Linear Options: Linear, sRGB

play

play()

Play the video

pause

pause()

Pause the video

setTimeAbsolute

setTimeAbsolute(time)

Set absolute video time in milliseconds

Parameters

  • time

setTimeRelative

setTimeRelative(time)

Set relative video time (between 0 and 1).

Parameters

  • time