배우기
엔진 클래스
VideoPlayer
찾아볼 수 없음

*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.


코드 샘플
비디오 플레이어 (서버 측)
-- 이 스크립트는 "Legacy" 또는 "Server"로 설정된 RunContext에서 실행되어야 합니다.
-- 비디오가 표시되는 부분을 생성합니다.
local videoScreenPart = Instance.new("Part")
videoScreenPart.Anchored = true
videoScreenPart.Size = Vector3.new(12, 6, 1)
videoScreenPart.CFrame = CFrame.new(0, 5, 0)
videoScreenPart.Parent = workspace
local videoScreenUI = Instance.new("SurfaceGui")
videoScreenUI.Parent = videoScreenPart
local videoDisplay = Instance.new("VideoDisplay")
videoDisplay.Size = UDim2.new(1, 0, 1, 0)
videoDisplay.Parent = videoScreenUI
-- 비디오 자산이 원래 발생하는 위치를 생성합니다.
local videoSource = Instance.new("VideoPlayer")
videoSource.VideoContent = Content.fromUri("rbxassetid://5608359401")
videoSource.Looping = true
videoSource.Parent = videoScreenPart
-- 비디오의 오디오가 방출되는 위치를 생성합니다.
local speakerPart = Instance.new("Part")
speakerPart.Anchored = true
speakerPart.Parent = workspace
local audioEmitter = Instance.new("AudioEmitter")
audioEmitter.Parent = speakerPart
-- 비디오가 시각적으로 렌더링되고 오디오를 방출하도록 연결하는 전선을 생성합니다.
local videoWire = Instance.new("Wire")
videoWire.SourceInstance = videoSource
videoWire.TargetInstance = videoDisplay
videoWire.Parent = videoSource
local audioWire = Instance.new("Wire")
audioWire.SourceInstance = videoSource
audioWire.TargetInstance = audioEmitter
audioWire.Parent = videoSource
-- 비디오 재생
-- 참고: 서버에서 비디오를 재생한다고 해서 모든 클라이언트에 대해 로드되거나 동기화된다는 보장은 없습니다. 클라이언트에서 재생하는 것이 더 좋습니다.
videoSource:Play()
비디오 플레이어 (클라이언트 측)
-- 이 코드는 "LocalScript" 또는 "Script"에서 RunContext가 "Client"로 설정되어 있어야 합니다.
-- "비디오 재생" 섹션까지 위 샘플과 동일한 코드입니다.
-- 비디오가 로드된 후 재생합니다.
videoSource:GetPropertyChangedSignal("IsLoaded"):Connect(function()
if videoSource.IsLoaded then
print("비디오가 로드되었습니다. 2초 후 재생을 시작합니다.")
wait(2)
videoSource:Play()
end
end)
-- 필요할 때 준비할 수 있도록 비디오를 로드합니다.
videoSource:LoadAsync()
wait(5)
-- 자원 절약을 위해 비디오를 언로드합니다.
videoSource:Unload()

API 참조
속성
AutoLoadInStudio
복제되지 않음
스크립팅할 수 없음
Roblox 스크립트 보안
병렬 읽기
기능: Audio, UI
VideoPlayer.AutoLoadInStudio:boolean

AutoPlayInStudio
복제되지 않음
스크립팅할 수 없음
Roblox 스크립트 보안
병렬 읽기
기능: Audio, UI
VideoPlayer.AutoPlayInStudio:boolean

IsLoaded
읽기 전용
복제되지 않음
병렬 읽기
기능: Audio, UI
VideoPlayer.IsLoaded:boolean

IsPlaying
읽기 전용
복제되지 않음
병렬 읽기
기능: Audio, UI
VideoPlayer.IsPlaying:boolean

Looping
병렬 읽기
기능: Audio, UI
VideoPlayer.Looping:boolean

MaximumResolution
숨김
병렬 읽기
기능: Audio, UI, InternalTest
VideoPlayer.MaximumResolution:Enum.VideoSampleSize

PlaybackSpeed
병렬 읽기
기능: Audio, UI
VideoPlayer.PlaybackSpeed:number

Resolution
읽기 전용
복제되지 않음
병렬 읽기
기능: Audio, UI
VideoPlayer.Resolution:Vector2

TimeLength
읽기 전용
복제되지 않음
병렬 읽기
기능: Audio, UI
VideoPlayer.TimeLength:number

TimePosition
병렬 읽기
기능: Audio, UI
VideoPlayer.TimePosition:number

VideoContent
병렬 읽기
기능: Audio, UI
VideoPlayer.VideoContent:Content

Volume
병렬 읽기
기능: Audio, UI
VideoPlayer.Volume:number

메서드
GetConnectedWires
기능: Audio, UI
VideoPlayer:GetConnectedWires(pin:string):{Wire}
매개 변수
pin:string
반환

GetInputPins
기능: Audio, UI
VideoPlayer:GetInputPins():{any}
반환

GetOutputPins
기능: Audio, UI
VideoPlayer:GetOutputPins():{any}
반환

LoadAsync
생성
기능: Audio, UI
VideoPlayer:LoadAsync():Enum.AssetFetchStatus

Pause
기능: Audio, UI
VideoPlayer:Pause():()
반환
()

Play
기능: Audio, UI
VideoPlayer:Play():()
반환
()

Unload
기능: Audio, UI
VideoPlayer:Unload():()
반환
()

이벤트
DidEnd
기능: Audio, UI
VideoPlayer.DidEnd():RBXScriptSignal

DidLoop
기능: Audio, UI
VideoPlayer.DidLoop():RBXScriptSignal

PlayFailed
기능: Audio, UI
VideoPlayer.PlayFailed(error:Enum.AssetFetchStatus):RBXScriptSignal
매개 변수

WiringChanged
기능: Audio, UI
VideoPlayer.WiringChanged(
connected:boolean, pin:string, wire:Wire, instance:Instance
매개 변수
connected:boolean
pin:string
wire:Wire
instance:Instance

©2026 Roblox Corporation. Roblox 및 Roblox 로고, 'Powering Imagination'은 미국 및 기타 국가 내 당사의 등록 및 미등록 상표입니다.