Hi all,
It would be so great if there would be stagevideo support for iOS devices. I know there's a workaround using StageWebView, but I need to be able to place objects on top of the video.
Does anyone know if, and if so, when Adobe plans to release support for StageVideo on iOS?
Regards,
Karel
Nope, I need to place objects on top of the video. Wich according to the documentation, doesn't seem possible:
'The StageWebView instance attached to a stage is displayed on top of any Flash display objects' (source)
Cheers,
Karel
Hello,
I'm trying to do the same thing with the new AIR 3 beta 2 in Adobe Labs. With the new stagevideo API available for iOS we should be able to play a h264 movie. I'm trying it on a iPad 1 with iOS 4.3.5 with no luck. I get the sound playing, but no video. I do get the "Accelerated" with GPU though....
Have you tried it yourselft with better results?
thanks..
sebastian
I created a bug at Adobe. You will find there a zip file with the test project I did.
At the end I could see a portion of the video "outside" the stage.. Check it to understand.
https://bugbase.adobe.com/index.cfm?event=bug&id=2960080
seb
Ok i did successfully in integrating VideoStage and play accelerated video, but performance are very bad and far from expected, even if followed adobe recommandation from Adobe AIR TV article : http://www.adobe.com/devnet/devices/articles/video_content_tv.html.
performance on Xoom tablet are not good. Did someone managed in configuring AIR3 app + video encoding to fit expected results (0% CPU, and 100% GPU video decoding as i understood) ????
Hey guys, I've put together an iOS Stage Video class that works great on iPad/iPad2 (have yet to test it on my iPhones), this should help you out! It's not perfect, but it works like a charm!
You will have to add in the following compiler arguments to your Flex project:
-swf-version=13 -target-player=11.0
and in your app descriptor file set the rendermode to 'direct'
<renderMode>direct</renderMode>
you must also set the 'backgroundAlpha' to 0 on your main component
usage:
--------
var path:String = new File(new File( app:/path/to/mp4 ).nativePath).url;
var vid:iOSStageVideo = new iOSStageVideo( path , 1024 , 768 );
vid.addEventListener('videoDone' , function():void{
vid.stopVideo();
container.removeChild( vid );
removeElement( container );
});
container = new UIComponent();
container.width = stage.stageWidth;
container.height = stage.stageHeight;
addElement( container );
container.addChild( vid );
and here is the class:
---------------------------
package
{
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageQuality;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.NetStatusEvent;
import flash.events.StageVideoAvailabilityEvent;
import flash.events.StageVideoEvent;
import flash.geom.Rectangle;
import flash.media.StageVideo;
import flash.media.StageVideoAvailability;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
[Bindable]
public class iOSStageVideo extends Sprite
{
private var videoPath:String;
private var videoWidth:Number;
private var videoHeight:Number;
private var _sv:StageVideo;
private var _vd:Video;
private var _obj:Object;
private var _ns:NetStream;
public function iOSStageVideo( path:String , w:Number , h:Number ){
videoPath = path;
videoWidth = w;
videoHeight = h;
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
}
//stage is ready
private function onAddedToStage(e:Event):void{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
var nc:NetConnection = new NetConnection();
nc.connect(null);
_ns = new NetStream(nc);
_obj = new Object();
_ns.client = _obj; _ns.bufferTime = 2;
_ns.client = _obj;
_obj.onMetaData = MetaData;
_sv = stage.stageVideos[0];
_sv.viewPort = new Rectangle(0, 0, videoWidth , videoHeight );
_sv.attachNetStream(_ns);
playVideo();
}
//video is ready, play it
//public, can be called externally
public function playVideo():void{
_ns.play( videoPath );
_ns.addEventListener(NetStatusEvent.NET_STATUS, videoStatus);
}
//required metadata for stagevideo, even if not used
private function MetaData(info:Object):void{ }
//get video status
private function videoStatus(e:NetStatusEvent):void{
switch(e.info.code){
case "NetStream.Play.StreamNotFound":
//do something
break;
case "NetStream.Play.Start":
//do something
break
case "NetStream.Play.Stop":
stopVideo();
break;
case "NetStream.Buffer.Empty":
//do something
break;
case "NetStream.Buffer.Full":
//do something
break;
case "NetStream.Buffer.Flush":
//do something
break;
}
}
//stop and clear the video
//public, can be called externally
public function stopVideo():void{
_ns.close();
_ns.dispose();
dispatchEvent( new Event('videoDone', true ) );
}
}
}
Can someone please provide a Flash Professional CS5.5 solution for StageVideo on iOS. A FLA file would be preferred. I have used StageWebView successfully on an iPad. I have tried using various document classes but cannot get the video file to play. The solution must stream the video file from a remote server (NOT A FLASH MEDIA SERVER). Are there any settings that need to be adjusted within Flash Professional CS5.5? Remember, I DO NOT want a Flash Builder solution only Flash Professional CS5.5!
Below is the Flash CS5.5 solution. Make sure your using AIR 3.1 and the AIR for iOS rendering setting is set to GPU.
package {
import flash.desktop.NativeApplication;
import flash.desktop.SystemIdleMode;
import flash.display.MovieClip;
import flash.geom.Rectangle;
import flash.media.StageVideo;
import flash.net.NetConnection;
import flash.net.NetStream;
public class Main extends MovieClip {
private var VIDEO_URL:String = "http://www.website.com/video.mp4";
private var netConnection:NetConnection;
private var netStream:NetStream;
private var video:StageVideo;
public function Main() {
NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
netConnection = new NetConnection();
netConnection.connect(null);
netStream = new NetStream(netConnection);
netStream.client = this;
video = stage.stageVideos[0];
video.attachNetStream(netStream);
video.viewPort = new Rectangle(0, 0, 480, 270);
netStream.play(VIDEO_URL);
}
public function onMetaData(dataObj:Object):void {
// Do nothing.
}
}
}
The tutorial posted here: http://01am.co.uk/comment/2 is working perfectly for me.
However, I get no audio. The mp4 file itself contains audio (when played in Quicktime) but is silent when played in my IOS app.
Is there something I need to do to activate StageVideo's sound? Has anyone else had similar issues?
I had the same issue. It seems to be a bug. There's an easy way to fix it. Just play a sound, before playing the video.
I just added a short sound file that I'm playing onLoad. Without this, Flash doesn't seem to know how to handle sound in video files, but once you played a sound, it "remembers" how to do it for stagevideo.
Silly solution, but it worked for me ![]()
North America
Europe, Middle East and Africa
Asia Pacific