Skip to main content
June 8, 2011
Question

Native video in ios HEEEELLLLLPPP!

  • June 8, 2011
  • 1 reply
  • 792 views

Hi all, has anyone figured out how to link to a .h264 video that would be contained in the package but use the ios native player. I can use stagewebview bit just does'nt cut it for what im trying to do. Has anybody been successful with navigateToURL() causr thats what I need to work.

cheers

Laz

This topic has been closed for replies.

1 reply

relaxatraja
Inspiring
June 8, 2011

I just used the stagewebview to load the video with native ios player, but is it doesn't work for your or you just need with navigatetourl?

import flash.geom.Rectangle;
import flash.media.StageWebView;
import flash.filesystem.File;
import flash.utils.Timer;
import flash.events.TimerEvent;

stop();

var webView:StageWebView = new StageWebView();
webView.stage = this.stage;
webView.viewPort = new Rectangle(0,0,stage.stageWidth,stage.stageHeight);
var fPath:String = new File(new File("app:/MyMovie.mp4").nativePath).url;
webView.loadURL( fPath );

June 8, 2011

Hey relaxatraja Thanks for the reply. I have tried stagewebview but when i get to the frame that holds the video, the stagewebview covers the entire stage with the video, Now thats ok and the user plays in the native player and thats good too, but lets say the user wants to stop the video and go back to the previous frame, I dont know how to make the video "unload" so go to a new frame when the user hits "done" on the native player. Any help would be fantastic, thanks so much in advance

Laz

relaxatraja
Inspiring
June 8, 2011

If you really want to stop in the middle, then dont have your video to the full stage width and height. Have some space for you and place a button over there like "Stop". When triggered Just write the code below:

stopbtn.addEventListener(MouseEvent.CLICK,stopfn);

function stopfn(e:MouseEvent):void{

  webView.stage = null;

  gotoAndStop(2);

}