---
title: "video"
description: "The video namespace — the engine's Luau API reference for video."
section: "API Reference"
slug: "api-video"
canonical: "https://origozero.ai/docs/api-video"
updated: "2026-09-05T23:13:47.542100060+00:00"
tags: ["api", "reference"]
---

# video

The `video` namespace — 28 functions.

## globals/video/create {#globals-video-create}

```lua
video.create(url: string, options: VideoOptions?) -> string
```

Create a video player. Returns a texture handle (e.g.
`"video_0"`) usable directly in `material.setTexture()` — its
frames sample like any other texture.

**Parameters**

- `url` `string` — URL or asset path to an MP4 video file.
- `options` `VideoOptions` _(optional)_ — Playback options: `loop` (default false), `autoplay`
(default false), `rate` (default 1.0).

**Returns** `string` — Texture handle.

```lua
local tex = video.create("http://example.com/clip.mp4", { autoplay = true })
```

## globals/video/destroy {#globals-video-destroy}

```lua
video.destroy(handle: string) -> boolean
```

Destroy a video player and free the render target and all
resources.

**Parameters**

- `handle` `string` — Video handle from `video.create`.

**Returns** `boolean` — True if the player was found and destroyed.

```lua
video.destroy(rt)
```

## globals/video/getInfo {#globals-video-getinfo}

```lua
video.getInfo(handle: string) -> VideoInfo?
```

Get video information and current playback state.

**Parameters**

- `handle` `string` — Video handle.

**Returns** `VideoInfo?` — `{ width, height, duration, currentTime, state, rate, loop }` or nil if the handle is invalid.

```lua
local i = video.getInfo(rt); print(i.currentTime, "/", i.duration)
```

## globals/video/pause {#globals-video-pause}

```lua
video.pause(handle: string) -> boolean
```

Pause video playback. Can be resumed with `video.play`.

**Parameters**

- `handle` `string` — Video handle.

**Returns** `boolean` — True if the video was playing and is now paused.

```lua
video.pause(rt)
```

## globals/video/play {#globals-video-play}

```lua
video.play(handle: string) -> boolean
```

Start or resume video playback.

**Parameters**

- `handle` `string` — Video handle from `video.create`.

**Returns** `boolean` — True if the command was accepted.

```lua
video.play(rt)
```

## globals/video/seek {#globals-video-seek}

```lua
video.seek(handle: string, time: number) -> boolean
```

Seek to a specific time (seconds) in the video.

**Parameters**

- `handle` `string` — Video handle.
- `time` `number` — Target time in seconds.

**Returns** `boolean` — True if the seek was performed.

```lua
video.seek(rt, 30.5)
```

## globals/video/setLoop {#globals-video-setloop}

```lua
video.setLoop(handle: string, loop: boolean) -> boolean
```

Enable or disable looping.

**Parameters**

- `handle` `string` — Video handle.
- `loop` `boolean` — Whether to loop playback.

**Returns** `boolean` — True if the setting was applied.

```lua
video.setLoop(rt, true)
```

## globals/video/setRate {#globals-video-setrate}

```lua
video.setRate(handle: string, rate: number) -> boolean
```

Set the playback speed multiplier. 1.0 = normal, 2.0 = double
speed, 0.5 = half speed.

**Parameters**

- `handle` `string` — Video handle.
- `rate` `number` — Playback rate.

**Returns** `boolean` — True if the rate was set.

```lua
video.setRate(rt, 2.0)
```

## globals/video/stop {#globals-video-stop}

```lua
video.stop(handle: string) -> boolean
```

Stop video playback and reset to the beginning.

**Parameters**

- `handle` `string` — Video handle.

**Returns** `boolean` — True if the command was accepted.

```lua
video.stop(rt)
```

## modules/video/README {#modules-video-readme}

```lua
require("@builtin/modules/api/engine/video") -- video (also available as global 'video')
```

Video playback — create / play / pause / seek / setRate / setLoop / destroy on render-target-backed video players. Public Luau surface over the `__video` Internal FFI namespace.

Usage: local video = require("@builtin/modules/api/engine/video")
Also available as global: video

## modules/video/create {#modules-video-create}

```lua
create(url: string, options: VideoOptions?): string
```

Create a video player. Returns a texture handle (e.g.
`"video_0"`) usable directly in `material.setTexture()` — its
frames sample like any other texture.

**Parameters**

- `url` `string` — URL or asset path to an MP4 video file.
- `options` `VideoOptions?` _(optional)_ — Playback options: `loop` (default false), `autoplay`
(default false), `rate` (default 1.0).

```lua
local tex = video.create("http://example.com/clip.mp4", { autoplay = true })
```

## modules/video/destroy {#modules-video-destroy}

```lua
destroy(handle: string): boolean
```

Destroy a video player and free the render target and all
resources.

**Parameters**

- `handle` `string` — Video handle from `video.create`.

```lua
video.destroy(rt)
```

## modules/video/getInfo {#modules-video-getinfo}

```lua
getInfo(handle: string): VideoInfo?
```

Get video information and current playback state.

**Parameters**

- `handle` `string` — Video handle.

```lua
local i = video.getInfo(rt); print(i.currentTime, "/", i.duration)
```

