NOTE: This post refers to a seemingly unstable and inofficial functionality - I don´t recommend using it, but just want to learn more about how the video playback works. Our recent project required a play/pause functionality during video playback. We read that it´s not officially supported, and there is nothing in the ObjectReference either... but I tried it anyway. I just used these calls, placed in subroutines:
videoPlayer.pause() videoPlayer.resume() ..and it worked! ...At least until I tried to play/resume videos at arbitrary moments: I experienced some crashes when the video was almost over and I tried to pause/resume it there. My custom script for a playlist of movies waits for the videoEvent 8 (video ended), then simply loads/plays the next movie. So I tried disabling pause/resuming between the events 8 and 3 (video ended/loaded) when there is no video in memory, but that didn´t help much. Btw: The "video ended"-event appears to not occur at the exact end of the movie, which caused several problems in my script (or at least I could not rely on it, but why?). Another cause for crashing seems to be the use of EnableZoneSupport(true/false) during runtime, i.e. for toggling a debug text field with the GPIO-side button, especially in combination with paused videos. Since this was not a necessary feature, I just disabled it - I guess this is not what EnableZoneSupport() was made for. I finally hard-coded all movie lenghts and added timecode events at (1 second) and (movieLength - 5 seconds). Pausing is now only allowed 1 second after the movie has started, and 5 seconds before it ends. That solved the crashes, and the script is running fine. I learned a lot on the use of BrightScript during this project, but some questions are: