Hi all!
I’ve tried to debug this, but it seems I can’t figure what is wrong with my code.
My app displays videos through “media.playVideo”, and I change scenes with the director library. All works just fine in the simulator, but on the device, a GalaxyTab 10.1 I can’t make videos work properly with web popups.
When I change to a scene without web popups, everything works just fine. When a video ends, I get back to the original scene.
When I change to a scene with a web popup, I catch HTML links that start with “corona:movie”, and start the media after changing to another scene. After the movie, it won’t get back to the original scene! I can’t stress enough that on the simulator, everything works just fine!
This is the code in my url listener:
-- Start a video
if 1 == string.find(url, "corona:movie") then
contents.targetMP4 = url:sub(url:find("=") + 1)
-- DEBUG: WHY DOESN'T THIS WORK?
contents.targetMP4 = "video/mummia.m4v"
director:changeScene("glossary", "crossFade")
end
The new scene is quite simple, and for debugging purposes I’ve tries to hardcode a change of scene after the movie, but it doesn’t work anyway:
module(..., package.seeall)
local director = require("director")
local contents = require("contents")
local theScreen = display.newGroup()
new = function(params)
-- This is always constant as in the url listener
print("glossary: " .. contents.targetMP4)
media.playVideo(contents.targetMP4, true)
director:changeScene("exhibit", "crossFade")
return theScreen
end
If you need the whole code, I can provide that to you.
Can anyone point me in any useful direction?
Cheers! [import]uid: 94362 topic_id: 24794 reply_id: 324794[/import]