VideoFrame

사용되지 않는 항목 표시

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

비디오프레임은 이동하는 비디오 이미지로 Frame와 같은 직사각형을 렌더링합니다. 비디오는 Roblox 웹사이트에 업로드된 파일에서 나와야 합니다.

비디오는 직사각형의 전체에 맞게 크기가 조정되지만, 원래 해상도에서 표시되면 가장 좋습니다.

2D 및 3D 음향

비디오프레임이 아래에 배치되면 SurfaceGui 에서 해당 부분의 소리가 방출됩니다.A VideoFrame placed underneath on a BasePart will emit its sound from that part's BasePart.Position .

비디오프레임은 도플러 효과를 보여주며, 즉 그 주파수와 피치는 부착된 부품의 상대적 이동에 따라 변합니다.

비디오프레임의 볼륨은 클라이언트의 사운드 리스너(기본적으로 Camera 위치)와 비디오프레임의 부분 위치 사이의 거리에 의해 결정됩니다.

비디오프레임은 기본 파트의 SurfaceGui 아래에 배치되지 않으면 "전체" 로 간주됩니다.이 경우 소리는 전체 플레이스동일한 볼륨으로 재생됩니다.

코드 샘플

The code sample below demonstrates how to create and play a VideoFrame with SomeValidAssetID once the video has loaded.

Creating and Playing a Video

local screenPart = Instance.new("Part")
screenPart.Parent = workspace
local surfaceGui = Instance.new("SurfaceGui")
surfaceGui.Parent = screenPart
local videoFrame = Instance.new("VideoFrame")
videoFrame.Parent = surfaceGui
videoFrame.Looped = true
videoFrame.Video = "rbxassetid://" -- add an asset ID to this
while not videoFrame.IsLoaded do
task.wait()
end
videoFrame:Play()

요약

속성

속성GuiObject에서 상속되었습니다속성GuiBase2d에서 상속되었습니다

메서드

메서드GuiObject에서 상속되었습니다

이벤트

이벤트GuiObject에서 상속되었습니다이벤트GuiBase2d에서 상속되었습니다

속성

IsLoaded

읽기 전용
복제되지 않음
병렬 읽기

이 속성은 Roblox 서버에서 VideoFrame.Video 를 로드하고 플레이할 준비가 되었을 때 true가 됩니다.

Looped

병렬 읽기

이 속성은 플레이할 때 한 번 반복되는지 여부를 VideoFrame.Video 설정합니다.

Playing

복제되지 않음
병렬 읽기

이 속성은 현재 VideoFrame.Video가 재생 중인지 여부를 나타냅니다.재생을 VideoFrame:Play()VideoFrame:Pause() 함수로 대체하여 시작하거나 일시 중지할 수 있습니다.

Resolution

읽기 전용
복제되지 않음
병렬 읽기

이 속성은 VideoFrame.Video 파일의 원래 해상도를 가져옵니다.

TimeLength

읽기 전용
복제되지 않음
병렬 읽기

이 속성은 비디오가 로드되지 않은 경우 초당 VideoFrame.Video의 길이를 나타냅니다.

TimePosition

복제되지 않음
병렬 읽기

이 속성은 VideoFrame.Video의 초 단위 진행률을 나타냅니다.재생 위치를 바꿔 비디오의 재생 전과 재생 중에 재생 위치를 이동할 수 있습니다.

Video

ContentId
병렬 읽기

비디오 파일의 콘텐츠 ID가 연결된 VideoFrame 개체입니다.

코드 샘플

The code sample below demonstrates how to create and play a VideoFrame with SomeValidAssetID once the video has loaded.

Creating and Playing a Video

local screenPart = Instance.new("Part")
screenPart.Parent = workspace
local surfaceGui = Instance.new("SurfaceGui")
surfaceGui.Parent = screenPart
local videoFrame = Instance.new("VideoFrame")
videoFrame.Parent = surfaceGui
videoFrame.Looped = true
videoFrame.Video = "rbxassetid://" -- add an asset ID to this
while not videoFrame.IsLoaded do
task.wait()
end
videoFrame:Play()

Volume

병렬 읽기

이 속성은 뒤로중인 VideoFrame.Video의 볼륨을 결정합니다. 0과 100 사이의 숫자로 설정할 수 있습니다.

메서드

Pause

()

를 false로 설정하여 재생 중인 를 일시 중지하고 재생 중인 경우 재생을 일시 중지합니다.

As VideoFrame.TimePosition 는 재설정되지 않으므로, 비디오가 재개되면 이전 위치에서 계속됩니다.


반환

()

Play

()

설정 을 true로 설정, 이는 현재 에서 계속해서 재생됩니다.


반환

()

코드 샘플

The code sample below demonstrates how to create and play a VideoFrame with SomeValidAssetID once the video has loaded.

Creating and Playing a Video

local screenPart = Instance.new("Part")
screenPart.Parent = workspace
local surfaceGui = Instance.new("SurfaceGui")
surfaceGui.Parent = screenPart
local videoFrame = Instance.new("VideoFrame")
videoFrame.Parent = surfaceGui
videoFrame.Looped = true
videoFrame.Video = "rbxassetid://" -- add an asset ID to this
while not videoFrame.IsLoaded do
task.wait()
end
videoFrame:Play()

이벤트

DidLoop

VideoFrame.Video 루프가 발생할 때마다 발생하는 이벤트. 비디오의 콘텐츠 ID를 반환합니다.

매개 변수

video: string

루프된 비디오의 콘텐츠 ID.


Ended

이 이벤트는 VideoFrame.Video가 재생을 완료하고 중지했을 때 발생합니다.

매개 변수

video: string

일시 중지된 것이 끝난 콘텐츠 ID.


Loaded

이 이벤트는 VideoFrame.Video가 로드될 때 발생합니다.

매개 변수

video: string

로드된 비디오의 콘텐츠 ID.


Paused

이 이벤트는 중지되는 경우 VideoFrame.Video 또는 VideoFrame:Pause() 를 사용하여 일시 중지되거나 VideoFrame.Playing 를 false로 설정하여 언제든 발생합니다.

매개 변수

video: string

일시 중지된 비디오의 콘텐츠 ID.


Played

이 이벤트는 함수를 사용하여 재생될 때마다 또는 를 true로 설정하여 언제든지 발생합니다.

매개 변수

video: string

재생된 비디오의 콘텐츠 ID.