## modules/video/pause {#modules-video-pause}

```lua
pause(handle: string): boolean
```

Pause video playback. Can be resumed with `video.play`.

**Parameters**

- `handle` `string` — Video handle.

```lua
video.pause(rt)
```

## modules/video/play {#modules-video-play}

```lua
play(handle: string): boolean
```

Start or resume video playback.

**Parameters**

- `handle` `string` — Video handle from `video.create`.

```lua
video.play(rt)
```

## modules/video/seek {#modules-video-seek}

```lua
seek(handle: string, time: number): boolean
```

Seek to a specific time (seconds) in the video.

**Parameters**

- `handle` `string` — Video handle.
- `time` `number` — Target time in seconds.

```lua
video.seek(rt, 30.5)
```

## modules/video/setLoop {#modules-video-setloop}

```lua
setLoop(handle: string, loop: boolean): boolean
```

Enable or disable looping.

**Parameters**

- `handle` `string` — Video handle.
- `loop` `boolean` — Whether to loop playback.

```lua
video.setLoop(rt, true)
```

## modules/video/setRate {#modules-video-setrate}

```lua
setRate(handle: string, rate: number): boolean
```

Set the playback speed multiplier. 1.0 = normal, 2.0 = double
speed, 0.5 = half speed.

**Parameters**

- `handle` `string` — Video handle.
- `rate` `number` — Playback rate.

```lua
video.setRate(rt, 2.0)
```

## modules/video/stop {#modules-video-stop}

```lua
stop(handle: string): boolean
```

Stop video playback and reset to the beginning.

**Parameters**

- `handle` `string` — Video handle.

```lua
video.stop(rt)
```

## typed/builtin//modules/api/engine/video/video/create {#typed-builtin-modules-api-engine-video-video-create}

```lua
video.create(url: string, options: VideoOptions?) -> string
```

Create a video player. Returns a texture handle (e.g.
`"video_0"`) usable directly in `material.setTexture()` — its
frames sample like any other texture.

## typed/builtin//modules/api/engine/video/video/destroy {#typed-builtin-modules-api-engine-video-video-destroy}

```lua
video.destroy(handle: string) -> boolean
```

Destroy a video player and free the render target and all
resources.

**Parameters**

- `handle` `string` — Video handle from `video.create`.

**Returns** `boolean` — True if the player was found and destroyed.

```lua
video.destroy(rt)
```

## typed/builtin//modules/api/engine/video/video/getInfo {#typed-builtin-modules-api-engine-video-video-getinfo}

```lua
video.getInfo(handle: string) -> VideoInfo?
```

Get video information and current playback state.

**Parameters**

- `handle` `string` — Video handle.

**Returns** `VideoInfo?` — `{ width, height, duration, currentTime, state, rate, loop }` or nil if the handle is invalid.

```lua
local i = video.getInfo(rt); print(i.currentTime, "/", i.duration)
```

## typed/builtin//modules/api/engine/video/video/pause {#typed-builtin-modules-api-engine-video-video-pause}

```lua
video.pause(handle: string) -> boolean
```

Pause video playback. Can be resumed with `video.play`.

**Parameters**

- `handle` `string` — Video handle.

**Returns** `boolean` — True if the video was playing and is now paused.

```lua
video.pause(rt)
```

## typed/builtin//modules/api/engine/video/video/play {#typed-builtin-modules-api-engine-video-video-play}

```lua
video.play(handle: string) -> boolean
```

Start or resume video playback.

## typed/builtin//modules/api/engine/video/video/seek {#typed-builtin-modules-api-engine-video-video-seek}

```lua
video.seek(handle: string, time: number) -> boolean
```

Seek to a specific time (seconds) in the video.

**Parameters**

- `handle` `string` — Video handle.
- `time` `number` — Target time in seconds.

**Returns** `boolean` — True if the seek was performed.

```lua
video.seek(rt, 30.5)
```

## typed/builtin//modules/api/engine/video/video/setLoop {#typed-builtin-modules-api-engine-video-video-setloop}

```lua
video.setLoop(handle: string, loop: boolean) -> boolean
```

Enable or disable looping.

**Parameters**

- `handle` `string` — Video handle.
- `loop` `boolean` — Whether to loop playback.

**Returns** `boolean` — True if the setting was applied.

```lua
video.setLoop(rt, true)
```

## typed/builtin//modules/api/engine/video/video/setRate {#typed-builtin-modules-api-engine-video-video-setrate}

```lua
video.setRate(handle: string, rate: number) -> boolean
```

Set the playback speed multiplier. 1.0 = normal, 2.0 = double
speed, 0.5 = half speed.

**Parameters**

- `handle` `string` — Video handle.
- `rate` `number` — Playback rate.

**Returns** `boolean` — True if the rate was set.

```lua
video.setRate(rt, 2.0)
```

## typed/builtin//modules/api/engine/video/video/stop {#typed-builtin-modules-api-engine-video-video-stop}

```lua
video.stop(handle: string) -> boolean
```

Stop video playback and reset to the beginning.

**Parameters**

- `handle` `string` — Video handle.

**Returns** `boolean` — True if the command was accepted.

```lua
video.stop(rt)
```
