Hi,
I’ve tried to implement this (linked) solution whilst playing a video using media.playVideo(). The video is bundled in the apk, it plays fine no worries and returns to the initiating scene after playing using the complete callback.
With the back button sample code linked above, when the back button is pressed during the video playback the video stops, disappears and the screen seems to freeze…a second back button press is required to return to the scene.
The current setup has an event handler on an image press to a local function that has one statement, media.playVideo(“video_name.mp4”,true);
In the main.lua there is a function and event handler for the key event:
local function onKeyEvent( event ) local phase = event.phase; local keyName = event.keyName; if ( "back" == keyName and phase == "up" ) then storyboard.reloadScene(); end return true end
I am looking to find out why and resolve the issue of the second back button press to “unload” or remove the video playing from the screen and to return to the scene gracefully on just one press of the back button.
Any help would be greatly appreciated.
Thanks
Chris.