Version: 2022.3
언어: 한국어
비디오 클립
비디오 파일 호환성

동영상 소스

The Video Player component plays content imported from a variety of sources, such as video clips, URLs, Asset Bundles, and from the Streaming Assets folder.

동영상 클립(Video Clip)

The Video Player component plays videos from a Video Clip Asset. To create and use a Video Clip Asset, you must first import a video file.

There are two ways to import a video file into Unity:

  • Drag a video file and drop it into the Project window to create a Video Clip.

    프로젝트 창에 동영상 파일을 드래그 앤 드롭하여 생성된 동영상 클립
    프로젝트 창에 동영상 파일을 드래그 앤 드롭하여 생성된 동영상 클립
  • Navigate to Assets > Import New Asset… to import a video file.

After the video file is imported, you can select the newly created Video Clip in the Video Player component window using the Select VideoClip option by clicking the circle button to the right of the video clip, or by dragging and dropping the Video Clip Asset into the corresponding Video Player component field.

** Video Player ** 컴포넌트
** Video Player ** 컴포넌트

URL

Use the Source drop-down to set the video source to URL. By default, the Source is set to Video Clip.

 Video Player 컴포넌트의 Source 필드
Video Player 컴포넌트의 Source 필드

On native build platforms, setting Source to URL allows direct use of files in the filesystem, with or without a file:// prefix. On WebGL platform however, the Source must point to a web URL because playback from local filesystem and Application.persistentDataPath isn’t supported.

Note: Certain web browsers allow you to manually disable browser CORS security for file:// URL access for local development and testing purposes. For example, in Chrome, you can start the browser with the --allow-file-access-from-files command line option, but this isn’t a recommended approach.

The URL source option bypasses Asset management; therefore, you must manually ensure that Unity is able to locate the source video. For example, a web URL needs a web server to host the source video, while a normal file must be located somewhere where Unity can find it, indicated with scripting. This helps in situations where the content isn’t under Unity’s direct control, or if you want to avoid storing large video files locally.

You can also set the Video Player component source to URL to read videos from web sources via http:// and https://. In these cases, Unity performs the necessary pre-buffering and error management.

에셋 번들

에셋 번들에서도 동영상 클립을 읽을 수 있습니다.

After the video clips are imported, you can use them by assigning it in the Video Player component window Video Clip field.

스트리밍 에셋(Assets)

Files placed in Unity’s StreamingAssets folder are used via the Video Player component’s URL option, or by using the platform-specific path Application.streamingAssetsPath.

추가 리소스

비디오 클립
비디오 파일 호환성
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961