To output video playback to a RenderTexture, do the following:
- In the Project window, create a new Render Texture asset file named myRenderTexture by going to Create | Render Texture.
- Select the UI RawImage in the Hierarchy window, and assign its Raw Image (Script) texture property to the myRenderTexture asset file.
- In the Project window, create a new Material asset file named m_video. For this material, in the Inspector window, set its Albedo Texture property to myRenderTexture (drag it from the Project window into the Inspector window).
- Create a new 3D Capsule in the scene and assign the m_video material to it.
- Edit the C# script class called PrepareCompleted by replacing the public rawImage variable with a public renderTexture variable:
public...