I built an iPad app on Flash CS6 using air sdk 3.2. In the app, there is a button to play a video. I want it to play the video in native video player of iPad fullscreen.
I tried two methods :
1. navigateToURL() function. In this method, it first opens a web browser and then plays the video in separate native video player. I don't want it open a web browser first. Here is the code i used :
var req:URLRequest = new URLRequest(videoURL);
2. StageWebView component. In this method, clicking the button draws the video player on the app 100% size of the stage. But in the video player, there is fullscreen button. When you click it, it makes no change on the video player size but it changes the style of the video player (video scroller comes to top of the video, sound controller comes, etc.) So, this may make people confusing. Here is the code :
public var webView:StageWebView = new StageWebView();
webView.stage = this.stage;
webView.viewPort = new Rectangle( 0, 0, stage.width, stage.height);
I need a clear solution which opens a fullscreen native video player when i click the button. Please help me.
I don't know about the native video player, but I'm working on similar type of functionality, and we can play flash video in iPad, if you need the help without using the native video player then I can provide you the code.
See the code below
public class VideoImporter extends MovieClip
public var vid:Video = new Video();
public var netStreamObj:NetStream;
public static var instance:VideoImporter;
public static function getInstance():VideoImporter
if (instance == null)
instance = new VideoImporter();
public function VideoImporter()
instance = this;
private function init():void
vid.width = 1024;
vid.height = 768;
var nc:NetConnection = new NetConnection();
nc.connect( null );
netStreamObj = new NetStream( nc );
netStreamObj.bufferTime = 5;
netStreamObj.client = this;
netStreamObj.addEventListener( NetStatusEvent.NET_STATUS, onStatus );
private function onStatus( event:NetStatusEvent ):void
switch( event.info.code )
//show buffering graphic
//hide buffering graphic
public function onMetaData( info:Object ):void
trace( info );
public function onXMPData( info:Object ):void
trace( info );
public function playVideo(pathStr:String,targetMc:MovieClip):void
You can use this class for importing your video in iPad, just call the playVideo method in your class, parameters are pathStr: path of your video file in your project and targetMc : movieclip in which you want to show your video. In the above class video size is 1024 X 768, as per ipad resolution, if you want to some other resolution, you can change that accordingly.
Please be sure about the video format, it only plays .FLV and .MP4 formats.
I'm using this calss in my project and this is working perfectly, If any error occurs, I'm open for that.
Europe, Middle East and Africa