Adding video content
Adding video content is very similar to adding images. Instead of an image texture, we can use Unity's MovieTextures
, with one extra step to add the Unity VideoPlayer
.
Adding video to the instruction content panel
First, let's add another Raw Image
to the Content panel
(child of Main Canvas
) that we'll use as a MovieTexture
.
- In
Hierarchy
, right-clickContent panel
and selectUI | Raw Image
. - Rename it
Video Graphic
. - Select
Add Component | Layout Element
, and selectPreferred Height
:360
. - Position it in the
Hierarchy
betweenTitle Text
andBody Text
.
We found a height of 360
works for our layout.
Adding video player and render texture
To render videos in Unity we can use a MovieTexture
in conjunction with the VideoPlayer
component.
- In the
Assets/HowToChangeATire/Textures/
folder, create aRender Texture
. - Name it
Video Render Texture
; we can leave its default settings.
Now for the video player:
- In
Hierarchy
, createVideo | Video Player.
- Check
Loop
and uncheckPlay On Awake.
- Select
Aspect...