A Render Texture is an asset file (in the Project window). This file can be written to with the current frame of a video being played. In this recipe, you created a Render Texture asset file named myRenderTexture. We had to set two properties of the VideoPlayer object in order to write the video to our myRenderTexture:
- renderMode was set to a public constant value called VideoRenderMode.RenderTexture
- targetTexture was set to a new public variable called renderTexture
We created a new UI RawImage in Canvas and set its Raw Image (Script) texture property to the myRenderTexture asset file. This means that whatever image is currently in myRenderTexture will be displayed on the screen as a flat, rectangular image in the UI RawImage.
Finally, we had to assign our asset file to the public variable. We did this by dragging myRenderTexture from the Hierarchy window into the public variable...