Sudden error I can't find and StageWebView (AIR for iOS)
Hey all,
In my app I allow a user to download files from a list and then typically use StageWebViews to display them (videos mostly). Recently my app started to misbehave.
I'm using Flash Builder 4.6 with AIR 3.2 on Win7 Pro 64.
I test on-device. I choose fast export (quick packaging) and debug right from Flash Builder so I can see traces/errors/etc from the iPad.
After downloading a ~40MB MP4, I save it to the applicationStorageDirectory (and mark it 'do not back up'). I then wait 3 seconds just to be sure the write has a few seconds to complete. Then I black out the screen with a black sprite, stick a close button on the screen and load the video into a new StageWebView.
The problem is the first time these larger 40MB videos are saved and attempted, TONS of code isn't firing off or affecting the display. The video plays just fine, centered on the screen. However all the code to remove tons of things from memory during video playback which has tons of trace statements sprinkled in is simply not affecting the iPads display. This ONLY happens on iPad1 (OS 5.1). iPad2 and iPad3 work just fine.
I presumed I was being too aggressive with the iPad1 and added more and more time between downloading, saving and setting the bit on the file so the iPad1 wasn't innundated with doing to much at once. I can add 25 minutes worth of setTimeout between playing this video for the first time and it will fail every time though. So it's not being innundated.
If the video is already downloaded and a user selects it, it works perfectly fine. All views/classes are disposing properly to free up as much ram as possible for the video playback.
Now, I'm getting this error randomly:
Error #2044: Unhandled ErrorEvent:. text=Plug-in handled load
I can't find where this is coming from. Has anyone seen this before? I don't know if it has anything to do with what I'm seeing fail here. I doubt it because I get it a very short time (few seconds) after the video starts playing back. I only get this video the first time a file is downloaded and played but then never again.
I have an UncaughtErrorEvent that isn't even catching this. Everything to do with the class that displays the video has try {} catch() {} blocks over every line of code. So doesn't the small file downloader class. Nothing is throwing an ErrorEvent.
Is there any easy way to find where this error is being generated? Something I might not know about the Flash Builder Debugger? Other errors show up and tell me where they occured, but this brand new error does not cause the app to fail and the debugger doesn't even flinch at it.
On the first part, has anyone recently seen their apps exhibit something like this? I have a list of files that I destroy before I show the video and it continues to exist even though I literally trace() all over the code that should destroy it and I see the traces. Everything is nulled. Objects no longer exist. The background isn't visible that I'm tracing as I build and it exists on the display list. It's very odd.
It'd just like suddenly StageWebView has an issue loading a freshly downloaded and saved file. It nukes the display list, nothing I do to it matters. But if the file already exists it all works fine.
