[Resolved] media.playVideo
Hi all,
I'm trying to have an image transition into a video. The image is a button and looks exactly like the first frame of the video. The idea is that the image is shown, then when pressed, the image disappears and the video starts. The problem I'm having is that there is a black flash between the image disappearing and the video playing. Has anyone done something like this and get it to work? Thanks in advance.
Jay
Replies
Thanks Peach. Also trying to move seamlessly between video clips in a similar way. For example, the end of one clip is exactly the frame where a new one starts.
Can you please help me with my code....lol...it works but you have to hold your finger on the button for 2 seconds for the video to start working....
local button = display.newImage("images/proc.png")
button.x = display.contentWidth/2
button.y = 650
button.myName = "Media"
localGroup:insert(button)
local function onVideoComplete(event)
print("Video playback completed")
return 0
end
local function buttonHandler(event)
local target = event.target
if target.myName == "Media" then
media.playVideo( "images/one.m4v", true, onVideoComplete)
end
return true
end
button:addEventListener("touch", buttonHandler)
return localGroup
end
OK, false alarm. Just changed it from touch to tap. DUH. CRAFT moment.
Hey Jay,
I believe when starting a video there will always be that moment before it starts with a little flash; that said I know someone who is currently doing a fair bit with videos and will have a word with them about their experiences and get back to you if I can find out anything relevant/helpful to your situation.
Peach :)