Reference API Roblox

Engine API

Website

Related

Reference API Roblox

VideoPlayer

Used to play video assets.

This class is not browsable. It is not visible in Studio's object browser.
Tags: [NotBrowsable]

Member index 24

HistoryMember
690AutoLoadInStudio: bool
690AutoPlayInStudio: bool
668IsLoaded: bool
668IsPlaying: bool
653Looping: bool
653PlaybackSpeed: float
653Resolution: Vector2
653TimeLength: double
653TimePosition: double
687VideoContent: Content
653Volume: float
653GetConnectedWires(pin: string): Instances
668GetInputPins(): Array
668GetOutputPins(): Array
668LoadAsync(): AssetFetchStatus
668Pause(): null
653Play(): null
653SetStudioPreview(isPreview: bool): null
668Unload(): null
661DidEnd()
661DidLoop()
668PlayFailed(error: AssetFetchStatus)
668WiringChanged(connected: bool, pin: string, wire: Wire, instance: Instance)
inherited from Instance
553Archivable: bool
670Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
670Sandboxed: bool
680UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
691GetPredictionMode(): PredictionMode
641GetStyled(name: string): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
690IsPredicted(): bool
664IsPropertyModified(property: string): bool
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
690SetPredictionMode(mode: PredictionMode): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Removed member index 7

HistoryMember
690Asset: ContentId
668AutoLoad: bool
668IsReady: bool
668Thumbnail: ContentId
668Stop(): null
661Ended()
661Looped()

Description

An instance for playing video assets. It can be connected to a VideoDisplay via a Wire to show the video and can be connected to audio instances via a Wire to play the audio track.

History 43

Members 24

AutoLoadInStudio

TypeDefault
boolfalse

By default, VideoContent does not load while in Studio Edit mode and shows no output when wired to VideoDisplay to reduce studio memory usage. Toggle this option to load VideoContent while in Studio Edit mode.

This property is not scriptable. It cannot be accessed by script code.
This property is not replicated. Its interface does not cross the network boundary.

History 2

Tags: [NotReplicated, NotScriptable]

AutoPlayInStudio

TypeDefault
boolfalse

Plays the VideoContent while in Studio Edit mode. AutoLoadInStudio must be on for this option to show.

This property is not scriptable. It cannot be accessed by script code.
This property is not replicated. Its interface does not cross the network boundary.

History 2

Tags: [NotReplicated, NotScriptable]

DidEnd

Parameters (0)
No parameters.

Fires after the VideoPlayer has completed playback and stopped. Note this event does not fire for videos with Looped set to true since it continues playing upon reaching its end. This event also does not fire when the video is stopped before playback has completed; for this, use VideoPlayer:GetPropertyChangedSignal() on the IsPlaying property.

History 1

DidLoop

Parameters (0)
No parameters.

Event that fires after the VideoPlayer loops. This happens when the video reaches the end of its content. This event does not fire if the video is looped manually by changing its TimePosition.

History 1

GetConnectedWires

Parameters (1)
pinstring
Returns (1)
Instances

Returns an array of Wires that are connected to the specified pin. VideoPlayer has one "Output" pin.

History 1

GetInputPins

Parameters (0)
No parameters.
Returns (1)
Array

History 1

GetOutputPins

Parameters (0)
No parameters.
Returns (1)
Array

History 1

IsLoaded

TypeDefault
boolfalse

This property is true when the VideoContent has loaded and is ready to play.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 1

Tags: [ReadOnly, NotReplicated]

IsPlaying

TypeDefault
boolfalse

Denotes whether this VideoPlayer is currently playing. This property is read-only, but replicates. To play and pause a VideoPlayer at runtime, use the Play() and Pause() methods.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 3

Tags: [ReadOnly, NotReplicated]

LoadAsync

Parameters (0)
No parameters.
Returns (1)
AssetFetchStatus

VideoContent is typically only loaded when Play() is called, causing some buffering delay. This function can preload VideoContent so that it can be immediately played when Play() is called. Loading videos can consume a significant amount of device memory.

This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

Looping

TypeDefault
boolfalse

Controls whether this VideoPlayer loops after reaching the end of its TimeLength.

History 1

Pause

Parameters (0)
No parameters.
Returns (1)
null

Pauses the VideoPlayer wherever its TimePosition is. Replicates from server to client.

History 1

Play

Parameters (0)
No parameters.
Returns (1)
null

Plays the VideoPlayer from wherever its TimePosition is. Replicates from server to client. To save resources and improve performance, call the Unload() method to unload the VideoContent when the VideoPlayer is not visible or in use.

History 1

PlayFailed

Parameters (1)
errorAssetFetchStatus

History 1

PlaybackSpeed

TypeDefault
float1

Multiplier that controls how quickly the video plays, directly controlling the perceived pitch of the audio track. Ranges from 0 to 1.

History 1

Resolution

TypeDefault
Vector20, 0

This property gets the original source resolution of the VideoContent file.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 1

Tags: [ReadOnly, NotReplicated]

SetStudioPreview

Parameters (1)
isPreviewbool
Returns (1)
null

History 1

TimeLength

TypeDefault
double0

This property indicates the length of the VideoContent in seconds. If the video is not loaded, this value is 0.

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 1

Tags: [ReadOnly, NotReplicated]

TimePosition

TypeDefault
double0

This property indicates the progress in seconds of the VideoContent. It can be changed to move the playback position of the video both before and during playback.

History 1

Unload

Parameters (0)
No parameters.
Returns (1)
null

Unloads the VideoContent to save resources. After calling this method, the IsLoaded property is false, and the TimePosition resets to 0. To play the video again, the LoadAsync() or Play() method must be called to reload the video.

History 1

VideoContent

TypeDefault
Content

The content ID of the video file a VideoPlayer object is associated with. To save resources and improve performance, call the Unload() method to unload the VideoContent when the VideoPlayer is not visible or in use.

History 1

Volume

TypeDefault
float1

Volume level, which is multiplied onto the output audio stream, controlling how loudly the audio track plays. Ranges from 0 to 3.

History 1

WiringChanged

Parameters (4)
connectedbool
pinstring
wireWire
instanceInstance

Event that fires after a Wire becomes connected or disconnected, and that Wire is now or was previously connected to a pin on the VideoPlayer and to some other wirable instance.

History 1

Removed members 7

Asset

TypeDefault
ContentId

History 2

AutoLoad

TypeDefault
boolfalse

History 2

Ended

Parameters (0)
No parameters.

History 2

IsReady

TypeDefault
boolfalse
This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 2

Tags: [ReadOnly, NotReplicated]

Looped

Parameters (0)
No parameters.

History 2

Stop

Parameters (0)
No parameters.
Returns (1)
null

History 2

Thumbnail

TypeDefault
ContentId

History 2

Settings