A MediaPlayer component is always required and so should be the first component you add to your scene.
Create a GameObject with the MediaPlayer component by selecting from the menu
GameObject > Video > AVPro Video - MediaPlayer.
On the MediaPlayer component, set the media source via the
Settings > Sourcesection. Press on the folder button to browse for the media you want to play. See the Loading Media section for more information about this.
The MediaPlayer is set up to load and play your video, however it will not display yet (see below).
Displaying Video on the UI
The DisplayUGUI component is used to render the video to the UI.
- Create your UI canvas by going to the menu
GameObject > UI > Canvas.
- Make sure the new Canvas GameObject is selected and then select from the menu
GameObject > UI > AVPro Video uGUIto add the DisplayUGUI component.
- Select the new GameObject and assign the
MediaPlayerproperty to the MediaPlayer created above.
- Play the scene to see your media displayed
Displaying Video on a Mesh
The ApplyToMesh component is used to render the video to a mesh.
- Add a 3D mesh object to your scene (eg Quad) and move it so that it is visible by the main camera.
- Add the ApplyToMesh components to a GameObject and assign the
Mediaproperty to the MediaPlayer created above and the
Rendererproperty to the MeshRenderer component.
- Create a new material and assign it a suitable AVPro Video shader (eg AVProVideo/Unlit/Opaque).
- In the MeshRenderer assign this new material to the Materials Element 0 property.
- Play the scene to see your media displayed on a mesh.
Read about the included demo scenes as these are also a good quick start reference for typical use-cases.