Skip to main content
April 30, 2013
Question

Android, StageWebView. Fatal crash, reboot required.

  • April 30, 2013
  • 2 replies
  • 2751 views

Steps:

1) Set renderMode GPU or rendermode DIRECT, enable android:hardwareAccelerated="true" in the App-Descriptor (to see videos at all).

2) Use a simple HTML (body head div iframe) to play Youtube-Videos in StageWebView.

The OS-Video-Player then "inspects" the HTML-Code and replaces the Youtube-Flash-Player (almost all newer devices do so).

3) Sometimes (about 1 in 15) the video is upside down <- this is when the rest of the bug occurs.

4) Call any Function that changes the StageWebView-Location:

StageWebView.loadString(), StageWebView.loadURL(), StageWebView.historyBack() or call StageWebView.dispose().

5) Crash:

AIR-App crashes, Youtube-Audio keeps playing -until the device if powered off-

Android>Settings>Apps>"Force close" does not help, hell, even uninstalling doesnt shut up the audio.

==============================

Step (3) is tricky:

It does not happen every time, but it does happen often enougth (average about 1/15 times) to be reproducable in 1-2 minutes. You have to start the process several times to trigger it.

Because i could not reproduce the bug reliably, my first assumption was that it has something to do with the rest of my apps state/code. So, i made an isolated test project, just 2 buttons + stageWebview: same results.

Things that do NOT matter:

- HTML-embed-method does not matter. I tried: new (iFrame), old (embed), youtube-js-API (fill div) and several other variations.

- Youtube-player parameters , stuff like fs, rel, flip(not working anyway) etc...

- StageScale, Ratio, i tried StageScaleMode NO_SCALE, SHOW_ALL...

- StageWebView.viewport size / position.

- Video size / ratio in the embed code, i tried the ones youtube embed suggests and custom sizes.

- Orientation mode, auto, landscape, portrait.

Things that DO matter:

- RenderMode must be GPU/DIRECT, it never happens in renderMode CPU or auto.

- The Youtube-Flash-Player must be replaced be the Android-OS-Player, the youtube-player never shows videos upside down nor causes a crash.

Observations:

When the Os-Player replaces the youtube player and shows the preloader/spinning wheel thing:

For the first fractions of a second, a small, empty "youtube-player-ui" is spinning instead of that wheel.

What an outlandish bug. I think thats why the bug onyl happens sometimes, depending on how long the video takes to load and how far the "mini-youtube-player" is rotated (i still cant believe this).

Test-Devices:

Nexus 7 (4.2.2) <- crashes most often

Samsung GT-N7100 (4.1.2)

HTC One (4.1.2)

xPeria Lt30p (4.1.2)

Any Ideas ?

Can someone from Adobe confirm this bug ?

CS6, Air SDK 3.5/6/7

Message was edited by: verdave, typo, details

This topic has been closed for replies.

2 replies

June 7, 2013

I can confirm this very annoying bug!

In my app (using Starling so I have to use rendermode DIRECT) I see the rotating youtubeplayer for a couple of seconds before video plays. Sometimes upside down. Sound is not turning off when closing/disposing and null-ing the SWV.

I isolated the problem just by using this small class getting instantiated directly in main-class.

package

{

          import flash.display.Stage;

          import flash.geom.Rectangle;

          import flash.media.StageWebView;

          public class StageWebViewBug

          {

                    private var sw:StageWebView;

                    public function StageWebViewBug(stage:Stage)

                    {

 

                              if(sw==null)

                              {

                                        sw = new StageWebView();

                                        sw.stage = stage;

                              }

 

 

                              sw.viewPort = new Rectangle(0,0,600, 480);

                              sw.loadURL("http://www.youtube.com/watch?v=opZ69P-0Jbc");

 

                    }

          }

}

Problem is occuring now every single time on Google Nexus 10. (rotated video). Previous sound isn't stopping before refreshing the page AND the youtube-video is actually playing again.

Air SDK 3.7

/Andreas

Nimisha1
Participating Frequently
June 10, 2013

Hi ANdreas,

I have the run the code provided by you but I am unable to understand your problem here as the above code is playing a youtube video only. Please tell me the steps to reproduce the two problems you mentioned:

1.)I see the rotating youtubeplayer for a couple of seconds before video plays. Sometimes upside down.

2.) Previous sound isn't stopping before refreshing the page AND the youtube-video is actually playing again.

Thanks,

Nimisha

Participant
August 26, 2013

I'm having a similar problem, sometimes when I open a StageWebView with a video on Android, the video appears flipped and upside down, in my case is not crashing ...

Occurs only in Android. I'm using galaxy tab 10.1

Obs: to stop the sound just add the following lines on the disposal method

stagewebview.stop();

stagewebview.reload();

stagewebview.viewPort = null;

stagewebview.dispose();

Adobe Employee
May 2, 2013

Hi,

I tried with the mentioned steps but unfortunately the crash is not reproducable. Could you please share the source files and the packaging command at nimitja@adobedotcom, so that I can give it a try again and reproduce the issue.

Regards,

Nimit