• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

StageVideo on iOS

New Here ,
Apr 24, 2014 Apr 24, 2014

Copy link to clipboard

Copied

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);

}      

TOPICS
Development

Views

329

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
community guidelines
LEGEND ,
Apr 24, 2014 Apr 24, 2014

Copy link to clipboard

Copied

You won’t be allowed to submit an AIR 3.8 based app to the App Store, so you ought to change over to using the current version of AIR, which is AIR 13. There may well have been StageVideo fixes in AIR 3.9, 4.0, or 13, so it’s worth giving it a try.

Votes

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
community guidelines
New Here ,
Apr 24, 2014 Apr 24, 2014

Copy link to clipboard

Copied

LATEST

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

Votes

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
community guidelines