Highlighted

AIR 15 and iOS StageVideo

Adobe Community Professional ,
Aug 07, 2014

Copy link to clipboard

Copied

Do you have any sample code for StageVideo, that is capable of playing embedded H.264 .mp4 files? With AIR 14 I have not been able to achieve that. My suspicion is that StageVideo is failing somehow, and the fallback of playing H.264 netstream in a Video object doesn't seem to work. Does it now work with the automatic fallback?

Playing remote video with StageVideo in iOS works fine in AIR 14.

TOPICS
Air beta

Views

960

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

AIR 15 and iOS StageVideo

Adobe Community Professional ,
Aug 07, 2014

Copy link to clipboard

Copied

Do you have any sample code for StageVideo, that is capable of playing embedded H.264 .mp4 files? With AIR 14 I have not been able to achieve that. My suspicion is that StageVideo is failing somehow, and the fallback of playing H.264 netstream in a Video object doesn't seem to work. Does it now work with the automatic fallback?

Playing remote video with StageVideo in iOS works fine in AIR 14.

TOPICS
Air beta

Views

961

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 07, 2014 1
Adobe Community Professional ,
Aug 07, 2014

Copy link to clipboard

Copied

To add to this, sometimes local StageVideo does work, but always when it does work the app goes on to crash when the stream is closed. That remains true in AIR 15.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 07, 2014 0
Adobe Community Professional ,
Aug 07, 2014

Copy link to clipboard

Copied

So, I managed to figure out the reasons why StageVideo sometimes wouldn't kick in, and also why when it kick in it would crash on exit.

Sample code online shows to use this:

StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY

It turns out that in iOS that event may have happened already, before the point where you add the listener. I've changed things to be like this:

if ( stage.stageVideos.length >= 1 ) {

       _enableStageVideo();

  }else{

       _stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, _onStageVideoAvailability);

  }

Most times the stage.stageVideos has settled down, and there's no need to listen for the availibility.

The crashing on exit was because you can't do this:

_stagevideo.attachStream(null);

_ns.close(); //etc

you have to do this:

_ns.close(); //etc

_stagevideo.attachStream(null);

So, that just leaves a request here of sample code for the AIR 15 way of working. Under AIR 14 I have all the Video fallback code too, and it would be nice to strip that out.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 07, 2014 1
Engaged ,
Aug 11, 2014

Copy link to clipboard

Copied

I just had to say thank you for including this little snip of code as I never would have thought to check to see if the StageVideo objects were already available before my player was done initializing. I have been working on a giant media package for audio and video players on and off for a year now and hadn't even considered that as a possibility for StageVideo.

What are your thoughts on AIR15 beta currently including a default Video object fallback and always reporting "available" even when it isn't? If the Flash Player doesn't provide a reference to the Video object it generates and adds to the display list, it seems like that could cause the developer to have to do a little more work to properly remove the Video object for garbage collection. Im currently going by the information in the release notes as I haven't had time to download the beta and check out the updated API to see if it does do this.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 11, 2014 0
Adobe Community Professional ,
Aug 11, 2014

Copy link to clipboard

Copied

My bet is that if it transparently uses video if need be, it also transparently gets rid of it when you dispose of stage video.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 11, 2014 0
Engaged ,
Aug 11, 2014

Copy link to clipboard

Copied

I (clearly) hadn't considered that. Im just used to being as tidy as possible about not having any memory leaks and properly shutting down every object after it is no longer being used. Im a bit of a control freak on that front, always wanting to be as optimized as possible.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 11, 2014 0