Search code examples
actionscript-3videoair

Optimizing video playback in AIR for iOS


Developing an AIR for iOS app that involves video playback. Are there any best practices for optimizing video content for use in AIR applications?


Solution

  • Best route for video through AIR on iOS is to use an h.264 encoded video. These will be hardware accelerated and be better on battery than FLV (the other usual type for Flash).

    The problem, of course, is that most h.264 videos cannot be played back using standard Flash video players on iOS. To get around that, you'll want to try one of two things:

    1. Use StageWebView. This will open the video in the standard iOS video player, which is purpose-built to play h.264 videos. The downside here is you have absolutely no control over the video other than unloading the StageWebView. You also have no control over the GUI and the video will display over the entire application and can be difficult to position in Flex.
    2. Use StageVideo which will allow for hardware accelerated h.264 videos and use the built in video playback mechanisms. It works fantastically, you have full control over your video, and it is just the video, so you can skin it as you see fit. The only downside is this displays the exact opposite of StageWebView and displays under your app. You will have to create a mask to see the video.

    It's unfortunate that the two best options for playing video on iOS do not reside in the Display List, but that is what we have to deal with.

    Hopefully that helps.