Skip to content

Class · inherits Instance

VideoPlayer

Official docs ↗

Used to play video assets.

About VideoPlayer

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.

Properties 12

  • AutoLoadInStudio: booleanNotReplicatedNotScriptableLoads the VideoContent while in Studio Edit mode.

    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.

  • AutoPlayInStudio: booleanNotReplicatedNotScriptablePlays the VideoContent while in Studio Edit mode.

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

  • IsLoaded: booleanReadOnlyNotReplicatedIndicates when the VideoContent has loaded and is ready to play.

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

  • IsPlaying: booleanReadOnlyNotReplicatedDenotes whether this VideoPlayer is currently playing.

    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.

  • Looping: booleanControls whether this VideoPlayer loops.

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

  • MaximumResolution: VideoSampleSizeHiddenCaps the resolution of decoded video frames for this VideoPlayer.

    The maximum resolution, as an VideoSampleSize value, that the video decoder produces when playing this VideoPlayer. Defaults to VideoSampleSize.Full, which doesn't limit the decoded resolution. Lower VideoSampleSize values reduce the resolution the decoder outputs, which can lower memory usage on constrained devices.

  • PlaybackSpeed: floatControls the speed at which the video is played.

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

  • Resolution: Vector2ReadOnlyNotReplicatedGets the original source resolution of the VideoContent file.

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

  • TimeLength: doubleReadOnlyNotReplicatedIndicates the length of the VideoContent in seconds.

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

  • TimePosition: doubleIndicates the progress in seconds of the VideoContent.

    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.

  • VideoContent: ContentThe asset to be loaded into the VideoPlayer.

    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.

  • Volume: floatControls how loudly the audio track will be played.

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

Methods 7

Events 4

  • DidEndVideoPlayer.DidEnd:Connect(function())Fires when the VideoContent has completed playback and stopped.

    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.

  • DidLoopVideoPlayer.DidLoop:Connect(function())Fires when the VideoContent loops.

    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.

  • PlayFailedVideoPlayer.PlayFailed:Connect(function(error))Fires when the VideoPlayer fails to load or play its VideoContent.

    Fires when the VideoPlayer fails to load or play its VideoContent. The error parameter is an AssetFetchStatus value that describes why the content couldn't be fetched.

  • WiringChangedVideoPlayer.WiringChanged:Connect(function(connected, pin, wire, instance))Fires when another instance is connected to or disconnected from the VideoPlayer via a Wire.

    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.

VideoPlayer also has every member of Instance. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.