While the previous recipe demonstrated how we can place videos using the VideoPlayer component, which is set up at design time, much more is possible when controlling video playback through scripting – for example, allowing the user to interactively pause/play/stop video playback:
Figure 12.3 – Example of using a script to control the video
In this recipe, we'll use scripting to play/pause the playback of a video rendered onto a 3D Cube.