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.
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.
유일한 예외는 다음과 같습니다.
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 공간화를 웹에서 사용할 수 없기 때문입니다. |
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.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.