Class · inherits GuiObject
VideoFrame
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 theVideoFrame.Videohas loaded from Roblox servers and is ready to play.This property will be true when the
VideoFrame.Videohas loaded from Roblox servers and is ready to play.Looped
: booleanSets whether or not theVideoFrame.Videorepeats once it has finished when it is playing.This property sets whether or not the
VideoFrame.Videorepeats once it has finished when it is playing.MaximumResolution
: VideoSampleSizeHiddenInternal-only. Caps the resolution the video is allowed to stream at, expressed as anVideoSampleSize.Internal-only. Caps the resolution the video is allowed to stream at, as an
VideoSampleSizerather than exact pixel dimensions.The video may still stream below the cap on a slow connection. Defaults to
VideoSampleSize.Full.Playing
: booleanNotReplicatedIndicates whether theVideoFrame.Videois currently playing. It can be set to start or pause playback.This property indicates whether the
VideoFrame.Videois currently playing. It can be set to start or pause playback as an alternative to theVideoFrame.PlayandVideoFrame.Pausefunctions.Resolution
: Vector2ReadOnlyNotReplicatedGets the original source resolution of theVideoFrame.Videofile.This property gets the original source resolution of the
VideoFrame.Videofile.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 to10000.This property only affects playback when the
VideoFrameis 3D, as described in the class's "2D and 3D Sound" section; it has no effect on a globalVideoFrame. HowRollOffMaxDistanceaffects the attenuation of the sound depends on theRollOffModeproperty.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 to1.This property only affects playback when the
VideoFrameis 3D, as described in the class's "2D and 3D Sound" section; it has no effect on a globalVideoFrame. HowRollOffMinDistanceaffects the attenuation of the sound depends on theRollOffModeproperty.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 toRollOffMode.Inverse.This property only affects playback when the
VideoFrameis 3D, as described in the class's "2D and 3D Sound" section; it has no effect on a globalVideoFrame. For details on the different modes, seeRollOffMode.TimeLength
: doubleReadOnlyNotReplicatedIndicates the length of theVideoFrame.Videoin seconds.This property indicates the length of the
VideoFrame.Videoin seconds. If the video is not loaded, this value will be 0.TimePosition
: doubleNotReplicatedIndicates the progress in seconds of theVideoFrame.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 aVideoFrameobject is associated with.The content ID of the video file a
VideoFrameobject is associated with. To save resources and improve performance, set this property to""when theVideoFrameis not visible or in use.VideoContent
: ContentThe video content aVideoFrameis associated with, as either an asset content ID (same value asVideo) or a direct reference to aVideoCaptureobject for local screen recordings.The video content a
VideoFrameobject is associated with. Setting this property is equivalent to settingVideo, and reading it returns a content ID equal toVideo.When referencing a video by content ID, build the value with the corresponding
Contentconstructor:Content.fromAssetIdfor a numeric asset ID, orContent.fromUrifor anrbxassetid://URI.Unlike
Video, which only accepts a content ID string,VideoContentcan also hold a direct reference to aVideoCaptureobject, such as one retrieved throughCaptureService.ReadCapturesFromGalleryAsync. This lets a local screen recording play back on theVideoFramewithout first uploading it to Roblox. Build the value withContent.fromObject, for examplevideoFrame.VideoContent = Content.fromObject(capture).Volume
: floatIndicates how loud theVideoFrame.Videois currently playing back.This property determines how loud the
VideoFrame.Videoplays back. It can be set to a number between 0 and 100.
Methods 2
Pause
() → ()SetsVideoFrame.Playingtofalse, pausing playback if theVideoFrame.Videois playing.Sets
VideoFrame.Playingtofalse, pausing playback if theVideoFrame.Videois playing.As
VideoFrame.TimePositionis not reset, when the video is resumed it will continue from its previous position.Play
() → ()SetsVideoFrame.Playingtotrue, playing theVideoFrame.Videofrom the currentVideoFrame.TimePosition.Sets
VideoFrame.Playingtotrue, playing theVideoFrame.Videofrom the currentVideoFrame.TimePosition. To save resources and improve performance, set theVideoFrame.Videoproperty to""when theVideoFrameis not visible or in use.
Events 5
DidLoop
VideoFrame.DidLoop:Connect(function(video))Fires whenever theVideoFrame.Videoloops.An event that fires whenever the
VideoFrame.Videoloops. Returns the content ID of the video.Ended
VideoFrame.Ended:Connect(function(video))Fires when theVideoFrame.Videohas completed playback and stopped.This event fires when the
VideoFrame.Videohas completed playback and stopped.Loaded
VideoFrame.Loaded:Connect(function(video))Fires when theVideoFrame.Videois loaded.This event fires when the
VideoFrame.Videois loaded.Paused
VideoFrame.Paused:Connect(function(video))This event fires whenever theVideoFrame.Videois paused usingVideoFrame.Pauseor by settingVideoFrame.Playingto false.Played
VideoFrame.Played:Connect(function(video))Fires whenever theVideoFrame.Videois played using theVideoFrame.Playfunction or by settingVideoFrame.Playingto true.This event fires whenever the
VideoFrame.Videois played using theVideoFrame.Playfunction or by settingVideoFrame.Playingto true.
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.