With showWebPopup, videos won't work properly

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]

Some additional info. When processing a link, if I remove the scene change and immediately play the video, I get the following crash:

04-13 12:50:17.830: D/CONTEXT(1554): \*\*\*\*\*drawContentComposition\*\*\*\*\*\*\* - ENTER
04-13 12:50:17.830: D/CONTEXT(1554): m\_mainFrame-\>editor()-\>hasComposition not 
04-13 12:50:17.830: V/(1554): In ResourceHandle::create newHandle
04-13 12:50:17.830: V/(1554): In ResourceHandle::create newHandle the url is = corona:movie=video/affresco.m4v
04-13 12:50:17.850: V/(1554): In ResourceHandle::create newHandle
04-13 12:50:17.850: V/(1554): In ResourceHandle::create newHandle the url is = file:///android\_asset/webkit/android-weberror.png
04-13 12:50:17.890: D/PhoneWindow(1554): couldn't save which view has focus because the focused view com.ansca.corona.CoronaWebView@407bfd80 has no id.
04-13 12:50:17.900: V/(1554): In ResourceHandle::create newHandle
04-13 12:50:17.900: V/(1554): In ResourceHandle::create newHandle the url is = file:///android\_asset/text/glossary.html
04-13 12:50:17.910: D/dalvikvm(1554): GC\_CONCURRENT freed 7205K, 50% free 7506K/14791K, paused 2ms+3ms
04-13 12:50:19.890: I/dalvikvm(1554): threadid=4: reacting to signal 3
04-13 12:50:19.890: I/dalvikvm(1554): Wrote stack traces to '/data/anr/traces.txt'
04-13 12:50:34.720: D/AndroidRuntime(1608): Shutting down VM
04-13 12:50:34.720: W/dalvikvm(1608): threadid=1: thread exiting with uncaught exception (group=0x40138760)
04-13 12:50:34.720: E/AndroidRuntime(1608): FATAL EXCEPTION: main
04-13 12:50:34.720: E/AndroidRuntime(1608): java.lang.NullPointerException
04-13 12:50:34.720: E/AndroidRuntime(1608): at com.ansca.corona.VideoActivity$1.onCompletion(VideoActivity.java:43)
04-13 12:50:34.720: E/AndroidRuntime(1608): at android.widget.VideoView$3.onCompletion(VideoView.java:345)
04-13 12:50:34.720: E/AndroidRuntime(1608): at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:1461)
04-13 12:50:34.720: E/AndroidRuntime(1608): at android.os.Handler.dispatchMessage(Handler.java:99)
04-13 12:50:34.720: E/AndroidRuntime(1608): at android.os.Looper.loop(Looper.java:132)
04-13 12:50:34.720: E/AndroidRuntime(1608): at android.app.ActivityThread.main(ActivityThread.java:4028)
04-13 12:50:34.720: E/AndroidRuntime(1608): at java.lang.reflect.Method.invokeNative(Native Method)
04-13 12:50:34.720: E/AndroidRuntime(1608): at java.lang.reflect.Method.invoke(Method.java:491)
04-13 12:50:34.720: E/AndroidRuntime(1608): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
04-13 12:50:34.720: E/AndroidRuntime(1608): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
04-13 12:50:34.720: E/AndroidRuntime(1608): at dalvik.system.NativeStart.main(Native Method)
04-13 12:50:36.740: I/dalvikvm(1608): threadid=4: reacting to signal 3
04-13 12:50:36.740: I/dalvikvm(1608): Wrote stack traces to '/data/anr/traces.txt'
04-13 12:50:45.000: I/Process(1608): Sending signal. PID: 1608 SIG: 9
04-13 12:52:32.410: I/ActivityThread(1660): Pub it.max.files: com.ansca.corona.FileContentProvider
04-13 12:52:32.420: I/ActivityThread(1660): Pub it.max.ppy\_cache: com.papaya.social.PPYSocialContentProvider

So… what can I do? [import]uid: 94362 topic_id: 24794 reply_id: 100532[/import]

I tried to do something: removing all contents, and creating a new app with few MB (the full app is almost 1GB).

Now, the miniapp, has the following modifications. The scene where I play the movie uses a listener to change the scene after the movie ended. Before moving the this scene in order to play a movie, I remove the web popup.

The miniapp sorta “works”, but I will see these pains later.

However, the big app doesn’t. I am starting to think this has something to do with the build process.
Anyone building very big apps?

Cheers! [import]uid: 94362 topic_id: 24794 reply_id: 100554[/import]