Rectangle 27 0

Consider using StageVideo instead. It is supported on iOS.

actionscript 3 - How to stop video autoplaying (stageWebView in Air fo...

ios actionscript-3 flash air
Rectangle 27 0

I can't answer all your questions, so this entry may not be acceptable, but I found this page while searching a solution for some the problems you described and thought that someone else may find this answer (partially) useful.

To save the movie you just took you need to open and read the data from the promise. The iOS won't save the file anywere, so the MediaPromise.file is always null.

Also, I'm still looking for a way to put the movie in the CameraRoll

Were you able to find out how to put the movie into the camera roll?

@1.21gigawatts, no, I didn't. I think that it is impossible (with AIR) after all.

Flex/Flash Builder/Actionscript/AIR/Mobile iOS How to take video using...

ios flex mobile video actionscript
Rectangle 27 0

By the way, the webview object does not exist in the display list, and therefore can't be "embedded" in a movieclip.

If you want to control where it sits (as it will sit on top of everything) alter the rectangle:

By making the rectangle smaller, you can shrink the visible area of the webview down small enough to display the flash content behind it.

actionscript 3 - stageWebView videos for iOS, Air Flash AS3 - How to c...

ios actionscript-3 flash air
Rectangle 27 0

Only H264 has hardware decoding on iOS. This means comparable video performance with native player only for H264 and slugish (at best) decoding for Sorenson and VP6 (even with low resolutions).

FLV and MP4 are encapsulation formats. FLV can contain VP6+MP3 or H264+AAC (or any of them taken alone). MP4 can contain H264+AAC. The docs don't say anything about FLV not beeing supported on iOS.

However, on iOS, if FLV/H264 won't play, you won't be able to remux it to MP4 on the fly because of the following restriction (otherwise you would lose hardware decoding): "Note: This method is not supported for H.264 video in AIR 3.0 for iOS."

Nothing is said about Sorenson or VP6 not beeing suported for on the fly remuxing (thus they should be).

You shouldn't need appendBytes anyways, unless you plan on doing some very advanced stuff, like switching bitrates on the fly without any interruption during play.

Live streaming requires something similar of what appendBytes does. Since H264 hardware decoding is required and does not have a software mode, you won't get H264 for live streams.

How well H264 decoding performs on different Apple ARM CPUs really depends a lot on video encode settings (B-frames or keyframes, bitrates, etc.) and wether you have dynamic content, static content, fast switching scenes, resolution, color palletes, etc.

Conclusion: Use FLV or MP4 (whichever suits you best), with H264+AAC inside. Experiment with encode settings, or lots of videos of which you are targeting (if any). Determine which is the lowest (oldest) iOS device you want to target, and test on that.

Forgot to mention all of the above apply only to StageVideo, never to normal

Hi Tiberiu, your post answers more of my questions. Thanks for posting. I will mark you as correct. Just one more question: how is the performance? it is lagging or running ok in native resolution ?

It has to be the same as with QuickTime. Depends a lot on the video beeing played and at the same time, on the hardware.

When compiling the AIR app you must target at least -swf-version=13 (StageVideo became available with -swf-version=11, however, I recommend targeting the newest supported, I think its 15 now). If FLV with H264/AAC doesn't cut it to hardware, an MP4 with the same streams must. Check bitrates and recommended video and audio encode settings for various iOS devices before doing any tests (that is if you have control on the video beeing played). I haven't tested FLV on iOS yes, however I will soon, since I'm working on something right now.

@jamix It seriously depends a lot on CPU power, screen resolution and video resolution.

Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).

actionscript 3 - Flash/AIR Stage Video on iOS - Is It Possible? How is...

ios actionscript-3 flash video air
Rectangle 27 0

