2 Replies Latest reply on Oct 13, 2011 9:18 AM by BoozyMondango

    Cannot get OSMF to play AkamaiHD stream from SMIL file

    BoozyMondango Level 1

      I have built a player that can play using this smil file fine using the akamaiHDCore library, but I cannot get OSMF to work with it.  You can see the video with the test player below.


      http://mediapm.edgesuite.net/edgeflash/public/debug/HDPlayer.html?url=http://mediapm.edges uite.net/edgeflash/public/debug/assets/smil/earth2.smil


      I am using the sample app SimplePlugin that has been modified to load the smil, and akamaibasicstreaming plugin.


      Can someone elighten me as to what might be wrong?  It loads the smil file fine as well as the plugins, but then just does nothing.  No debug output at all.  Code Below:





      public class WT08_SimplePlugin extends MovieClip






              // Plugin path

              private static const SMIL_PLUGIN:String = "org.osmf.smil.SMILPluginInfo";

              private static const BASIC_STREAMING_PLUGIN:String = "com.akamai.osmf.AkamaiBasicStreamingPluginInfo";



              // Media paths

              public static const MEDIA_PATH:String = "http://mediapm.edgesuite.net/jawyllie/edgeflash_benchmark.smil";


              public var player:MediaPlayer;

              public var container:MediaContainer;

              public var mediaFactory:MediaFactory;


              private var t:int = 0;






              public function WT08_SimplePlugin()


                  stage.scaleMode = StageScaleMode.NO_SCALE;

                  stage.align = StageAlign.TOP_LEFT;








              protected function initPlayer():void


                  // Create a mediafactory instance

                  mediaFactory = new MediaFactory();


                  //Marker 1: Add the listeners for the plugin load call

                  mediaFactory.addEventListener( MediaFactoryEvent.PLUGIN_LOAD, onPluginLoaded );

                  mediaFactory.addEventListener( MediaFactoryEvent.PLUGIN_LOAD_ERROR, onPluginLoadFailed );


                  //the simplified api controller for media

                  player = new MediaPlayer();

                  player.autoDynamicStreamSwitch = true;

                  //the container (sprite) for managing display and layout

                  container = new MediaContainer();           


                  //Adds the container to the stage

                  this.addChild( container );


                  //Marker 2: Load the plugin

                  loadPlugin( BASIC_STREAMING_PLUGIN );

                  loadPlugin( SMIL_PLUGIN );





              private function loadPlugin( source:String ):void


                  //Marker 3: Create the plugin resource using a static plugin

                  var pluginResource:MediaResourceBase;

                  var pluginInfoClass:Class = getDefinitionByName( source ) as Class;

                  pluginResource = new PluginInfoResource( new pluginInfoClass() );



                  //Marker 4: Load the plugin

                  mediaFactory.loadPlugin( pluginResource );



              protected function onPluginLoaded( event:MediaFactoryEvent ):void


                  trace( "onPluginLoaded()" );


                  if(this.t == 1){



                      this.t = 1;




              protected function onPluginLoadFailed( event:MediaFactoryEvent ):void{

                  trace( "onPluginFailedLoad()" );



              protected function removeMediaFactoryEventListeners():void


                  mediaFactory.removeEventListener( MediaFactoryEvent.PLUGIN_LOAD, onPluginLoaded );

                  mediaFactory.removeEventListener( MediaFactoryEvent.PLUGIN_LOAD_ERROR, onPluginLoadFailed );



              protected function loadMedia():void


                  //Marker 6: The pointer to the media

                  var resource:URLResource = new URLResource( MEDIA_PATH );

                  var element:MediaElement = mediaFactory.createMediaElement( resource );


                  // Add the media element

                  player.media = element;

                  container.addMediaElement( element );



        • 1. Re: Cannot get OSMF to play AkamaiHD stream from SMIL file
          Silviu Vergoti Adobe Employee



          Please set player.autoPlay=true before adding the element to start playback.

          Can you test with another smil? Like http://mediapm.edgesuite.net/osmf/content/test/smil/elephants_dream.smil .



          • 2. Re: Cannot get OSMF to play AkamaiHD stream from SMIL file
            BoozyMondango Level 1

            Thanks,  ive tried that smil but it does not work either.


            Maybe the akamaibasicplugin might be too far out of date with my swc HDCore-v2.2.27.swc I am using.  


            When I use the elephants smil it throws an error in the AkamaiNetStream super constructor about needing the NetConnection connected to null.  Which makes sense for streaming.  Again all these smil files for fine with the test player and the AkamaiMediaSprite ive used before.   I would just like to leverage some of the osmf features like vast support and skinning.





            [SWF] C:\Inetpub\wwwroot\samples\bin-debug\WT08_SimplePlugin.swf - 688,615 bytes after decompression

            Thu Oct 13 2011 11:13:57 AM [INFO] [org.osmf.net.NetNegotiator] Attempting connection to rtmp://cp67126.edgefcs.net:1935/ondemand

            Thu Oct 13 2011 11:13:57 AM [INFO] [org.osmf.net.NetNegotiator] Attempting connection to rtmp://cp67126.edgefcs.net:443/ondemand

            Thu Oct 13 2011 11:14:02 AM [INFO] [org.osmf.net.NetNegotiator] FMS Version: 3,5,7,7009

            Thu Oct 13 2011 11:14:02 AM [INFO] [org.osmf.net.NetConnectionFactory] NetConnection established with: rtmp://cp67126.edgefcs.net:443/ondemand

            ArgumentError: NetConnection must be null

                at com.akamai.hd::HDNetStream()

                at com.akamai.net::AkamaiHDNetStream()

                at com.akamai.osmf.net::AkamaiNetStream()[C:\Inetpub\wwwroot\samples\src\com\akamai\osmf\net \AkamaiNetStream.as:68]

                at com.akamai.osmf.net::AkamaiNetLoader/createNetStream()[C:\Inetpub\wwwroot\samples\src\com \akamai\osmf\net\AkamaiNetLoader.as:72]

                at org.osmf.net::NetLoader/finishLoading()

                at org.osmf.net::NetLoader/processCreationComplete()

                at org.osmf.net::NetLoader/onCreationComplete()

                at flash.events::EventDispatcher/dispatchEventFunction()

                at flash.events::EventDispatcher/dispatchEvent()

                at Function/<anonymous>()

                at flash.events::EventDispatcher/dispatchEventFunction()

                at flash.events::EventDispatcher/dispatchEvent()

                at NetNegotiator/onNetStatus()