-
A video challenge
Good Morning
This is my first posting.
How to run a video in the same scene in full screen and when you pressed the "done" button (default Ipad2) closed this video back to the same scene?
This video would run only when pressed any button on the scene.
Thank you
-
I can open the video (without player) in the same scene by pressing a button but the video is full screen (like I wanted) but I can not go back to the scene.
-
Hi djgabriell, and welcome to the forums.
You need a little bit of custom JavaScript to pull this off - at least for iOS devices. Fullscreen mode API is something that is still not full specified for HTML5 so implementations are very specific for each browser.
Anyway, to switch scene when you press 'Done' when viewing videos on an iOS device do the following:
In the scene that contains the video, under Actions -> Start -> Custom JavaScipt
enter following code:
Code:
//get the reference for the video
var video = document.getElementsByTagName('video')[0];
//listen to when the user presses 'Done', and then execute onVideoEndsFullScreen
video.addEventListener('webkitendfullscreen', onVideoEndsFullScreen, false);
function onVideoEndsFullScreen() {
//go to next scene when that happens
controller.goToNextScene();
//or alternatively, you can call controller.replayScene(); to restart current scene
}
For Animator JS API please see the guide here http://docs.sencha.com/animator/1-3/...de/advanced_js
Hope it helps!
-
function part. Rather than go back to previous scene he simply pause the video and leave full screen.