I am new, but I have been making a lot of progress over the last three weeks. I’ve gotten a lot of core work done (a main menu, authentication and FB login with parse.com, recording & uploading videos). Now I am turning my attention to the playback experience. Many thanks!
I am implementing a scapchat like feature where on the home screen you tap on a button, and then go to a new scene where you watch videos continuously until you remove your finger from the scene.
I am experiencing a problem because I have to re-tap to get an “ended” event, even though you are holding
In the home screen, I trigger the video playback with a widget.onPress to trigger the watching scene. (This works.)
Then, in my watch scene I put a standard touch listener in:
[lua]local function touchListener( event )
print( "touch phase = "…tostring(event.phase) )
if ( event.phase == “ended” ) then
composer.gotoScene( “home” ) – go back home if you lift you finger
end
return true --prevents touch propagation to underlying objects
end
[/lua]
And also this in scene:show, phase == “will”
[lua]Runtime:addEventListener(“touch”, touchListener)
[/lua]
It works, but only if you re-tap the video. Nothing happens when you first lift your finger.
I found this previous conversation, but this technique seems to only work for a button within a scene and not when a user is already touching the screen from an onPress in a previous scene.
https://stackoverflow.com/questions/16473220/touch-hold-event-in-corona-sdk
Any ideas? Thanks!