Class
VideoFrame
A GUI object that renders a rectangle, like a Frame does, with a
moving video image.
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#
IsLoadedboolean | Indicates when the VideoFrame.Video has loaded from Roblox servers
and is ready to play.ReadSafeReadOnlyNotReplicated |
Loopedboolean | Sets whether or not the VideoFrame.Video repeats once it has
finished when it is playing.ReadSafe |
MaximumResolutionVideoSampleSize | Internal-only. Caps the resolution the video is allowed to stream at,
expressed as an VideoSampleSize.ReadSafeHidden |
Playingboolean | Indicates whether the VideoFrame.Video is currently playing. It
can be set to start or pause playback.ReadSafeNotReplicated |
ResolutionVector2 | Gets the original source resolution of the VideoFrame.Video file.ReadSafeReadOnlyNotReplicated |
RollOffMaxDistancefloat | The maximum distance, in studs, a listener can be from the video's part and still hear its audio.ReadSafe |
RollOffMinDistancefloat | The minimum distance, in studs, at which the video's audio starts to attenuate.ReadSafe |
RollOffModeRollOffMode | Controls how the video's audio volume attenuates with distance.ReadSafe |
TimeLengthdouble | Indicates the length of the VideoFrame.Video in seconds.ReadSafeReadOnlyNotReplicated |
TimePositiondouble | Indicates the progress in seconds of the VideoFrame.Video.ReadSafeNotReplicated |
VideoContentId | The content ID of the video file a VideoFrame object is associated
with.ReadSafe |
VideoContentContent | The 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.ReadSafe |
Volumefloat | Indicates how loud the VideoFrame.Video is currently playing back.ReadSafe |
IsLoaded: boolean#
ReadOnlyNotReplicatedReadSafe
This property will be true when the VideoFrame.Video has loaded
from Roblox servers and is ready to play.
Looped: boolean#
ReadSafe
This property sets whether or not the VideoFrame.Video repeats
once it has finished when it is playing.
MaximumResolution: VideoSampleSize#
HiddenReadSafe
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: boolean#
NotReplicatedReadSafe
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: Vector2#
ReadOnlyNotReplicatedReadSafe
This property gets the original source resolution of the
VideoFrame.Video file.
RollOffMaxDistance: float#
ReadSafe
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: float#
ReadSafe
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: RollOffMode#
ReadSafe
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: double#
ReadOnlyNotReplicatedReadSafe
This property indicates the length of the VideoFrame.Video in
seconds. If the video is not loaded, this value will be 0.
TimePosition: double#
NotReplicatedReadSafe
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: ContentId#
ReadSafe
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: Content#
ReadSafe
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: float#
ReadSafe
This property determines how loud the VideoFrame.Video plays back.
It can be set to a number between 0 and 100.
Methods 2#
| Pause | Sets VideoFrame.Playing to false, pausing playback if the
VideoFrame.Video is playing. |
| Play | Sets VideoFrame.Playing to true, playing the
VideoFrame.Video from the current VideoFrame.TimePosition. |
Pause(): ()#
Sets VideoFrame.Playing to false, pausing playback if the
VideoFrame.Video is playing.
As VideoFrame.TimePosition is not reset, when the video is resumed
it will continue from its previous position.
Returns
()
Play(): ()#
Sets VideoFrame.Playing to true, playing the
VideoFrame.Video from the current VideoFrame.TimePosition.
To save resources and improve performance, set the
VideoFrame.Video property to "" when the VideoFrame is
not visible or in use.
Returns
()
Events 5#
| DidLoop | Fires whenever the VideoFrame.Video loops. |
| Ended | Fires when the VideoFrame.Video has completed playback and
stopped. |
| Loaded | Fires when the VideoFrame.Video is loaded. |
| Paused | This event fires whenever the VideoFrame.Video is paused using
VideoFrame:Pause() or by setting VideoFrame.Playing to
false. |
| Played | Fires whenever the VideoFrame.Video is played using the
VideoFrame:Play() function or by setting
VideoFrame.Playing to true. |
DidLoop(video: string)#
An event that fires whenever the VideoFrame.Video loops. Returns
the content ID of the video.
| Name | Type | Default | Description |
|---|---|---|---|
video | string | The content ID of the video that looped. |
Ended(video: string)#
This event fires when the VideoFrame.Video has completed playback
and stopped.
| Name | Type | Default | Description |
|---|---|---|---|
video | string | The content ID of the paused that ended. |
Loaded(video: string)#
This event fires when the VideoFrame.Video is loaded.
| Name | Type | Default | Description |
|---|---|---|---|
video | string | The content ID of the loaded video. |
Paused(video: string)#
This event fires whenever the VideoFrame.Video is paused using
VideoFrame:Pause() or by setting VideoFrame.Playing to
false.
| Name | Type | Default | Description |
|---|---|---|---|
video | string | The content ID of the paused video. |
Played(video: string)#
This event fires whenever the VideoFrame.Video is played using the
VideoFrame:Play() function or by setting
VideoFrame.Playing to true.
| Name | Type | Default | Description |
|---|---|---|---|
video | string | The content ID of the played video. |
Inherited members#
Inherited from GuiObject 51
Properties (30)
Active, AnchorPoint, AutomaticSize, BackgroundColor, BackgroundColor3, BackgroundTransparency, BorderColor, BorderColor3, BorderMode, BorderSizePixel, ClipsDescendants, Draggable, GuiState, InputSink, Interactable, LayoutOrder, NextSelectionDown, NextSelectionLeft, NextSelectionRight, NextSelectionUp, Position, Rotation, Selectable, SelectionImageObject, SelectionOrder, Size, SizeConstraint, Transparency, Visible, ZIndex
Methods (3)
Inherited from GuiBase2d 12
Properties (11)
AbsolutePosition, AbsoluteRotation, AbsoluteSize, AutoLocalize, Localize, RootLocalizationTable, SelectionBehaviorDown, SelectionBehaviorLeft, SelectionBehaviorRight, SelectionBehaviorUp, SelectionGroup
Events (1)
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild