Skip navigation
Currently Being Moderated

stageWebView - Video stops, but audio keeps playing

May 13, 2013 3:20 PM

Tags: #video #audio #stagewebview #mp4
USING:
Flash CS5.5 v11.5.1.34
Windows 7 v6.1
PROBLEM:
I'm developing AIR for iOS (for iPad), and using the stageWebView class to play video. My videos play properly, but when the stageWebView is disposed of, the video disappears, but the audio keeps playing. Other developers have reported this on many forums, and it seems to be a bug.

In my app, tapping the "Back" button disposes the stageWebView and returns to a "Menu" scene. The problem is intermittent: sometimes, upon tapping "Back", the video and audio are disposed of completely.  Other times, only the video and stagewebview window disappear -- but the audio keeps playing!  Can anyone help?
CODE:
// THIS PLAYS MY VIDEO PROPERLY (CODE ELSEWHERE DEFINES THE VARIABLES, ETC)
videoFile = MovieClip(root).imagesPath + "test.mp4";
stageWebView = new StageWebView();
stageWebView.stage = stage;
stageWebView.viewPort = new Rectangle(112, 168, 800, 600);
videoFilePath = File.applicationDirectory.resolvePath(videoFile);
stageWebView.loadURL(videoFilePath.nativePath);
// THIS BUTTON GOES TO A "MENU" SCENE AND KILLS THE STAGEWEBVIEW
buttonBack.addEventListener(MouseEvent.MOUSE_UP, buttonFunction);
function buttonFunction (evt:MouseEvent):void {
// Remove video
stageWebView.reload();
stageWebView.viewPort = null;
stageWebView.dispose();
stageWebView = null;
gotoAndStop("mainMenu");
}
TROUBLESHOOTING:
1) Tried multiple H.264 encoding techniques -- didn't solve it.
2) Tried multiple coding methods to dispose the stageWebView -- didn't solve it.
3) Tried playing the .MP4 within an HTML5 file -- didn't solve it.
4) Updated Flash CS5.5 version -- didn't solve it.
5) Updated AIR to 3.7.0.1530 -- didn't solve it.
6) Searched every forum/article I could find -- didn't solve it.
 
Replies
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    May 13, 2013 3:42 PM   in reply to avtut123

    for video you should try using stagevideo, not stagewebview.

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    May 13, 2013 8:51 PM   in reply to avtut123

    what's the following trace at the end of your code show:

     

    if (stageVid) {

    stageVid.attachNetStream(ns);

    trace(MovieClip(root).imagesPath + "test.mp4");

    ns.play(MovieClip(root).imagesPath + "test.mp4");

    }

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    May 14, 2013 6:53 AM   in reply to avtut123

    then stageVid is null.

     

    are you setting wmode="direct" and testing in a browser?

     

    here's info on StageVideo:  http://www.adobe.com/devnet/flashplayer/articles/stage_video.html

     
    |
    Mark as:
  • Currently Being Moderated
    May 14, 2013 8:51 AM   in reply to kglad

    Hi Kglad, thanks -- I've read that article, and every other one I can find.  I believe that article references Flex, not Flash. In Flash, there's no HTML component to the AIR for iOS publishing, so there's no wmode="direct" setting that I can find anywhere.  Other developers have made the same remark.  In Flash, there are no compiler arguments that can be made (that I'm aware of).

     

    I did publish a standard SWF/HTML file, and I edited the HTML file so that <param name="wmode" value="direct" />, but that did not work.  It makes me think that StageVideo works on Flex, but not on Flash.

     

    If I could just get StageWebView to stop the audio, everything would be solved.  Do you, or anyone else, know if upgrading to Flash CS6 would solve this?

     
    |
    Mark as:
  • kglad
    72,227 posts
    Jul 21, 2002
    Currently Being Moderated
    May 14, 2013 9:12 AM   in reply to avtutorials

    for air there is a render mode (on the general tab or your air settings panel) that should be assigned "direct".

     
    |
    Mark as:
  • Currently Being Moderated
    May 15, 2013 10:32 AM   in reply to kglad

    Well, I might have found the solution... I couldn't get SteveVideo to work.

     

    But, I did get  StageWebView working properly--  I upgraded to Flash CS6 (from CS5.5).  The audio and video stop appropriately when StageWebVideo is disposed of.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 6, 2014 6:00 AM   in reply to avtutorials

    AV,

      Hello.  I'm <still> fighting getting video from Flash to play on iOS (iPad).

      Your message reads like you've figured out how to get StageWebView to work properly - sounds AWESOME!

      Can you please share the complete details on how you got it to work?

      I'd happily pay you a few bucks to help me figure this out...getting desperately frustrated.

     

    Thank you for your consideration,

    Kade

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 6, 2014 8:33 PM   in reply to KadeMendelowitz

    Hi Kade,

    I sent you a Private Message.  Please check and email back.  Thanks.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points