Packagecom.akamai.net
Classpublic class AkamaiNetLoader
InheritanceAkamaiNetLoader Inheritance flash.events.EventDispatcher

AkamaiNetLoader is a class which will accept a string resource to Akamai HDN 1 content or RTMP content, inspect the type and then create and connect the appropriate NetConnection and NetStream objects to enable a player to render that resource.

This class is not to be used for HDS (HTTP Dynamic Streaming) content. For HDS playback use the AkamaiStreamController class.

View the examples



Public Properties
 PropertyDefined By
  HDPrimaryToken : String
Primary token used to connect to Akamai HD 1.0 Streams.
AkamaiNetLoader
  mediaType : String
[read-only] Returns the media type of the resource
AkamaiNetLoader
  MEDIA_TYPE_NOT_ACCEPTED : String = This class is for use with HDN 1.0 and RTMP stream types only. For HDS, you should use AkamaiStreamController class
[static]
AkamaiNetLoader
  netStream : NetStream
[read-only] Returns the NetStream instance established by the class
AkamaiNetLoader
  ovpConnection : OvpConnection
[read-only] Returns the OvpConnection instance established by the class.
AkamaiNetLoader
  ready : Boolean
[read-only] Since type inspection is an asynchronous operaiton, the ready flag turns true once the inspection process is complete.
AkamaiNetLoader
  rtmpConnectionAuth : String
The connection level auth token for playing secure RTMP VOD streams over Akamai.
AkamaiNetLoader
  rtmpStreamAuth : String
The stream level auth token for playing secure RTMP live streams over Akamai.
AkamaiNetLoader
  streamName : Object
[read-only] Returns the the stream name associated with the resource.
AkamaiNetLoader
  version : String
[read-only] Returns the current version of the library
AkamaiNetLoader
Public Methods
 MethodDefined By
  
AkamaiNetLoader(target:IEventDispatcher = null)
Constructor
AkamaiNetLoader
  
initialize(resource:String):void
initialize is called to initiate the process of inspecting the resource type and establishing the appropriate NetConneciton and NetStreams.
AkamaiNetLoader
Events
 Event Summary Defined By
  Dispatched when the class has completed initializing the relevant NetConnection and NetStream objects for the resource.AkamaiNetLoader
  Dispatched when the class has a debug message to send.AkamaiNetLoader
  Dispatched when the class encounters an error.AkamaiNetLoader
Property Detail
HDPrimaryTokenproperty
HDPrimaryToken:String

Primary token used to connect to Akamai HD 1.0 Streams.


Implementation
    public function get HDPrimaryToken():String
    public function set HDPrimaryToken(value:String):void
MEDIA_TYPE_NOT_ACCEPTEDproperty 
public static var MEDIA_TYPE_NOT_ACCEPTED:String = This class is for use with HDN 1.0 and RTMP stream types only. For HDS, you should use AkamaiStreamController class

mediaTypeproperty 
mediaType:String  [read-only]

Returns the media type of the resource


Implementation
    public function get mediaType():String

See also

netStreamproperty 
netStream:NetStream  [read-only]

Returns the NetStream instance established by the class


Implementation
    public function get netStream():NetStream
ovpConnectionproperty 
ovpConnection:OvpConnection  [read-only]

Returns the OvpConnection instance established by the class. To reach the NetConnection itself, use ovpConnection.netConnection.


Implementation
    public function get ovpConnection():OvpConnection

See also

org.openvideoplayer.net.OvpConnection
readyproperty 
ready:Boolean  [read-only]

Since type inspection is an asynchronous operaiton, the ready flag turns true once the inspection process is complete. Once the class is ready, the mediaType, netStream, streamname and ovpConneciton properties can be read.


Implementation
    public function get ready():Boolean

See also

rtmpConnectionAuthproperty 
rtmpConnectionAuth:String

The connection level auth token for playing secure RTMP VOD streams over Akamai.


Implementation
    public function get rtmpConnectionAuth():String
    public function set rtmpConnectionAuth(value:String):void
rtmpStreamAuthproperty 
rtmpStreamAuth:String

The stream level auth token for playing secure RTMP live streams over Akamai.


Implementation
    public function get rtmpStreamAuth():String
    public function set rtmpStreamAuth(value:String):void
streamNameproperty 
streamName:Object  [read-only]

Returns the the stream name associated with the resource. This stream name can be a String, com.akamai.hd.IMBRObject or a org.openvideoplayer.net.dynamicstream.DynamicStreamItem.


Implementation
    public function get streamName():Object

See also

org.openvideoplayer.net.dynamicstream.DynamicStreamItem
com.akamai.hd.IMBRObject
versionproperty 
version:String  [read-only]

Returns the current version of the library


Implementation
    public function get version():String
Constructor Detail
AkamaiNetLoader()Constructor
public function AkamaiNetLoader(target:IEventDispatcher = null)

Constructor

Parameters
target:IEventDispatcher (default = null)
Method Detail
initialize()method
public function initialize(resource:String):void

initialize is called to initiate the process of inspecting the resource type and establishing the appropriate NetConneciton and NetStreams.

Parameters

resource:String — a string representing a path to any Akamai media asset, including AMD SBR, HDN SBR and SMIL files for both AMD and HDN.


Throws
IllegalOperationError — if the resource is an HDS (HTTP Dynamic Streaming) resource.
Event Detail
complete Event
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched when the class has completed initializing the relevant NetConnection and NetStream objects for the resource.

debug Event  
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched when the class has a debug message to send.

error Event  
Event Object Type: org.openvideoplayer.events.OvpEvent

Dispatched when the class encounters an error. The data property in this case will contain an error string.

Examples
Example usage:
     var loader:AkamaiNetLoader = new AkamaiNetLoader();
     loader.addEventListener(OvpEvent.COMPLETE, onNetLoaderComplete);
     loader.addEventListener(OvpEvent.ERROR, onError);
     loader.addEventListener(OvpEvent.DEBUG, onDebug);
     loader.initialize(MEDIA);
     
     private function onNetLoaderComplete(event:OvpEvent):void
     {
       video.attachNetStream(netLoader.netStream);
       netLoader.netStream.play(netLoader.streamName);
     }
     
     private function onError(event:OvpEvent):void
     {
          trace("The netloader encountered an error: " + (event.data as String));
     }
     
     private function onDebug(event:OvpEvent):void
     {
          trace(event.data as String);
     }