StageVideo on iOS

Hi Guys,
I really need you help.
I am building an iOS app with adobe air 3.8. And testing it on Iphone 5, iOS 7
Im playing a mp4 with stageVideo and everything works fine apart from the fact the every second/third time or so that I open the app and plat the video the app crashes without any warning!
Please.....Can any one help ?
Here is the simple code that I use:
Thanx in advance
/Henry
import flash.net.NetStream;
import flash.net.NetConnection;
         var netStream:NetStream;
         var netConnection:NetConnection;
         var video:Video;
            netConnection = new NetConnection();
            netConnection.connect(null);
            netStream = new NetStream(netConnection);
            netStream.client = new Object();
            video = new Video(320,240);
            video.attachNetStream(netStream); // might be overridden later
            // Set up normal display list properties
            video.x = 100;
            video.y = 100;
            video.width = 320;
            video.height = 240;
            addChild(video);
            netStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
            // Try to render as stage video
            var v:Vector.<StageVideo> = stage.stageVideos;
            if ( v.length >= 1 ) {
                var stageVideo:StageVideo = v[0];
                stageVideo.viewPort =
                    new Rectangle(100,100,320,240);
                stageVideo.addEventListener(
                    StageVideoEvent.RENDER_STATE,renderStateEventHandler);
                stageVideo.attachNetStream(netStream);
            netStream.play("filmtest_1.mp4");
         function renderStateEventHandler(event:StageVideoEvent):void
            // If video is not rendered properly let the
            // video object in the display list try to render it.
            if ( event.status == StageVideoEvent.RENDER_STATUS_UNAVAILABLE ) {
                video.attachNetStream(netStream);
function asyncErrorHandler(event:AsyncErrorEvent):void {
    trace(event.text);

Hi Colin,
Thank you very much for your advice
I updated to SDK 13 and it seems to have fixed the problem.
Thanx again..Greatly appriciated
Best
Henry

Similar Messages

  • StageVideo for IOS

    After a lot of searching I've got StageVideo working in my IOS app.
    See the tutorial posted here: http://01am.co.uk/comment/2
    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 always use AAC for mp4 audio and it works just fine. Can you go into your audio settings and post the settings you have selected? Also are you exporting 48khz or 44khz?
    Do you perhaps have a link to this video you can post here or share in private message? I can get the audio settings from the video and look them over.
    I assure you there's lots of mp4 h264 support on iOS and I've actually never seen a mp4 iOS couldn't play perfectly so I'm curious.
    I also have pro tools (non-Adobe products) that I use to encode my mp4s. I could encode your video for you if it's not too big. I can tell you the settings used to produce it as well. I use other tools to encode because of the lack of scene change auto-keyframing in adobe media encoder. It's a good all around encoder but it doesn't get files as small as a pro encoder can.
    On a last note if you are linking to the video via a web browser, that isn't StageVideo. It's similar in that it's GPU rendered but it's a little different in implementation.

  • StageVideo play multiple videos in sequence (playlist) on iOS

    Hi everyone!
    I have to play severals locals videos in sequence with stageVideo (imagine an dynamic background wich runs an playlist).
    Its runs very well (the MP4 videos play smoothly) but when the videos are switching appear an full sreen white frame for 3 seconds and later the second video start to play (on my iPhone4). 
    private function netStreamStatus(event:NetStatusEvent):void{
             if (event.info.code == "NetStream.Play.Stop"){
                     netStream.play(VIDEO2)
    If i rewind the first video (loop) the white frame never appear:
    private function netStreamStatus(event:NetStatusEvent):void{
               if (event.info.code == "NetStream.Play.Stop"){
                     netStream.seek(0)
    ¿How can i do an smooth video change with an stageVideo and ios devices?
    Thanks a lot!

    Here i attach an FXP project (Flex 4.6 Mobile APP) wich play some videos with stageVideo.
    You can see in a real device like iPhone 4 (not desktop) an BLACK screen when swtiching videos (about 3 seconds).
    Can anyone helpme please?
    Thanks a lot!
    http://goo.gl/75tBz

  • StageVideo Application Crash iOS - AIR 3.7

    Hey Everyone,
    Just upgraded all my projects from 3.6 to the latest 3.7 beta and I'm coming across issues with StageVideo on iOS which were not present in 3.6. I've looked everywhere for information about what may have been changed in 3.7 but nothing is noted in the release notes? Is there something I am missing?
    Explanation:
    Play a StageVideo (.mp4) on iPad 2,5 (6.1.2), when the video finishes the application crashes without any useful logs anywhere.
    Further Details:
    Here is some further information and a link to a test application I've put together.
    - Flash Builder 4.7
    - AIR 3.7 SDK (April 2, 2013)(overlayed on 3.6 SDK)
    - Mac OS 10.8.2 development machine
    - iPad Mini version 6.1.2 (10B146)
    - Video Format: H.264 AAC 1024x768 Stereo 733KB
    I've exported and uploaded a sample project (2MB) with the problem I've explained which includes a couple of very short videos:
    http://neurocog.com.au/downloads/bugs/AdobeBugReport12.zip
    I'm stumped!
    Ollie.

    Hi there,
    I'm having the same problem. In addition I noticed that if I don't use the ns.dispose(), just ns.close(), the app dosen't crash but smotimes it plays the previous video on top of the current one. (my app is a video player)
    I didn't get the part of the workarround you sugested, can you be more specifice please?
    What do you mean by setting a double-ly ? Where do you put it?
    As far as I understand the onPlayStatus is being called automaticly when stream is finished.
    Any news from adobe yet?
    Thanks,
    Igal

  • Return of the StageVideo Zoom Bug in 3.9 on iOS 7

    This bug was most recently fixed just over a month ago:
         https://bugbase.adobe.com/index.cfm?event=bug&id=3547660
    However, the errant behavior is now happening again in iOS 7 whenever scaling is applied to an mp4 played via StageVideo.
    I've logged a new ticket here, complete with an app demonstrating the problem:
         https://bugbase.adobe.com/index.cfm?event=bug&id=3638394
    More information can be found the following discussions:
    - http://forums.adobe.com/message/4322913
    - http://forums.adobe.com/message/4707408

    Ken,
    please could you describe your workflow. It might help to find some solution. Also it would be great if you can share a sample of your document. Please email it to [email protected] with the reference to this discussion "PDF Portfolio does not work with iOS Reader 11.3.2 on iOS 7.1.2"
    thank you.

  • StageVideo Adobe Air 3.0 iOS Error 1069 |onUpstreamBase not found

    I am using a StageVideo object with Adobe Air 3.0 compiled down and running on an iOS device iPhone 3GS.  The StageVideo appears and attaches to the NetStream just fine.  But after I issue NetStream.play(), I get the following runtime error:
    ReferenceError: Error #1069: Property |onUpstreamBase not found on views.DisplayView and there is no default value.
    You'll notice that the "|onUpstreamBase" contains a "pipe"-character at the beginning.  I tried to add:
    public function onUpstreamBase (dataObject:Object):void {
                                            trace(dataObject.toString());
    to the view function, but that didn't work.  And I can't create a function handler for |onUpsteamBase because of the pipe character.
    I am attaching the Netstream and NetConnection to an recorded H.264 rtmp stream. The rest of my code works just fine, but is failing on this runtime error.
    Anyone else run into this? 
    Thanks in advance.

    I got this error too, but not trying to do anything fancy like Stage Video. The issue is w/the "client" property on the NetStream object. You're supposed to use this to add some event handlers/call back functions that the NetStream will invoke.
    I got this error when I set the client property to "this" and defined the callback functions in my class.  However, that generates this error. If you use a generic object to store the call back function, the error does not occur (b/c the generic object is dynamic)...
    private function onNetStatusConnect():void
    foo = { onMetaData: onMetaData };
    stream=new NetStream(connection);
    stream.client=foo;
    // don't do this
    stream.client=this;
    vid=new Video();
    addChild(vid);
    vid.attachNetStream(stream);
    stream.play(feedAddress);
    public function onMetaData(data:Object):void
    trace(data);

  • StageVideo available but not playing on iOS

    I have made a sample application where I use StageVideo. The StageVideo is available but it is not showing up in the view, neither any audio is being played.
    Any idea what might be wrong?
    Thanks

    Yes I am able to resolve it and it is working on ipad3 .BTW stagevideo doesn't work on desktop
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageVideo. html
    "The StageVideo class is not supported in the AIR desktop or extendedDesktop profiles."
    Following code will work on iOS devices with renderMode set to "direct" :
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView" backgroundColor="0x000000" backgroundAlpha="0"
                        creationComplete="onCreationComplete()"  xmlns:mx="library://ns.adobe.com/flex/mx">
              <fx:Declarations>
                        <!-- Place non-visual elements (e.g., services, value objects) here -->
              </fx:Declarations>
              <fx:Script>
                        <![CDATA[
                                  import mx.core.UIComponent;
                                  private var container:UIComponent;
                                  public function onCreationComplete():void
                                            this.actionBarVisible = false;
                                            this.tabBarVisible = false;
                                            NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
                                            this.addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
                                  private function onAddedToStage(event:Event):void
                                            stage.addEventListener( StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY , stageVideoState );
                                  protected var stream:NetStream ;
                                  protected function stageVideoState( e:StageVideoAvailabilityEvent ):void
                                            var available:Boolean = e.availability == StageVideoAvailability.AVAILABLE ;
                                            if ( available )
                                                      var nc:NetConnection = new NetConnection() ;
                                                      nc.connect(null) ;
                                                      stream = new NetStream(nc) ;
                                                      stream.client = this ;
                                                      var video:StageVideo = stage.stageVideos[0] ;
                                                      video.viewPort = new Rectangle( 100, 100, 500 , 500 ) ;
                                                      video.attachNetStream( stream ) ;
                                                      stream.play( "http://www.overdigital.com/video/Hillman_720p23.976_2400kbps.mp4") ;
                                  public function onMetaData( info:Object ):void
                                  private function handleActivate(event:Event):void
                                            NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
                                  private function handleDeactivate(event:Event):void
                                            NativeApplication.nativeApplication.exit();
                        ]]>
              </fx:Script>
    </s:View>

  • StageVideo with Flex Mobile Project on iOS

    In a Flex Mobile project using StageVideo, StageVideoAvailabilityEvent always returns StageVideoAvailability.UNAVAILABLE.
    I've been reading all day and it looks like StageVideo might not be supported with Flex projects, but I can't find a concrete answer.
    I need a definitive answer, using Flash Builder 4.6, AIR 3.1, and Flash Player 11, can StageVideo be used. If so, any help as to how to get this working would be greatly appreciated.
    Thank you in advance.

    After much trial and error, I finally have a definitive answer. The answer is yes, you can use StageVideo in a Flex Mobile project. To be honest I found StageVideo to be completely useless, at least for what I was hoping to use it for.
    The first big problem is that the StageVideo plays underneath all Flash content. Second, at least on iOS, there were no video controls. I suppose you could roll your own, but I didn't take the time to experiemnt with this. I ended up just using StageWebView.
    More information here: http://www.unfetteredthoughts.net/2012/01/12/embedded-h-264-video-on-ios-with-a-flex-mobil e-project/
    I hope that helps anyone else looking for this.

  • AIR+iOS=StageVideo zoom bug

    Hi,
    Using the StageVideo and Adobe AIR 3.2 SDK for an iOS app brings a strange zoom when the video starts, anyone any ideas of how to solve this problem?, is this a new bug in 3.2 SDK?
    Also a few months ago we  post an issue concatenating videos using the StageVideo where trying to play videos one after each other shows a flashing (video clears itself making impossible to play them seamlessly):
    https://bugbase.adobe.com/index.cfm?event=bug&id=3133620
    http://forums.adobe.com/message/4192764#4192764
    Anyone is experiencing this 2 issues,  any workarounds?
    Thanks

    Hello again,
    Any chance that this bug will be looked at again?
    I see someone else inquired about it here: http://forums.adobe.com/message/5319200
    I have tried to "make some noise" on the bug ticket, but there doesn't seem to be anyone listening.
    For some of us, this is a very signficant problem, as our software requires absolutely precision when a video starts to play, and this bug is effectively breaking that capability.
    Our customers continue to complain, and I have worked around it the best I can by hiding the video until the moment it starts playback, but this is inconsistent at best, because it is essentially nondeterministic - I can't know exactly when the "zoom" effect has stopped, so I either see an "bump" at the tail end of the zoom effect if I show the video too soon, or I skip frames if I hide the video for too long.
    Should I just assume this bug will never be fixed, and that Adobe has abandoned their interest in StageVideo on the iPad?  If that is true, it is criticial for me to know so that I can begin planning on another solution. 
    Thanks for your help.

  • FPS problem with StageVideo (iOS)

    In my app the StageVideo works otherwise just fine, but the problem is that it drops the FPS to 40 from the original 60 and it does not come up to 60 even when the video has ended. I have tried to clear everything related to video after it has ended:
    _video.attachNetStream(null);
    _video.viewPort = null;
    _ns.removeEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
    _ns.client = null;
    _ns.close();
    _ns.dispose();
    _ns = null;
    _videoObject = null;
    _nc.close();
    _nc = null;
    stage.frameRate = 60;
    My app is using GPU rendering. Any ideas for this?

    Hi Guillaume,
    please report the issues at http://bugs.adobe.com/jira/browse/FM .
    From the top of my head, the stagevideo is behind everything else, so you might need to add a layer to intercept the clicks on the video.

  • Does iOS Simulator Support StageVideo

    I've been looking thru the Adobe docs for info on this, but I've not found anything that? it seems that when my app is ran in the simulator, it reports that StageVideo capability is there, but the video never displays, I just hear audio. Once it did display, but the video flickered on/off. So can someone confirm if it is supposed to work on the simulator or not?
    thanks

    I can confirm that the StageVideo in the simulator does work without video, just audio - dependant on hardware setup. However if you can hear the video it means it will play on a device without problems.

  • Adobe Air 3.0 iOS streaming H264/Speex over RTMP -- No Video

    Problem:
    H264/Speex RTMP stream from Flash Media Server doesn't display video.  Audio plays fine.
    Conditions:
    Adobe Air 3.0
    iOS device (iPad 2, iOS4.3)
    App settings:
    <renderMode>direct</renderMode>
    Flash Builder 4.5.1 compiler settings:
    -swf-version=13
    -target-player=11.0.0
    I have tried using both stageVideo and the regular Video object to render an H264 signal streaming from Flash Media Server over rtmp, but with no luck.  I can hear the audio, but the video is never rendered.
    I CAN see H263 video when streamed over RTMP using this setup (with just the Video object). 
    I can also stream a locally stored mp4 (H264/AAC) file over rtmp from the iOS device and play it locally just fine (using a stageVideo object).
    I have attempted this with both stageVideo (which works fine when streaming an mp4 file from the iOS device) and with the regular Video object (the regular Video object handles H263 just fine streaming down from FMS over rtmp).  I've also played around with backgroundAlpha = "0" for this case, all with no luck.
    I've followed all the online instructions and tutorials to get this working for the past week, but have not had any luck.  I'm happy to post more code, but this approach is fairly straight forward and has been described multiple times around these forums and in the adobe blog posts.  It goes like this:
         - instantiate NetConnection (_nc) to FMS and wait for successful connection:
                   _ns = new NetConnection();  
                   _nc.connect(serverAddress);
         - instantiate NetStream (_ns) and connect using NetConnection: 
                   _ns = new NetStream(_nc);
         - setup listener for StageVideoAvailabilityEvent; if stageVideo becomes available, attach _ns: 
                  _stageVideo = stage.stageVideos[0];
                  _stageVideo = _stageVideo.attachNetStream(_ns);
         - if stageVideo ISN'T available, fall back to Video object:
                   _video = new Video();
                   _video.attachNetStream(_ns);
                   stage.addChild(_video);
         - play netStream app:
                   _ns.play(appName);
    My renderMode is set correctly ("direct"), and from what I can tell, this isn't a backgroundAlpha issue.
    I have seen this problem described elsewhere on this forums and on the net. 
    I'd like to know from Adobe: are there any compatibility issues with this approach?  There doesn't seem to be any type of compatibility chart listing which video codecs and transport protocols are available on the different mobile platforms.  Since mobile deployment is so heaviliy fragmented, a descriptive chart or table like this would be helpful for those of us developing -- at least for the main mobile platforms predominantly in use.
    Other forum posts similar to this problem:
    http://forums.adobe.com/message/3981541#3981541
    http://forums.adobe.com/message/3954578#3954578
    Thanks in advance!

    I do hope someone from Adobe is "hearing" this, guys. The lack of RTMP-based H.264 video on the Air for iOS is a major problem, indeed.
    As Fabio Sonnati mentioned in http://sonnati.wordpress.com/2011/04/26/air-2-6-for-ios-and-video-play back/, AIR for iOS does support HTTP streaming (via HLS) of h.264 videos. However, when streaming via RTMP, AIR for iOS only supports VP6 and Spark – a couple of old, retired codecs.
    While HTTP streaming (HLS) seems to be a good option for those who simply want to “play a video” in iOS, I do believe it has some severe limitations, especially for live-communications. I’d like to share some of these thoughts with you.
    1. HLS has ridiculously high latency for live videos (around 40 seconds), when compared to RTMP. Although this may not be a problem for on-demand videos, it sure is a great problem for anyone doing serious live-communications applications (such as webconferencing, live webcasting with audience interaction or Skype-like video chats), which require near-zero latency.
    2. Perhaps someone can correct me on this (hopefully!), but as far as I know, HTTP streaming will not allow cuepoints to be read from videos. This is particularly painful for anyone doing video-triggered actions, such as slide changes (for webinar apps), subtitling or live closed captioning, etc. I read somewhere that OSMF player allows cuepoints (or "temporal metadata". See http://blogs.adobe.com/osmf/2009/11/cue_point_support_in_osmf.html), but I haven't been able to test it myself.
    3. Although HLS it is quite compatible with firewalls (since it flows through port 80), RTMP with tunnelling also flows through port 80 or 443, which adds great compatibility, even on very restricted networks. Our experience with very large clients proves that, hands down.
    In other words, HTTP/HLS streaming is Ok. But it simply does *not* fit into every shoe that RTMP does. We do believe that RTMP remains as our best option for live streaming or serious streaming-oriented *apps* (in which things more complex than “mere video playing in a window” actually happen).
    That all said, I do believe we should let Adobe know about this need. The fact that RTMP streaming in AIR for iOS is limited to VP6 and Spark, which are two “dead” codecs, still puts us, Air developers, in a very fragile position in terms of what we can accomplish with video in iOS.
    I’m sure some of you cheered when you heard about Flash Player 11 having h.264 video encoding. This, (plus the echo cancellation feature that came in 10.3) opened great doors for great Unified-Communication applications to be developed for Flash/Air. Now, it’s undeniable that clients want those applications running on tablets, especially the iPad.
    Not being able to use h.264 via RTMP on iOS is certainly a huge step backwards. Anyone shares this same opinion? What do you guys believe to be the best option to let Adobe really know about this need? Is this limitation a simple lack-of-a-feature (which can be fixed by Adobe) or is this some imposed thing by Apple?
    Just one final note: Air for Android does *not* have the same limitation. It does allow RTMP streaming of h.264.
    Thanks for your attention,
    Helder Conde

  • Flash Builder & StageVideo

    Hello everyone,
    A major concern arises for me, and after several days of testing I can not find a solution.
    I am currently developing a mobile application on Android to play a video locally.
    For this I use the Adobe SimpleStageVideo class available on the website : http://www.adobe.com/devnet/flashplayer/articles/stage_video.html
    At the launch all goes well , however when I switch to another application in full reading and then I go back to my video .
    That passes over other elements of my interface (ie the navigation menu ) and especially it grows.
    I tried to do a resize an event type activate ( to intercept the return on applicaiton )
    I also tried to remove the container, and then reinject the video in my interface ( although this is costly in resources ... ) .
    It did not work .
    I think during my event "activate " the UIComponent has not yet been fully rebuilt, and thereby resize does not work on a good screen size used (since it does not blow conscidère menus ) .
    To test my theory , I tested passing in debug mode. By running my code slower, the video goes back to the right size ...
    So I tried to put timers, but again it was a futile attempt .
    How is it possible when returning to my application that my video remains the right size , and not overlooking the rest of the menus?
    Here follows the code in question :
    // La Vue Permettant de Visionner la Vidéo
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:components="bouton.components.*"
                        xmlns:s="library://ns.adobe.com/flex/spark" title="viewVideo" activate="view1_activateHandler(event)" creationComplete="view1_creationCompleteHandler(event)" backgroundAlpha="0" actionBarVisible="false" tabBarVisible="false">
              <fx:Script>
                        <![CDATA[
                                  import flash.events.MouseEvent;
                                  import mx.core.UIComponent;
                                  import mx.events.FlexEvent;
                                  import valueObjects.SimpleStageVideo;
                                  private var conn:SQLConnection;
                                  private var createStmt:SQLStatement;
                                  public var dbFile:File;
                                  public var fichierCharge:File;
                                  public var numeroBouton:int = 0;
                                  private var test:SimpleStageVideo = new SimpleStageVideo();
                                  private var container:UIComponent = new UIComponent();
                                  protected function view1_creationCompleteHandler(event:FlexEvent):void
                                            var chemin:File = new File(data.url);
                                            test.setData(chemin);
                                            //container.stage = this.stage;
                                            container.height = stage.height;
                                            container.width = stage.width;
                                            container.addChildAt(test, 0);
                                            addElementAt(container, 0);
                                            trace(""+container.width+" : "+container.height+" : "+container.x+" : "+container.y);
                                  protected function view1_activateHandler(event:Event):void
                                            test.resize();
                                  private function resizeF(event:Event):void
                                            test.resize();
                        ]]>
              </fx:Script>
              <s:HGroup  id="barremenu" gap="0" horizontalAlign="left" styleName="header_style" verticalAlign="top" width="100%" contentBackgroundColor="#FFFFFF" contentBackgroundAlpha="1" paddingBottom="50" >
                        <s:Image scaleMode="letterbox" smooth="true" smoothingQuality="high"
                                             source="assets/header_droi.jpg" />
                        <components:Boutton_Retour click="boutton_retour1_clickHandler(event)" enabled="true" height="100%" contentBackgroundColor="#FFFFFF" contentBackgroundAlpha="1"/>
                        <components:Boutton_Accueil_Retour click="boutton_accueil1_clickHandler(event)" enabled="true" height="100%" contentBackgroundColor="#FFFFFF" contentBackgroundAlpha="1" />
                        <s:Image scaleMode="stretch" smooth="true" smoothingQuality="high"
                                             source="assets/header_milieu.jpg" fillMode="repeat" width="60%" height="99%" />
                        <s:Image  scaleMode="stretch" smooth="true" smoothingQuality="high"
                                              source="assets/ipad.jpg" />
              </s:HGroup>
    </s:View>
    // Ma Classe SimpleStageVideo
    package valueObjects
              import flash.display.Loader;
              import flash.display.Shape;
              import flash.display.Sprite;
              import flash.display.Stage;
              import flash.display.StageAlign;
              import flash.display.StageScaleMode;
              import flash.events.Event;
              import flash.events.MouseEvent;
              import flash.events.NetStatusEvent;
              import flash.events.StageVideoAvailabilityEvent;
              import flash.events.StageVideoEvent;
              import flash.events.VideoEvent;
              import flash.filesystem.File;
              import flash.geom.Rectangle;
              import flash.media.StageVideo;
              import flash.media.StageVideoAvailability;
              import flash.media.Video;
              import flash.net.NetConnection;
              import flash.net.NetStream;
              import flash.net.URLRequest;
              import flash.text.TextField;
              import flash.text.TextFieldAutoSize;
              import mx.core.UIComponent;
              import spark.components.Image;
              import spark.components.NavigatorContent;
              [SWF(frameRate="1", backgroundColor="#000000")]
              public class SimpleStageVideo extends Sprite
                        public var chemin:File;
                        private var FILE_NAME:String = "";
                        private static const INTERVAL:Number = 500;
                        private static const BORDER:Number = 20;
                        private var legend:TextField = new TextField();
                        private var sv:StageVideo;
                        private var nc:NetConnection;
                        private var ns:NetStream;
                        private var rc:Rectangle;
                        private var video:Video;
                        private var thumb:Shape;
                        private var interactiveThumb:Sprite;
                        private var totalTime:Number;
                        private var videoWidth:int;
                        private var videoHeight:int;
                        private var outputBuffer:String = new String();
                        private var rect:Rectangle = new Rectangle(0, 0, 0, BORDER);
                        private var videoRect:Rectangle = new Rectangle(0, 0, 0, 0);
                        private var gotStage:Boolean;
                        private var stageVideoInUse:Boolean;
                        private var classicVideoInUse:Boolean;
                        private var accelerationType:String;
                        private var infos:String = new String();
                        private var available:Boolean;
                        private var inited:Boolean;
                        private var played:Boolean;
                        private var container:Sprite;
                        private var displayButtonPause:Boolean;
                        public var imagePause:UIComponent;
                        public var pLoad:Loader;
                        private var testResize:Boolean = false;
                        private var widthStage:int = 0;
                        public function SimpleStageVideo()
                                  // Make sure the app is visible and stage available
                                  addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
                                  //addEventListener(Event.ACTIVATE, onActivate);
                        private function onActivate(event:Event):void
                                  video.addEventListener(Event.RENDER, functionResize);
                        private function functionResize(event:Event):void
                                  resize();
                         * @param event
                        private function onAddedToStage(event:Event):void
                                  // Scaling
                                  stage.scaleMode = StageScaleMode.NO_SCALE;
                                  stage.align = StageAlign.TOP_LEFT;
                                  widthStage = stage.width;
                                  // Thumb seek Bar
                                  thumb = new Shape();
                                  interactiveThumb = new Sprite();
                                  interactiveThumb.addChild(thumb);
                                  addChild(interactiveThumb);
                                  // Connections
                                  nc = new NetConnection();
                                  nc.connect(null);
                                  ns = new NetStream(nc);
                                  ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
                                  ns.client = this;
                                  // Screen
                                  video = new Video();
                                  video.smoothing = true;
                                  // Video Events
                                  // the StageVideoEvent.STAGE_VIDEO_STATE informs you if StageVideo is available or not
                                  stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoState);
                                  // in case of fallback to Video, we listen to the VideoEvent.RENDER_STATE event to handle resize properly and know about the acceleration mode running
                                  video.addEventListener(VideoEvent.RENDER_STATE, videoStateChange);
                                  // Input Events
                                  stage.addEventListener(MouseEvent.DOUBLE_CLICK, onKeyDown);
                                  stage.addEventListener(Event.RESIZE,  onResize);
                                  stage.addEventListener(MouseEvent.CLICK, onClick);
                         * @param event
                        private function onNetStatus(event:NetStatusEvent):void
                                  if ( event.info == "NetStream.Play.StreamNotFound" )
                                            legend.text = "Video file passed, not available!";
                        public function setData(chem:File):void
                                  chemin = chem;
                                  FILE_NAME = chemin.url;
                         * @param event
                        private function onFrame(event:Event):void
                                  var ratio:Number = (ns.time / totalTime) * (widthStage+470);
                                  rect.width = ratio;
                                  thumb.graphics.clear();
                                  thumb.graphics.beginFill(0xFF0000);
                                  thumb.graphics.drawRect(rect.x, rect.y+350, rect.width+120, rect.height);
                                  //thumb.graphics.drawRect(rect.x, rect.y, rect.width, rect.height);
                                  //testResize = true;
                         * @param event
                        private function onClick(event:MouseEvent):void
                                  //ns.pause();
                                  if ( event.stageY >= interactiveThumb.y - BORDER && event.stageX <= stage.stageWidth - BORDER )
                                            var seekTime:Number = (stage.mouseX - BORDER) * ( totalTime / (stage.stageWidth - (BORDER << 1) ) );
                                            ns.seek( seekTime );
                         * @param event
                        private function onKeyDown(event:MouseEvent):void
                                  ns.togglePause();
                                  // Affichage du bouton d'affichage de la mise en pause de la video
                                  if(displayButtonPause == false)
                                            pLoad = new Loader();
                                            pLoad.load(new URLRequest("assets/pause.png"));
                                            //imagePause = new UIComponent();
                                            //imagePause.addChild(pLoad);
                                            //imagePause.x = 200;
                                            //imagePause.y = 200;
                                            pLoad.x = (stage.width - (stage.width/3.5));
                                            pLoad.y = (stage.height - (stage.height/3.5));
                                            addChild(pLoad);
                                            displayButtonPause = true;
                                            pLoad.visible = true;
                                  } else
                                            displayButtonPause = false;
                                            pLoad.visible = false;
                                            removeChild(pLoad);
                         * Permet l'arret de la video avant la supression de la vue
                        public function arretVideo():void
                                  //video.clear();
                                  //sv.attachNetStream(null);
                                  ns.close();
                                  //video.attachNetStream(null);
                                  /*var nce:NetConnection = new NetConnection();
                                  nce.connect(null);
                                  sv.attachNetStream(new NetStream(nce));
                                  //sv.attachNetStream();*/
                         * @param width
                         * @param height
                         * @return
                        private function getVideoRect(width:uint, height:uint):Rectangle
                                  trace("Width" + width);
                                  trace("Stage Width" + stage.stageWidth);
                                  trace("Height" + height);
                                  trace("Stage height" + stage.stageHeight);
                                  var videoWidth:uint = width;
                                  var videoHeight:uint = height;
                                  var scaling:Number = Math.min ( stage.stageWidth / videoWidth, stage.stageHeight / videoHeight );
                                  videoWidth *= scaling, videoHeight *= scaling;
                                  var posX:uint = stage.stageWidth - videoWidth >> 1;
                                  var posY:uint = stage.stageHeight - videoHeight >> 1;
                                  videoRect.x = posX;
                                  videoRect.y = posY;
                                  videoRect.width = videoWidth;
                                  videoRect.height = videoHeight;
                                  trace("Objet video width" + video.width);
                                  trace("Objet video height" + video.height);
                                  trace("Objet video rect width" + videoRect.width);
                                  trace("Objet video rect height" + videoRect.height);
                                  return videoRect;
                        public function resize ():void
                                  if ( stageVideoInUse )
                                            // Get the Viewport viewable rectangle
                                            rc = getVideoRect(sv.videoWidth, sv.videoHeight);
                                            // set the StageVideo size using the viewPort property
                                            sv.viewPort = rc;
                                  } else
                                            // Get the Viewport viewable rectangle
                                            rc = getVideoRect(video.videoWidth, video.videoHeight);
                                            // Set the Video object size
                                            video.width = rc.width;
                                            video.height = rc.height;
                                            video.x = rc.x, video.y = rc.y;
                                            //trace(""+rc.width+" : "+rc.height+" : "+rc.x+" : "+rc.y);
                                            testResize = true;
                                  interactiveThumb.x = BORDER, interactiveThumb.y = stage.stageHeight - (BORDER << 1);
                                  legend.text = infos;
                         * @param evt
                        public function onMetaData ( evt:Object ):void
                                  totalTime = evt.duration;
                                  stage.addEventListener(Event.ENTER_FRAME, onFrame);
                         * @param event
                        private function onStageVideoState(event:StageVideoAvailabilityEvent):void
                                  // Detect if StageVideo is available and decide what to do in toggleStageVideo
                                  toggleStageVideo(available = inited = (event.availability == StageVideoAvailability.AVAILABLE));
                         * @param on
                        private function toggleStageVideo(on:Boolean):void
                                  infos = "StageVideo Running (Direct path) : " + on + "\n";
                                  // If we choose StageVideo we attach the NetStream to StageVideo
                                  if (on)
                                            stageVideoInUse = true;
                                            if ( sv == null )
                                                      sv = stage.stageVideos[0];
                                                      sv.addEventListener(StageVideoEvent.RENDER_STATE, stageVideoStateChange);
                                            sv.attachNetStream(ns);
                                            if (classicVideoInUse)
                                                      // If we use StageVideo, we just remove from the display list the Video object to avoid covering the StageVideo object (always in the background)
                                                      stage.removeChild ( video );
                                                      classicVideoInUse = false;
                                  } else
                                            // Otherwise we attach it to a Video object
                                            if (stageVideoInUse)
                                                      stageVideoInUse = false;
                                            classicVideoInUse = true;
                                            video.attachNetStream(ns);
                                            stage.addChildAt(video, 0);
                                  if ( !played )
                                            played = true;
                                            ns.play(FILE_NAME);
                         * @param event
                        private function onResize(event:Event):void
                                  resize();
                         * @param event
                        private function stageVideoStateChange(event:StageVideoEvent):void
                                  infos += "StageVideoEvent received\n";
                                  infos += "Render State : " + event.status + "\n";
                                  trace(infos);
                                  resize();
                         * @param event
                        private function videoStateChange(event:VideoEvent):void
                                  infos += "VideoEvent received\n";
                                  infos += "Render State : " + event.status + "\n";
                                  trace(infos);
                                  resize();

    Hi,
    Don't know if this is an entirely valid answer as I write pure AS3 (no Flex).
    I remember having problems about a year ago with the SimpleStageVideo when doing a video app that would work for both Apple and Android.
    I couldn't get it to work as I wanted so I skipped SimpleStageVideo alltogether.
    I ended up using this script to shift between StageVideo (iOS) and the usual videoPlayer (Android).
    The stageVideo checks if a menu is open (on the left side) and draws the rect according to that.
    The normal video gets it's size from the videoSprite which scales depending on the menu visibility.
    Later when StageVideo became available for Android it still worked.
    Hopefully it can help you get closer to a solution.
    private function load_video():void{   
        if ( stage.stageVideos.length >= 1 ) {   
            stageVideo = stage.stageVideos[0];
            try {
                if(S.application.menu.toggleOpen == true){
                    stageVideo.viewPort = new Rectangle(S.device.scaledVideo.x, S.device.scaledVideo.y, S.device.scaledVideo.width, S.device.scaledVideo.height);
                } else if(S.application.menu.toggleOpen == false){
                    stageVideo.viewPort = new Rectangle(S.device.video.x, S.device.video.y, S.device.video.width, S.device.video.height);
            } catch(e:Error) {}
            stageVideo.addEventListener(StageVideoEvent.RENDER_STATE, renderState);
            stageVideo.attachNetStream(netStream);
        } else {
            try {
                video = new Video(S.device.video.width, S.device.video.height);
                video.smoothing = true
                video.name = "video"
                video.x = S.device.video.x
                video.y = S.device.video.y
                videoSprite.addChild(video);
                video.attachNetStream(netStream);
            } catch(e:Error) {}
        netStream.play(S.path.video + S.application.xmlObjectArray[currentSlideIndex].video);
        videoStarted = true   

  • StageVideo application crash on mobile devices.

    Hello everyone.
    The last few months, I've been having trouble with StageVideo on selected Android devices and as of today on all iOS 7 devices.
    When I try to switch between the currently playing video and a new one, after a random number of toggles, the application crashes. With the latest update of the iOS, the maximum videos I toggle on my NetStream object is 2, which is extraordinary for a machine such as iPad 4.
    I create all the objects that are nessesary to play a video as I should and check the StageVideo availability on my device so I'm sure that this is a StageVideo issue.
    Here is some of my code:
                // Connections
                nc = new NetConnection();
                nc.connect(null);
                ns = new NetStream(nc);
                ns.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
                ns.client = this;
                // Screen
                video = new Video();
                video.smoothing = true;
                // Video Events
                // the StageVideoEvent.STAGE_VIDEO_STATE informs you if StageVideo is available or not
                stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoState);
                // in case of fallback to Video, we listen to the VideoEvent.RENDER_STATE event to handle resize properly and know about the acceleration mode running
                video.addEventListener(VideoEvent.RENDER_STATE, videoStateChange);
            private function onStageVideoState(event:StageVideoAvailabilityEvent):void
                // Detect if StageVideo is available and decide what to do in toggleStageVideo
                toggleStageVideo(available = inited = (event.availability == StageVideoAvailability.AVAILABLE));
            private function toggleStageVideo(on:Boolean):void
                // If we choose StageVideo we attach the NetStream to StageVideo
                if (on)
                    stageVideoInUse = true;
                    if ( sv == null )
                        sv = stage.stageVideos[0];
                        sv.addEventListener(StageVideoEvent.RENDER_STATE, stageVideoStateChange);
                    sv.attachNetStream(ns);
                    if (classicVideoInUse)
                        // If we use StageVideo, we just remove from the display list the Video object to avoid covering the StageVideo object (always in the background)
                        stage.removeChild ( video );
                        classicVideoInUse = false;
                } else
                    // Otherwise we attach it to a Video object
                    if (stageVideoInUse)
                        stageVideoInUse = false;
                    classicVideoInUse = true;
                    video.attachNetStream(ns);
                    stage.addChildAt(video, 0);
                if ( !played )
                    played = true;
                    ns.play(_videoURL1);
    I would be grateful for any help I could get.

    Could you please open a new bug report on this over at https://bugbase.adobe.com?  When adding the bug, please include some sample code or a sample application so we can quickly test this out internally.  If you'd like to keep this private, feel free to email the attachment to me directly ([email protected]).
    Once added, please post back with the URL so that others effected can add their comments and votes.  I've also given our mobile team a heads up so they can take a look.

  • AIR3.5 for iOS & f4v & iPad, Error #2044: Unhandled NetStatusEvent

    Hello,
    Now, I have to try to play the video on iPad2.
    The video file is f4v.
    But this error occurs
    Error #2044: Unhandled NetStatusEvent:. level=error, code=NetStream.Play.StreamNotFound
    This is my environment
    Flash CS6
    AIR3.5
    iPad2 iOS6
    Use StageVideo
    RenderMode - Direct
    I was able to play flv and mp4 with the same code.
    Only when using the f4v, that error occurs.
    My question is
    Can I play f4v on AIr for iOS ?
    Where is documentation for it?

    thanks random.
    I tryed to change extension. so I was able to play.
    but...
    I had to embed the video cuepoint. the event does not occur at the cue point.
    can't use cuepoint ?

Maybe you are looking for

  • JSP output does not change on Weblogic 5.1 / Visual Age 3.5

    I'm making developmen on Weblogic 5.1 and Visual Age 3.5.           I change a JSP and when I reload it in my browser, I can see that the           page is actually being recompiled, and if there are errors in the           page, error messages are b

  • Error when activate the Adobe forms

    Hi,   I am getting the below error message when activate the adobe forms,and the message tells that to install a forms design tool,please tell me which tool in need to install and where i will get this tool. Could not start Layout Designer (see long

  • How to cancel an incoming payment on prevoius date

    Hi All,              There is an incoming payment posted on 01/06/2009 Posting date. Now I wanted to cancel this incoming payment as on 30/09/2009 posting date. Please give your solution in detail steps. Thankyou, Sree.

  • Fade In Issue MBP

    I'm using Logic 7.2.3 and everytime I record a file, the fade in field shows an * as opposed to 0. This is on every file no matter if I select in a group or just an individual file. Even entering a number in the field only brings back the * and any c

  • Problem syncing photostream in ios 7

    Upgraded to ios 7 on my iPhone 4s and photos no longer push to my photostream on Wi-Fi.  They just stay on the phone's camera roll. I can select them and share  to my stream but am only given the option to post them to a shared stream. Anyone else ex