VideoPlayer
Used to play video assets.
Memory category | Instances |
---|
Member index 24
Removed member index 7
History | Member | |
---|---|---|
690 | Asset: ContentId | |
668 | AutoLoad: bool | |
668 | IsReady: bool | |
668 | Thumbnail: ContentId | |
668 | Stop(): null | |
661 | Ended() | |
661 | Looped() |
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
- 690 Add
- 690 Change Category of AutoPlayInStudio from AutoPlayInEditMode to Debug
- 690 Change Category of AutoLoadInStudio from AutoPlayInEditMode to Debug
- 690 Remove Asset
- 687 Add VideoContent
- 668 Add WiringChanged
- 668 Add PlayFailed
- 668 Add Unload
- 668 Remove Stop
- 668 Add Pause
- 668 Add LoadAsync
- 668 Add GetOutputPins
- 668 Add GetInputPins
- 668 Remove Thumbnail
- 668 Remove IsReady
- 668 Change Tags of IsPlaying from [] to [ReadOnly, NotReplicated]
- 668 Change WriteSecurity of IsPlaying from RobloxSecurity to None
- 668 Add IsLoaded
- 668 Add AutoPlayInStudio
- 668 Add AutoLoadInStudio
- 668 Remove AutoLoad
- 661 Remove Looped
- 661 Remove Ended
- 661 Add DidLoop
- 661 Add DidEnd
- 653 Add Looped
- 653 Add Ended
- 653 Add Stop
- 653 Add SetStudioPreview
- 653 Add Play
- 653 Add GetConnectedWires
- 653 Add Volume
- 653 Add TimePosition
- 653 Add TimeLength
- 653 Add Thumbnail
- 653 Add Resolution
- 653 Add PlaybackSpeed
- 653 Add Looping
- 653 Add IsReady
- 653 Add IsPlaying
- 653 Add AutoLoad
- 653 Add Asset
- 653 Add VideoPlayer
Members 24
AutoLoadInStudio
Type | Default | |
---|---|---|
bool | false |
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.
Write security | RobloxScriptSecurity |
---|---|
Thread safety | ReadSafe |
Category | Debug |
Loaded/Saved | false |
History 2
- 690 Change Category of AutoLoadInStudio from AutoPlayInEditMode to Debug
- 668 Add AutoLoadInStudio
AutoPlayInStudio
Type | Default | |
---|---|---|
bool | false |
Plays the VideoContent while in Studio Edit mode. AutoLoadInStudio must be on for this option to show.
Write security | RobloxScriptSecurity |
---|---|
Thread safety | ReadSafe |
Category | Debug |
Loaded/Saved | false |
History 2
- 690 Change Category of AutoPlayInStudio from AutoPlayInEditMode to Debug
- 668 Add AutoPlayInStudio
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.
Thread safety | Unsafe |
---|
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.
Thread safety | Unsafe |
---|
GetConnectedWires
Parameters (1) | ||
---|---|---|
pin | string | |
Returns (1) | ||
Instances |
Returns an array of Wires that are connected to the specified pin. VideoPlayer has one "Output" pin.
Thread safety | Unsafe |
---|
History 1
- 653 Add GetConnectedWires
GetInputPins
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Array |
Thread safety | Unsafe |
---|
History 1
- 668 Add GetInputPins
GetOutputPins
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Array |
Thread safety | Unsafe |
---|
History 1
- 668 Add GetOutputPins
IsLoaded
Type | Default | |
---|---|---|
bool | false |
This property is true when the VideoContent has loaded and is ready to play.
Thread safety | ReadSafe |
---|---|
Category | Asset |
Loaded/Saved | false |
IsPlaying
Type | Default | |
---|---|---|
bool | false |
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.
Thread safety | ReadSafe |
---|---|
Category | Playback |
Loaded/Saved | false |
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.
Thread safety | Unsafe |
---|
Looping
Type | Default | |
---|---|---|
bool | false |
Controls whether this VideoPlayer loops after reaching the end of its TimeLength.
Thread safety | ReadSafe |
---|---|
Category | Playback |
Loaded/Saved | true |
Pause
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
null |
Pauses the VideoPlayer wherever its TimePosition is. Replicates from server to client.
Thread safety | Unsafe |
---|
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.
Thread safety | Unsafe |
---|
PlayFailed
Parameters (1) | |
---|---|
error | AssetFetchStatus |
Thread safety | Unsafe |
---|
History 1
- 668 Add PlayFailed
PlaybackSpeed
Type | Default | |
---|---|---|
float | 1 |
Multiplier that controls how quickly the video plays, directly controlling the perceived pitch of the audio track. Ranges from 0 to 1.
Thread safety | ReadSafe |
---|---|
Category | Playback |
Loaded/Saved | true |
History 1
- 653 Add PlaybackSpeed
Resolution
Type | Default | |
---|---|---|
Vector2 | 0, 0 |
This property gets the original source resolution of the VideoContent file.
Thread safety | ReadSafe |
---|---|
Category | Asset |
Loaded/Saved | false |
History 1
- 653 Add Resolution
SetStudioPreview
Parameters (1) | ||
---|---|---|
isPreview | bool | |
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 653 Add SetStudioPreview
TimeLength
Type | Default | |
---|---|---|
double | 0 |
This property indicates the length of the VideoContent in seconds. If the video is not loaded, this value is 0.
Thread safety | ReadSafe |
---|---|
Category | Asset |
Loaded/Saved | false |
History 1
- 653 Add TimeLength
TimePosition
Type | Default | |
---|---|---|
double | 0 |
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.
Thread safety | ReadSafe |
---|---|
Category | Playback |
Loaded/Saved | true |
History 1
- 653 Add TimePosition
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.
Thread safety | Unsafe |
---|
VideoContent
Type | Default | |
---|---|---|
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.
Thread safety | ReadSafe |
---|---|
Category | Asset |
Loaded/Saved | true |
History 1
- 687 Add VideoContent
Volume
Type | Default | |
---|---|---|
float | 1 |
Volume level, which is multiplied onto the output audio stream, controlling how loudly the audio track plays. Ranges from 0 to 3.
Thread safety | ReadSafe |
---|---|
Category | State |
Loaded/Saved | true |
WiringChanged
Parameters (4) | |
---|---|
connected | bool |
pin | string |
wire | Wire |
instance | Instance |
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.
Thread safety | Unsafe |
---|
History 1
- 668 Add WiringChanged
Removed members 7
Asset
Type | Default | |
---|---|---|
ContentId |
Thread safety | ReadSafe |
---|---|
Category | Asset |
Loaded/Saved | true |
AutoLoad
Type | Default | |
---|---|---|
bool | false |
Thread safety | ReadSafe |
---|---|
Category | Asset |
Loaded/Saved | true |
Ended
Parameters (0) | ||
---|---|---|
No parameters. |
Thread safety | Unsafe |
---|
IsReady
Type | Default | |
---|---|---|
bool | false |
Thread safety | ReadSafe |
---|---|
Category | Asset |
Loaded/Saved | false |
Looped
Parameters (0) | ||
---|---|---|
No parameters. |
Thread safety | Unsafe |
---|
Stop
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
null |
Thread safety | Unsafe |
---|
Thumbnail
Type | Default | |
---|---|---|
ContentId |
Thread safety | ReadSafe |
---|---|
Category | Asset |
Loaded/Saved | true |