Skip to main content
Known Participant
September 19, 2013
Question

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.

This topic is closed to new replies. Start a new post to keep the conversation going.

16 replies

chris.campbell
Legend
September 20, 2013

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 (ccampbel@adobe.com).

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.

Translate
exprpubAuthor
Known Participant
September 23, 2013

Here's the URL of the bug I reported. I'm looking forward to a solution

https://bugbase.adobe.com/index.cfm?event=bug&id=3638033

Translate
Participant
September 24, 2013

Hi Exprpub,

You're mentioning in your bug report a workaround which to use FLV.

Is it solving this crash issue to read FLV files with StageVideo or do we have to use FLV files with a different video player ?

Many thanks

Translate