Hello,
I have a main.lua, that tells my app to go to another a scene (intro.lua), which is a video playing, and after the video is completed, I want to go to a third scene which is my game menu (menu.lua).
The problem is that my Android app stops, when the video is completed. It doesnt go to the “menu” scene.
My code is as follows:
My main.lua:
local storyboard = require( "storyboard" ) local scene = storyboard.newScene() system.setIdleTimer( false ) display.setStatusBar( display.HiddenStatusBar ) yourName="" labName="" titleName="" rememberMusic=1 rememberSound=1 remeberMusicSlider=300 remeberSoundSlider=300 sndMusic = audio.loadStream ( "Audio/ambient.mp3" ) sndClick = audio.loadStream ( "Audio/click.mp3" ) storyboard.gotoScene("intro") return scene
My video intro.lua:
local storyboard = require( "storyboard" ) local scene = storyboard.newScene() system.setIdleTimer( false ) display.setStatusBar( display.HiddenStatusBar ) local onComplete = function() storyboard.gotoScene("menu") end media.playVideo( "videos/logo.mp4", false, onComplete ) return scene
my menu.lua is huge, I cannot post it here. But it has no problem. If I call it from my main.lua, it works great. If I call from my intro.lua (without the video) it works great.
BUT if I call it (as written in the code above) WHEN the video is completed, the app stops.
Anyone has an idea what is going on?