Using scripting to play a sequence of videos back-to-back
One of the advantages of scripting is that it allows us to easily work with multiple items through loops and arrays, and so on. In this recipe, we'll work with an array of Video Clip assets and use scripting to play them back-to-back (one starts as soon as the previous clip finishes), illustrating the use of the isPrepared and loopPointReached events to avoid complicated loops and coroutines.
Getting ready
If you need video files in order to follow this recipe, please use the videoTexture.mov
file included in the 13_01
folder.
Note
NOTE: The Standalone Installer website provides a good online source of test videos: http://standaloneinstaller.com/blog/big-list-of-sample-videos-for-testers-124.html.
How to do it...
To play a sequence of videos using scripting, follow these steps:
- Import the provided
videoTexture.mov
file, and perhaps a second video clip, so that we can have a sequence of two different videos to test (although you can run the...