Sorry for the delay … you left a lot of assets in there which made it quite big to download
Here is a cut down version. I have left a couple of scenes in there and 2 videos. I have deleted all assets so it would be small enough. The important scenes are the 2 videos. As you can see I have written 3 functions. The “init” to set up the scene and get the video and add listeners for the events. The “vimeo_pause” is just a function with a call to the post() method setup in it with the message “pause” … in other words when you pause the video you trigger the onPause() method. Also when the video naturally ends you trigger the onFinished() method. These are basically callbacks so you can trigger something on those events.
For all this to work you have to call the function “init” on scene load and the “vimeo_pause” on scene unload. Also, you must change the property in the iFrame to autoplay=0. Turning off the autoplay. We handle the autoplay by calling the post(‘play’); when the video is ready.
Edit: Oh, and give the iFrame a class of “video”.
Hope that makes sense!
ch5_20170416-vDBear.zip (915.0 KB)