Skip to content

Class · inherits GuiObject

VideoFrame

Official docs ↗

A GUI object that renders a rectangle, like a Frame does, with a moving video image.

About VideoFrame

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.

Properties 13

  • IsLoaded: booleanReadOnlyNotReplicatedIndicates when the VideoFrame.Video has loaded from Roblox servers and is ready to play.

    This property will be true when the VideoFrame.Video has loaded from Roblox servers and is ready to play.

  • Looped: booleanSets whether or not the VideoFrame.Video repeats once it has finished when it is playing.

    This property sets whether or not the VideoFrame.Video repeats once it has finished when it is playing.

  • MaximumResolution: VideoSampleSizeHiddenInternal-only. Caps the resolution the video is allowed to stream at, expressed as an VideoSampleSize.

    Internal-only. Caps the resolution the video is allowed to stream at, as an VideoSampleSize rather than exact pixel dimensions.

    The video may still stream below the cap on a slow connection. Defaults to VideoSampleSize.Full.

  • Playing: booleanNotReplicatedIndicates whether the VideoFrame.Video is currently playing. It can be set to start or pause playback.

    This property indicates whether the VideoFrame.Video is currently playing. It can be set to start or pause playback as an alternative to the VideoFrame.Play and VideoFrame.Pause functions.

  • Resolution: Vector2ReadOnlyNotReplicatedGets the original source resolution of the VideoFrame.Video file.

    This property gets the original source resolution of the VideoFrame.Video file.

  • RollOffMaxDistance: floatThe maximum distance, in studs, a listener can be from the video's part and still hear its audio.

    The maximum distance, in studs, a client's listener can be from the VideoFrame's part and still hear its audio. Defaults to 10000.

    This property only affects playback when the VideoFrame is 3D, as described in the class's "2D and 3D Sound" section; it has no effect on a global VideoFrame. How RollOffMaxDistance affects the attenuation of the sound depends on the RollOffMode property.

  • RollOffMinDistance: floatThe minimum distance, in studs, at which the video's audio starts to attenuate.

    The minimum distance, in studs, at which the VideoFrame's audio begins to attenuate (decrease in volume). Defaults to 1.

    This property only affects playback when the VideoFrame is 3D, as described in the class's "2D and 3D Sound" section; it has no effect on a global VideoFrame. How RollOffMinDistance affects the attenuation of the sound depends on the RollOffMode property.

  • RollOffMode: RollOffModeControls how the video's audio volume attenuates with distance.

    Controls how the volume of the VideoFrame's audio attenuates (fades out) as the distance between the listener and the video's part changes. Defaults to RollOffMode.Inverse.

    This property only affects playback when the VideoFrame is 3D, as described in the class's "2D and 3D Sound" section; it has no effect on a global VideoFrame. For details on the different modes, see RollOffMode.

  • TimeLength: doubleReadOnlyNotReplicatedIndicates the length of the VideoFrame.Video in seconds.

    This property indicates the length of the VideoFrame.Video in seconds. If the video is not loaded, this value will be 0.

  • TimePosition: doubleNotReplicatedIndicates the progress in seconds of the VideoFrame.Video.

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

  • Video: ContentIdThe content ID of the video file a VideoFrame object is associated with.

    The content ID of the video file a VideoFrame object is associated with. To save resources and improve performance, set this property to "" when the VideoFrame is not visible or in use.

  • VideoContent: ContentThe video content a VideoFrame is associated with, as either an asset content ID (same value as Video) or a direct reference to a VideoCapture object for local screen recordings.

    The video content a VideoFrame object is associated with. Setting this property is equivalent to setting Video, and reading it returns a content ID equal to Video.

    When referencing a video by content ID, build the value with the corresponding Content constructor: Content.fromAssetId for a numeric asset ID, or Content.fromUri for an rbxassetid:// URI.

    Unlike Video, which only accepts a content ID string, VideoContent can also hold a direct reference to a VideoCapture object, such as one retrieved through CaptureService.ReadCapturesFromGalleryAsync. This lets a local screen recording play back on the VideoFrame without first uploading it to Roblox. Build the value with Content.fromObject, for example videoFrame.VideoContent = Content.fromObject(capture).

  • Volume: floatIndicates how loud the VideoFrame.Video is currently playing back.

    This property determines how loud the VideoFrame.Video plays back. It can be set to a number between 0 and 100.

Methods 2

Events 5

VideoFrame also has every member of GuiObject. 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.