Skip to main content
added 15 characters in body
Source Link
Philipp
  • 121.5k
  • 28
  • 261
  • 342

The component you are looking for is the video player. It handles both video and audio playback.

If you want to play the video full-screen, then I would recommend to set the render mode to "Camera Near Plane". If you want to play the video in a window, then I recommend to use "Render Texture". This requires that you create a render texture asset to render to. That render texture can then be used as a texture for a quad or sprite in your scene or a RawImage on your UI canvas.

The documentation I linked to should tell you further details.

If you have multiple video clips which you want to play through the same video player, then you should deactivate "Play on Awake" on the video player and control the playback through a script. That script needs to:

  1. set the correct video clip set the correct video asset on the player (the .clip property)
  2. call the Play()Play() method of the player to start playback

The scripting documentation of the VideoPlayer class should give you more information on what else you can do with it.

The component you are looking for is the video player.

If you want to play the video full-screen, then I would recommend to set the render mode to "Camera Near Plane". If you want to play the video in a window, then I recommend to use "Render Texture". This requires that you create a render texture asset to render to. That render texture can then be used as a texture for a quad or sprite in your scene or a RawImage on your UI canvas.

The documentation I linked to should tell you further details.

If you have multiple video clips which you want to play through the same video player, then you should deactivate "Play on Awake" on the video player and control the playback through a script. That script needs to:

  1. set the correct video clip on the player
  2. call the Play() method of the player to start playback

The scripting documentation of the VideoPlayer class should give you more information on what else you can do with it.

The component you are looking for is the video player. It handles both video and audio playback.

If you want to play the video full-screen, then I would recommend to set the render mode to "Camera Near Plane". If you want to play the video in a window, then I recommend to use "Render Texture". This requires that you create a render texture asset to render to. That render texture can then be used as a texture for a quad or sprite in your scene or a RawImage on your UI canvas.

The documentation I linked to should tell you further details.

If you have multiple video clips which you want to play through the same video player, then you should deactivate "Play on Awake" on the video player and control the playback through a script. That script needs to:

  1. set the correct video asset on the player (the .clip property)
  2. call the Play() method of the player to start playback

The scripting documentation of the VideoPlayer class should give you more information on what else you can do with it.

Source Link
Philipp
  • 121.5k
  • 28
  • 261
  • 342

The component you are looking for is the video player.

If you want to play the video full-screen, then I would recommend to set the render mode to "Camera Near Plane". If you want to play the video in a window, then I recommend to use "Render Texture". This requires that you create a render texture asset to render to. That render texture can then be used as a texture for a quad or sprite in your scene or a RawImage on your UI canvas.

The documentation I linked to should tell you further details.

If you have multiple video clips which you want to play through the same video player, then you should deactivate "Play on Awake" on the video player and control the playback through a script. That script needs to:

  1. set the correct video clip on the player
  2. call the Play() method of the player to start playback

The scripting documentation of the VideoPlayer class should give you more information on what else you can do with it.