VideoFrame

Show Deprecated

A VideoFrame renders a rectangle, like a Frame does, with a moving video image. The video must be from a file uploaded to the Roblox website.

The video is scaled to fit the entirety of the rectangle, but looks best when displayed at its native resolution.

2D and 3D Sound

A VideoFrame placed underneath SurfaceGui on a BasePart will emit its sound from that part's BasePart.Position.

A VideoFrame exhibits the Doppler effect, meaning its frequency and pitch varies with the relative motion of whatever part it is attached to.

The volume of the VideoFrame will be determined by the distance between the client's sound listener (by default the Camera position) and the position of the VideoFrame's part.

A VideoFrame is considered "global" if it is not placed underneath SurfaceGui on a BasePart. In this case, the sound will play at the same volume throughout the entire place.

Code Samples

The code sample below demonstrates how to create and play a VideoFrame with SomeValidAssetID once the video has loaded.

Creating and Playing a Video

local screenPart = Instance.new("Part")
screenPart.Parent = workspace
local surfaceGui = Instance.new("SurfaceGui")
surfaceGui.Parent = screenPart
local videoFrame = Instance.new("VideoFrame")
videoFrame.Parent = surfaceGui
videoFrame.Looped = true
videoFrame.Video = "rbxassetid://" -- add an asset ID to this
while not videoFrame.IsLoaded do
task.wait()
end
videoFrame:Play()

Summary

Properties

Properties inherited from GuiObject

Properties

Properties inherited from GuiBase2d

Properties

Methods

Methods inherited from GuiObject

Methods

Events

Events inherited from GuiObject

Events

Events inherited from GuiBase2d

Events

Properties

IsLoaded

Read Only
Not Replicated
Read Parallel

Looped

Read Parallel

Playing

Not Replicated
Read Parallel

Resolution

Read Only
Not Replicated
Read Parallel

TimeLength

Read Only
Not Replicated
Read Parallel

TimePosition

Not Replicated
Read Parallel

Video

ContentId
Read Parallel

Code Samples

Creating and Playing a Video

local screenPart = Instance.new("Part")
screenPart.Parent = workspace
local surfaceGui = Instance.new("SurfaceGui")
surfaceGui.Parent = screenPart
local videoFrame = Instance.new("VideoFrame")
videoFrame.Parent = surfaceGui
videoFrame.Looped = true
videoFrame.Video = "rbxassetid://" -- add an asset ID to this
while not videoFrame.IsLoaded do
task.wait()
end
videoFrame:Play()

Volume

Read Parallel

Methods

Pause

()

Returns

()

Play

()

Returns

()

Code Samples

Creating and Playing a Video

local screenPart = Instance.new("Part")
screenPart.Parent = workspace
local surfaceGui = Instance.new("SurfaceGui")
surfaceGui.Parent = screenPart
local videoFrame = Instance.new("VideoFrame")
videoFrame.Parent = surfaceGui
videoFrame.Looped = true
videoFrame.Video = "rbxassetid://" -- add an asset ID to this
while not videoFrame.IsLoaded do
task.wait()
end
videoFrame:Play()

Events

DidLoop

Parameters

video: string

Ended

Parameters

video: string

Loaded

Parameters

video: string

Paused

Parameters

video: string

Played

Parameters

video: string