From my experiences (I've created 3 separate AIR VOD apps for both iOS and Android), the following is true:

  • StageVideo works on Android 4.0+. I was unable to get it to work with 3.x, but I have been told it works. I can, for sure, confirm that it does not work on 2.x.
  • StageVideo works on iOS 5+. On iOS 5, you will need to play a silent sound at startup to make sure sound works, but you should do that regardless since the iPad 2 rarely plays sound without doing that. It is a known bug in AIR that, as far as I know, has never been attempted to be fixed
  • iOS can only play h.264 MP4s through StageVideo and StageWebView. They will not work in Flash video players (including VideoDisplay, the base for Video and all OSMF-based players). I do not recall the exact reason for this, but I believe it has something to do with the MP4 requirement for hardware accelerated playback.
  • iOS can play FLV and, maybe, F4V through the Flash video players described in #3. This will lack hardware acceleration, however. That means your video and your UI will run on the same thread and share the same process. Basically, lower framerates while video is playing. Additionally, CPU decoding is a battery drain.
  • Android is a little more wild. You cannot use StageWebView for any playback as of Android 4.3 (have not tested on 4.4 yet). You can use Flash video players for h.264 MP4s... on some devices. I've found that they seem to work fine on Android 3.0+ on all devices I have tested. Keep in mind that is only a couple dozen out of over a thousand possibilities, though. On 2.x, it is extremely hit-or-miss. It seems to work fine on HTC and Motorola devices (which I've tested on), but I have had reports from users who cannot playback on Samsung and Sony devices.

As you mentioned, a fallback player is definitely recommended. Without having multiple sources/encode types, the fallback is useless on iOS, however. I currently have an app in the Play Store (All About Trikes) that was originally released without a fallback player and just used a StageVideo implementation. A day after release, we started getting reports that users on 2.x couldn't play videos. We had to scramble. We first released a version that couldn't be installed on 2.x and then another version that uses Flex's VideoDisplay as a fallback, which seems to have fixed the problem for those users, but I know there will be others than cannot playback video.

Long story short, there is no fool-proof way of playing back h.264 MP4s on mobile using AIR. You do want to include a fallback player, regardless of platform. Ideally, if you are streaming the video, you should have both h.264 MP4s and FLVs available with the fallback using FLVs instead of MP4s.

Thank you very much for the thorough answer! I'm gonna use StageVideo only for iOS. I do not stream and do not have the option to supply a backup flv's. I guess I'm going to have to use only StageVideo with not fallback and hope for the best. With Android I will use only Video since the StageVideo has a bug there for short clips (doesn't play them all the way through).

@mik Don't forget to play a silent mp3 at launch using Sound to ensure all platforms can play sound. I generally use

Thanks, but I play short clips with no sound, but I will remember this for future use! So I actually need to limit my app for iOS 5.0 and above in the descriptor file if I'm using StageVideo, right?

I'm unsure. I've had it successfully work on iOS 5+ but I don't believe I've ever tested on iOS 4 or below. Restricting it to 5+ really isn't that bad, though, since less than 3% of iOS users are on 5 now and less than 1% are on <4. Those users are nearly 3 years behind. We can't continue supporting old software indefinitely, you know?

Yeah.. so I don't think it's too risky for me not to put an iOS limitation. great ;)

android - StageVideo fallback in Air mobile doesn't work. Video compon...

android ios video actionscript air
Rectangle 27 0

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:

  • 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.
  • 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.

An addition to StageVideo I encountered last week during a mock-up: You dont get the XMPMetaData from the Video-File.

actionscript 3 - Optimizing video playback in AIR for iOS - Stack Over...

actionscript-3 video air
Rectangle 27 0

I don't know how the performance stacks up, but the Actionscript docs for NetStream have some information about using NetStream/Video to play video on AIR on iOS devices:

The takeaway is that StageVideo and limited streaming capabilities are supported on iOS devices as long as your video uses the streaming formats that iOS requires.

Ok, so basically what you say is that I could not play a .flv using an adobe air app on the iPhone ?

actionscript 3 - Flash/AIR Stage Video on iOS - Is It Possible? How is...

ios actionscript-3 flash video air