Version: 2023.1
언어: 한국어
WebGL의 오디오
Texture compression in WebGL

Video playback in WebGL

Unity WebGL supports video playback using the VideoPlayer API. This page provides information only about the video playback capabilities that WebGL supports. To learn how to use video with your Unity application, refer to the Video Player.

Video Player

You can use the Video Player component to control how to time video playback relative to other interactive behaviors in WebGL. For more information, refer to the Clock management with the Video Player component.

유일한 예외는 다음과 같습니다.

  • WebGL doesn’t support frame accuracy.
  • VideoPlayer 컴포넌트가 captureFramerate와의 동기식 재생을 지원하지 않습니다. 기본적으로 게임 시간 업데이트 모드에 설명된 일반 비동기 재생을 사용합니다.

지원되는 동영상 재생 기능 및 포맷

Unity WebGL supports the following video playback audio output modes:

클래스 용도
VideoAudioOutputMode.None 포함된 오디오를 비활성화합니다.
VideoAudioOutputMode.Direct 포함된 오디오를 플랫폼의 오디오 하드웨어에 바로 전송합니다.
VideoAudioOutputMode.AudioSource 포함된 오디오를 특정 AudioSource에 전송합니다. 출력 모드를 VideoAudioOutputMode.AudioSource로 설정하면 Unity는 mute를 제외한 모든 AudioSource 필드를 무시합니다. 동영상 재생의 3D 공간화를 웹에서 사용할 수 없기 때문입니다.

비디오(Video) 포맷

Unity는 다음과 같은 일반적인 동영상 파일 포맷을 지원합니다.

포맷 확장명
MPEG–4 Part 14 .mp4
Apple iTunes 스토어에서 다운로드하는 동영상에 사용되는 MPEG–4 파일 .m4v
Apple QuickTime 영화 포맷 .mov
MPEG(Moving Picture Experts Group) .mpg
MPEG 동영상 .mpeg
WebM 동영상 .webm
Ogg 동영상 파일 .ogv

이 제한의 유일한 예외는 동영상 URL에 파일 이름 확장자가 없는 경우이며, 이 경우 브라우저는 제한 없이 동영상을 재생합니다.

동영상 클립

VideoClips aren’t supported on WebGL. Typically, when creating a scene, you import a VideoClip to your Unity project using VideoClipImporter, which is convenient if you want to reuse the same VideoClip across several platforms. When building a WebGL game that has VideoClip attached however, the Unity console logs the following warning for each VideoClip found in the game:

Embedded video clips are not supported by the WebGL player: %s. \nUse the Video Player component's URL option instead. Where %s is replaced by the video clip name. At runtime, if your game has VideoClips assigned, then Unity logs a warning message in the developer console of your web browser.

추가 리소스:

WebGL의 오디오
Texture compression in WebGL