Learn
Engine Class
VideoPlayer
Not Browsable

Code Samples
Video Player (Server Side)
-- This should be in a "Script" with RunContext set to "Legacy" or "Server"
-- Create what the video is displayed on
local videoScreenPart = Instance.new("Part")
videoScreenPart.Anchored = true
videoScreenPart.Size = Vector3.new(12, 6, 1)
videoScreenPart.CFrame = CFrame.new(0, 5, 0)
videoScreenPart.Parent = workspace
local videoScreenUI = Instance.new("SurfaceGui")
videoScreenUI.Parent = videoScreenPart
local videoDisplay = Instance.new("VideoDisplay")
videoDisplay.Size = UDim2.new(1, 0, 1, 0)
videoDisplay.Parent = videoScreenUI
-- Create where a video asset originates from
local videoSource = Instance.new("VideoPlayer")
videoSource.VideoContent = Content.fromUri("rbxassetid://5608359401")
videoSource.Looping = true
videoSource.Parent = videoScreenPart
-- Create where the video's audio emits from
local speakerPart = Instance.new("Part")
speakerPart.Anchored = true
speakerPart.Parent = workspace
local audioEmitter = Instance.new("AudioEmitter")
audioEmitter.Parent = speakerPart
-- Create and connect wires so that the video visually renders and emits audio
local videoWire = Instance.new("Wire")
videoWire.SourceInstance = videoSource
videoWire.TargetInstance = videoDisplay
videoWire.Parent = videoSource
local audioWire = Instance.new("Wire")
audioWire.SourceInstance = videoSource
audioWire.TargetInstance = audioEmitter
audioWire.Parent = videoSource
-- Play the video
-- Note: Playing a video on the server does not guarantee it is loaded or synced for all clients, playing on the client is preferred
videoSource:Play()
Video Player (Client Side)
-- This should be in either a "LocalScript" or "Script" with RunContext set to "Client"
-- Same code as above sample until the "Play the video" section
-- Play the video after it has loaded
videoSource:GetPropertyChangedSignal("IsLoaded"):Connect(function()
if videoSource.IsLoaded then
print("Video has loaded, starting playback in 2 seconds.")
wait(2)
videoSource:Play()
end
end)
-- Load the video to have it ready when we need it
videoSource:LoadAsync()
wait(5)
-- Unload the video to save resources
videoSource:Unload()

API Reference
Properties
AutoLoadInStudio
Not Replicated
Not Scriptable
Roblox Script Security
Read Parallel
Capabilities: Audio, UI
VideoPlayer.AutoLoadInStudio:boolean

AutoPlayInStudio
Not Replicated
Not Scriptable
Roblox Script Security
Read Parallel
Capabilities: Audio, UI
VideoPlayer.AutoPlayInStudio:boolean

IsLoaded
Read Only
Not Replicated
Read Parallel
Capabilities: Audio, UI
VideoPlayer.IsLoaded:boolean

IsPlaying
Read Only
Not Replicated
Read Parallel
Capabilities: Audio, UI
VideoPlayer.IsPlaying:boolean

Looping
Read Parallel
Capabilities: Audio, UI
VideoPlayer.Looping:boolean

MaximumResolution
Hidden
Read Parallel
Capabilities: Audio, UI, InternalTest
VideoPlayer.MaximumResolution:Enum.VideoSampleSize

PlaybackSpeed
Read Parallel
Capabilities: Audio, UI
VideoPlayer.PlaybackSpeed:number

Resolution
Read Only
Not Replicated
Read Parallel
Capabilities: Audio, UI
VideoPlayer.Resolution:Vector2

TimeLength
Read Only
Not Replicated
Read Parallel
Capabilities: Audio, UI
VideoPlayer.TimeLength:number

TimePosition
Read Parallel
Capabilities: Audio, UI
VideoPlayer.TimePosition:number

VideoContent
Read Parallel
Capabilities: Audio, UI
VideoPlayer.VideoContent:Content

Volume
Read Parallel
Capabilities: Audio, UI
VideoPlayer.Volume:number

Methods
GetConnectedWires
Capabilities: Audio, UI
VideoPlayer:GetConnectedWires(pin:string):{Wire}
Parameters
pin:string
Returns

GetInputPins
Capabilities: Audio, UI
VideoPlayer:GetInputPins():{any}
Returns

GetOutputPins
Capabilities: Audio, UI
VideoPlayer:GetOutputPins():{any}
Returns

LoadAsync
Yields
Capabilities: Audio, UI
VideoPlayer:LoadAsync():Enum.AssetFetchStatus

Pause
Capabilities: Audio, UI
VideoPlayer:Pause():()
Returns
()

Play
Capabilities: Audio, UI
VideoPlayer:Play():()
Returns
()

Unload
Capabilities: Audio, UI
VideoPlayer:Unload():()
Returns
()

Events
DidEnd
Capabilities: Audio, UI
VideoPlayer.DidEnd():RBXScriptSignal

DidLoop
Capabilities: Audio, UI
VideoPlayer.DidLoop():RBXScriptSignal

PlayFailed
Capabilities: Audio, UI
VideoPlayer.PlayFailed(error:Enum.AssetFetchStatus):RBXScriptSignal
Parameters

WiringChanged
Capabilities: Audio, UI
VideoPlayer.WiringChanged(
connected:boolean, pin:string, wire:Wire, instance:Instance
Parameters
connected:boolean
pin:string
wire:Wire
instance:Instance

©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.