I am wondering now, how to port this to the native.newVideo api. Same idea, we load up a series of videos and queue them to play. Now my problem is the first video plays ok, goes off screen, then only the last video in the sequence plays and gets stuck on screen. Any ideas? I’d rather use native.newVideo due to the nicer format if possible.
combo\_video = native.newVideo( display.contentCenterX, display.contentCenterY,640,360 ) result = {} for match in (params.combo.."|"):gmatch("(.-)".."|") do local t = videos:get(match) result[#result+1] = t end local currentVideo = 1 local function onComplete(event) if video then video:removeSelf() video = nil end if currentVideo \< #result then timer.performWithDelay(1, function (event) currentVideo = currentVideo + 1 print("following videos ",result[currentVideo]) combo\_video:load( result[currentVideo], media.RemoteSource ) combo\_video:addEventListener("video",onComplete) combo\_video:play() end) end end print("first video is ",result[currentVideo]) combo\_video:load( result[currentVideo], media.RemoteSource ) combo\_video:addEventListener( "video", onComplete ) combo\_video:play()