3.6 KiB
| title | description |
|---|---|
| Video frames | Video assets used on VideoFrame instances allow for video playback in experiences. |
import BetaAlert from '../includes/beta-features/beta-alert.md'
Video assets used in Class.VideoFrame instances allow for video playback in experiences. You can upload videos that you're certain you have permission to use, such as videos you make yourself, and the asset privacy system automatically ensures that the IDs of your uploaded videos can't be accessed by users without the proper permissions.
Upload videos
If you're a 13+ ID verified user, you can upload videos through the Asset Manager, the Creator Dashboard, or the Open Cloud API. You can upload a video as long as it meets the following requirements:
- You have the legal rights to use the video asset.
- It adheres to the Roblox Community Standards and Terms of Use.
- It's 5 minutes or less in either
.mp4or.movformat. - Its resolution is less than or equal to 4096×2160.
- It's less than 3.75 GB.
Videos that don't meet these requirements are rejected. Alpha channels are not supported and will be ignored. When uploading videos, consider the following:
- Each video upload costs 2,000 Robux.
- You can upload a maximum of 20 videos a day.
Play videos
A Class.VideoFrame must be parented to a Class.ScreenGui, Class.SurfaceGui, or Class.BillboardGui in order to be playable. Currently, a maximum of two videos can play simultaneously.
To play a video in your experience without code:
-
Create a
Class.ScreenGuias outlined in On-Screen UI Containers, or aClass.SurfaceGuiorClass.BillboardGuias outlined in In-Experience UI Containers. -
Insert a video from the Toolbox or Asset Manager. A new
Class.VideoFrameobject is inserted for the video. -
Parent the
Class.VideoFrameto the container.
-
With the new
Class.VideoFrameselected, enable its Looped and Playing properties in the Properties window.
If you want to play a video in your experience with code, paste the following code into a Class.Script within Class.ServerScriptService to create a Class.Part and play the video on its front surface.
local Workspace = game:GetService("Workspace")
local screenPart = Instance.new("Part")
screenPart.Size = Vector3.new(16, 9, 1)
screenPart.Position = Vector3.new(0, 8, -20)
screenPart.Orientation = Vector3.new(0, 180, 0)
screenPart.Anchored = true
screenPart.Parent = Workspace
local surfaceGui = Instance.new("SurfaceGui")
surfaceGui.Parent = screenPart
local videoFrame = Instance.new("VideoFrame")
videoFrame.Size = UDim2.new(1, 0, 1, 0)
videoFrame.Parent = surfaceGui
videoFrame.Looped = true
videoFrame.Video = "rbxassetid://5608384572" -- Replace with your video's asset ID
while not videoFrame.IsLoaded do
videoFrame.Loaded:Wait()
end
videoFrame:Play()