Skip to main content
Known Participant
April 17, 2012
Answered

video playback on iPad 2?

  • April 17, 2012
  • 5 replies
  • 5671 views

is it possible to stream video on iPad 2 using either the FLVPlayback component or the Video Class?

i've tried all H.264, Sorenson, ON2 VP6 formats, mp4,m4v,f4v,flv

the videos play OK in the IDE, but on iPad 2 no video shows up

i'm using the Flash 5.5 IDE and AIR 3.2

This topic has been closed for replies.
Correct answer smoothblur

Ok, I created this sample file by tearing some code out of a larger project. Its a little light on comments and the code could be cleaned up a lot but it works fairly well. This example uses stageVideo with a fallback to a regular netstream video object. It is based loosely on several sample stageVideo source that I found online.

When you tap on the play button in the example it first loads in a custom player container, then it converts the entire stage to a bitmap and masks this bitmap using a mask bitmap that is created from the library. This mask creates a hole through the bitmap version of the stage contents so that the stageVideo is visible. (Because stageVideo is always drawn under everything in the displaylist.)

This example also has an iOS styled player UI that I created so that it would look similar to the native video player. It has play, pause, a video scrubber and full screen mode. There is a small sample h.264 video included in the example so you can test it out and see it work. On the iPad make sure that your videos are in a folder or in the root and that the folder or files are added to the included file list for your app. Also make sure that the render mode in your app.xml file is either GPU or Direct. Beyond that if you have problems or questions let me know.

Download the sample file here

http://www.thebitcrew.com/downloads/StageVideoDemo.zip

5 replies

smoothblurCorrect answer
Participating Frequently
April 21, 2012

Ok, I created this sample file by tearing some code out of a larger project. Its a little light on comments and the code could be cleaned up a lot but it works fairly well. This example uses stageVideo with a fallback to a regular netstream video object. It is based loosely on several sample stageVideo source that I found online.

When you tap on the play button in the example it first loads in a custom player container, then it converts the entire stage to a bitmap and masks this bitmap using a mask bitmap that is created from the library. This mask creates a hole through the bitmap version of the stage contents so that the stageVideo is visible. (Because stageVideo is always drawn under everything in the displaylist.)

This example also has an iOS styled player UI that I created so that it would look similar to the native video player. It has play, pause, a video scrubber and full screen mode. There is a small sample h.264 video included in the example so you can test it out and see it work. On the iPad make sure that your videos are in a folder or in the root and that the folder or files are added to the included file list for your app. Also make sure that the render mode in your app.xml file is either GPU or Direct. Beyond that if you have problems or questions let me know.

Download the sample file here

http://www.thebitcrew.com/downloads/StageVideoDemo.zip

tarentolaAuthor
Known Participant
April 21, 2012

very kind of you smoothblur, thank you!

Participating Frequently
April 21, 2012

Your are welcome. I had problems getting stageVideo to work on the iPad initially as well so I figured this might helpful to others. There's probably still some remnant code from the app I took this out of so if you have questions or problems let me know.

Participating Frequently
April 21, 2012

I have some stageVideo code that I wrote for a video player in an iPad app that I will package up and post for you shortly. The main things are to be sure you are using the version of the AIR SDK that actually supports StageVideo on mobile, making sure your renderMode is set to either gpu or direct and then using the StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY event to verify that stageVideo is available. It has a iOS themed player UI to make it look like a native player. I am cleaning up my code and post it this evening.

tarentolaAuthor
Known Participant
April 20, 2012

Jaxim,

yes, and on this line sv = stage.stageVideos[0]; i get this error: RangeError: Error #1125: The index 0 is out of range 0.

sinious,

i have absolutely nothing on the display list

i can't use a StageWebView in the app, nor a native player

so i'm left with NetStream (unacceptable playback), FLVPlayback (stripped of the VideoEvent is useless), embedding the video on the timeline (which is what i want to avoid) and StageVideo for which i don't have a working example...

Participant
April 18, 2012

Try this very helpful for everyone including you..click it right now before its tooo late!!! http://tinyurl.com/7nljbmj

Colin Holgate
Inspiring
April 17, 2012

RTMP streams won't work, and FLVPlayback won't play H.264 on iPad. Use a progressive download video, and if you're using FLVPlayback, make it be a regular FLV. If it has to be an H.264 file, then either use the native player, StageWebView, or Netstream.

tarentolaAuthor
Known Participant
April 18, 2012

Colin,

thank you for your answer. i can't use the native player or StageWebView in the app i'm working on, but

i was able to play back video by:

a) converting a quick time movie to flv (high quality)

b) using the FLVPlayback

NetStream + H.264 plays back the video but it's too jerky

Inspiring
April 19, 2012

Have you looked into using StageVideo?