[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 [import]uid: 89562 topic_id: 21687 reply_id: 321687[/import]

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 :slight_smile: [import]uid: 52491 topic_id: 21687 reply_id: 86052[/import]

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. [import]uid: 89562 topic_id: 21687 reply_id: 86105[/import]

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 [import]uid: 52900 topic_id: 21687 reply_id: 95519[/import]

OK, false alarm. Just changed it from touch to tap. DUH. CRAFT moment. [import]uid: 52900 topic_id: 21687 reply_id: 95528[/import]