Skip to main content
rjoshicool
Inspiring
June 1, 2012
Question

StageVideo available but not playing on iOS

  • June 1, 2012
  • 9 replies
  • 3114 views

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

This topic has been closed for replies.

9 replies

User Unknow
Legend
June 1, 2012

Show your sources. Also there is a bug known if you use stage3d aslo - stagevideo will not work if you call it after stage3d

rjoshicool
Inspiring
June 1, 2012

Code I am using is:

<?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"

                    creationComplete="onCreationComplete()"

                    backgroundAlpha="0"

                    backgroundColor="0x000000"

                    title="Video Player" xmlns:mx="library://ns.adobe.com/flex/mx">

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

          <fx:Declarations>

                    <!-- Place non-visual elements (e.g., services, value objects) here -->

          </fx:Declarations>

</s:View>

rjoshicool
Inspiring
June 4, 2012

Any help on this.