Hi, i’m displaying a full screen video in my app. I want the user goes to next or previous scene depending on where the user touches the video object. Can i do that?
[lua]local function goForward( … )
composer.gotoScene (“pages.scene24”, {effect=“fromRight”, time=400})
end
local function goBack( … )
composer.gotoScene (“pages.scene22”, {effect=“fromRight”, time=400})
end
– Scene event functions
video_040 = native.newVideo( Scenegroup, common.centerX, common.bottom, common.w, 1820*common.w/1080 )
video_040.anchorY = 1
video_040:load( “assets/videos/Animation_dontpanic.mp4” )
video_040:play()
local function videoListener(event)
if event.phase == “ended” then
video_040:seek(0) --rewind video after play
video_040:play()
end
end
video_040:addEventListener( “video”, videoListener) [/lua]