Packagecom.akamai.net
Classpublic class AkamaiNetStream
InheritanceAkamaiNetStream Inheritance OvpNetStream Inheritance flash.net.NetStream
Subclasses AkamaiEnhancedNetStream

The AkamaiNetStream class extends the OvpNetStream class to provide functionality specific to the Akamai network, such as live stream authentication.



Public Properties
 PropertyDefined By
 InheritedbufferPercentage : Number
[read-only] The buffer percentage currently reported by the stream.
OvpNetStream
 InheritedbufferTimeout : Number
OvpNetStream
 Inheritedclient : Object
[override] [write-only] Sets the client object for this class, to enable integration into existing players which like to receive onMetaData, onPlayStatus etc via callback events.
OvpNetStream
 InheritedcreateProgressivePauseEvents : Boolean
Since the Flash player does not dispatch pause and resume events for progressive download files, setting this property to true, will cause this class to dispatch the proper events when pause or resume is called.
OvpNetStream
 InheritedfastMotionFrameStepAmount : uint
Use this accessor to set the value of the variable that controls how many frames will be stepped over during fast motion playback.
OvpNetStream
 InheritedfastMotionStepInterval : uint
Use this accessor to set the value of the variable that controls how quickly the frames will be stepped over during fast motion playback.
OvpNetStream
 InheritedfastStartMinBufferLength : Number
Added by Will for suppport player
OvpNetStream
 InheritedisBuffering : Boolean
[read-only] Returns the buffering status of the stream.
OvpNetStream
 InheritedisLive : Boolean
The isLive flag is a convenience property.
OvpNetStream
 InheritedisProgressive : Boolean
[read-only] Informs whether the current connection is progressive or not.
OvpNetStream
  liveRetryInterval : Number
Defines the live stream retry interval in seconds
AkamaiNetStream
  liveStreamAuthParams : String
The name-value pairs required for invoking stream-level authorization services against live streams on the Akamai network.
AkamaiNetStream
  liveStreamMasterTimeout : Number
The maximum number of seconds the class should wait before timing out while trying to locate a live stream on the network.
AkamaiNetStream
 InheritedmaxBufferLength : Number
The desired buffer length set for the NetStream, in seconds.
OvpNetStream
 InheritednetConnection : NetConnection
[read-only] Get the NetConnection object this class is using.
OvpNetStream
 Inheritedpanning : Number
The panning of the current NetStream.
OvpNetStream
 InheritedprogressInterval : Number
The interval in milliseconds at which the OvpEvent.PROGRESS event is dispatched.
OvpNetStream
  retryLiveStreamsIfUnavailable : Boolean
If this property is true, then if a live stream is playing and becomes unpublished due to both the primary and backup encoders ceasing to publish, the class will automatically enter into a retry cycle, where it will attempt to play the streams again.
AkamaiNetStream
 InheritedslowMotionFrameStepAmount : uint
Use this accessor to set the value of the variable that controls how many frames will be stepped over during slow motion playback.
OvpNetStream
 InheritedslowMotionStepInterval : uint
Use this accessor to set the value of the variable that controls how quickly the frames will be stepped over during slow motion playback.
OvpNetStream
 InheritedstreamLength : Number
[read-only] The stream length for a progressive download.
OvpNetStream
 InheritedstreamTimeout : Number
The maximum number of seconds the class should wait before timing out while trying to locate a stream on the network.
OvpNetStream
 InheritedtimeAsTimeCode : String
[read-only] Returns the current time of the stream, as timecode HH:MM:SS.
OvpNetStream
 InheriteduseFastStartBuffer : Boolean
Dictates whether a fast start (dual buffer) strategy should be used.
OvpNetStream
 Inheritedvolume : Number
The volume of the NetStream.
OvpNetStream
Protected Properties
 PropertyDefined By
  _akamaiConnection : AkamaiConnection
AkamaiNetStream
  _liveRetryInterval : Number
AkamaiNetStream
  _liveStreamAuthParams : String
AkamaiNetStream
  _liveStreamMasterTimeout : Number
AkamaiNetStream
  _liveStreamRetryTimer : Timer
AkamaiNetStream
  _liveStreamTimeoutTimer : Timer
AkamaiNetStream
  _pendingLiveStreamName : String
AkamaiNetStream
  _playingLiveStream : Boolean
AkamaiNetStream
  _playReissueRequired : Boolean
AkamaiNetStream
  _retryLiveStreamsIfUnavailable : Boolean
AkamaiNetStream
  _successfullySubscribed : Boolean
AkamaiNetStream
Public Methods
 MethodDefined By
  
AkamaiNetStream(connection:Object)
Constructor
AkamaiNetStream
  
close():void
[override] Closes the stream.
AkamaiNetStream
 Inherited
fastMotionOn(forward:Boolean = true, overrideStepRate:Number, overrideStepInterval:Number):void
Turns on fast motion playback - NOTE - for use with FMS streaming
OvpNetStream
 Inherited
getMp3Id3Info(filename:String):Boolean
Initiates the process of extracting the ID3 information from an MP3 file.
OvpNetStream
 Inherited
pause():void
[override]
OvpNetStream
  
play(... arguments):void
[override] This method supports both streaming and progressive playback.
AkamaiNetStream
 Inherited
resume():void
[override]
OvpNetStream
 Inherited
slowMotionOn(forward:Boolean = true, overrideStepRate:Number, overrideStepInterval:Number):void
Turns on slow motion playback - NOTE - for use with FMS streaming
OvpNetStream
 Inherited
Returns playback mode to normal and cleans up.
OvpNetStream
  
unsubscribe():Boolean
Initiates the process of unsubscribing from the active live NetStream.
AkamaiNetStream
Events
 Event Summary Defined By
 InheritedDispatched if the class receives an AsyncErrorEvent.ASYNC_ERROR event.OvpNetStream
 InheritedDispatched when a stream from a server is complete.OvpNetStream
 InheritedDispatched when an embedded cue point is reached while playing a video.OvpNetStream
 InheritedDispatched when the class has detected, by analyzing the NetStream.netStatus events, the end of the stream.OvpNetStream
 InheritedDispatched when an OVP error condition has occurred.OvpNetStream
 InheritedDispatched when the class receives information about ID3 data embedded in an MP3 file.OvpNetStream
 InheritedDispatched when the class receives an image embedded in a H.264 file.OvpNetStream
 InheritedDispatched when the class receives descriptive information embedded in the video file being played.OvpNetStream
 InheritedDispatched if the class' onFI callback is called.OvpNetStream
 InheritedDispatched when the class has completely played a stream or switches to a different stream in a server-side playlist.OvpNetStream
 InheritedDispatched repeatedly at the progressInterval once the class begins playing a stream.OvpNetStream
 InheritedDispatched if metadata matching the name "duration" is received while playing a progressive stream.OvpNetStream
  Dispatched when the class is making a new attempt to subscribe to a live stream.AkamaiNetStream
  Dispatched when the class has successfully subscribed to a live stream.AkamaiNetStream
 InheritedDispatched when the class receives text data embedded in a H.264 file.OvpNetStream
 InheritedDispatched if the trick timer event onTrickMotion callback is called.OvpNetStream
  Dispatched when the class has unsubscribed from a live stream, or when the live stream it was previously subscribed to has ceased publication.AkamaiNetStream
Protected Constants
 ConstantDefined By
  LIVE_RETRY_INTERVAL : Number = 15000
AkamaiNetStream
  LIVE_RETRY_TIMEOUT : Number = 1200000
AkamaiNetStream
Property Detail
_akamaiConnectionproperty
protected var _akamaiConnection:AkamaiConnection

_liveRetryIntervalproperty 
protected var _liveRetryInterval:Number

_liveStreamAuthParamsproperty 
protected var _liveStreamAuthParams:String

_liveStreamMasterTimeoutproperty 
protected var _liveStreamMasterTimeout:Number

_liveStreamRetryTimerproperty 
protected var _liveStreamRetryTimer:Timer

_liveStreamTimeoutTimerproperty 
protected var _liveStreamTimeoutTimer:Timer

_pendingLiveStreamNameproperty 
protected var _pendingLiveStreamName:String

_playingLiveStreamproperty 
protected var _playingLiveStream:Boolean

_playReissueRequiredproperty 
protected var _playReissueRequired:Boolean

_retryLiveStreamsIfUnavailableproperty 
protected var _retryLiveStreamsIfUnavailable:Boolean

_successfullySubscribedproperty 
protected var _successfullySubscribed:Boolean

liveRetryIntervalproperty 
liveRetryInterval:Number

Defines the live stream retry interval in seconds

The default value is 15.


Implementation
    public function get liveRetryInterval():Number
    public function set liveRetryInterval(value:Number):void

See also

liveStreamAuthParamsproperty 
liveStreamAuthParams:String


Implementation
    public function get liveStreamAuthParams():String
    public function set liveStreamAuthParams(value:String):void

See also

liveStreamMasterTimeoutproperty 
liveStreamMasterTimeout:Number

The maximum number of seconds the class should wait before timing out while trying to locate a live stream on the network. This time begins decrementing the moment a play request is made against a live stream, or after the class receives an onUnpublish event while still playing a live stream, in which case it attempts to automatically reconnect. After this master time out has been triggered, the class will issue an OvpError.STREAM_NOT_FOUND event .

The default value is 1200.


Implementation
    public function get liveStreamMasterTimeout():Number
    public function set liveStreamMasterTimeout(value:Number):void
retryLiveStreamsIfUnavailableproperty 
retryLiveStreamsIfUnavailable:Boolean

If this property is true, then if a live stream is playing and becomes unpublished due to both the primary and backup encoders ceasing to publish, the class will automatically enter into a retry cycle, where it will attempt to play the streams again. Similarly, if a play request is made and the live stream is not found, the class will reattempt the streams at a predefined interval. This interval is set by the liveRetryInterval. The retries will cease and timeout once the liveRetryTimeout value has elapsed without a successfull play.

The default value is true.


Implementation
    public function get retryLiveStreamsIfUnavailable():Boolean
    public function set retryLiveStreamsIfUnavailable(value:Boolean):void

See also

Constructor Detail
AkamaiNetStream()Constructor
public function AkamaiNetStream(connection:Object)

Constructor

Parameters
connection:Object — This object can be either an OvpConnection object or a NetConnection object. If an OvpConnection object is provided, the base class constructor will use the NetConnection object within it.

If you are connecting to a live stream on the Akamai network, we recommend passing in an AkamaiConnection object.
Method Detail
close()method
override public function close():void

Closes the stream.

See also

flash.net.NetStream.close()
play()method 
override public function play(... arguments):void

This method supports both streaming and progressive playback.

Streaming playback: The stream name argument format will vary depending on the type of file you are streaming. The various conventions are best understood if we explain how the server processes the filename that it receives. If there is no reserved prefix at the start of the file, then FMS assumes that an FLV file is being played and will automatically append a ".flv" to the end of the stream name when retrieving the file from storage. If the stream name begins with "mp3:" then the server assumes that an .mp3 file is being played and will add a ".mp3" extension to the filename. If the stream beins with "mp4:" then the server assumes a H.264 file is being played and will add a ".mp4" extension unless it detects another extension already there. Given this server-side behavior, the following stream naming rules apply:

Examples of valid stream names include: Examples of invalid stream names include:

Progressive playback: The stream name argument must be an absolute or relative path to a FLV or H.264 file and must include the file extension. MP3 files cannot be played through this class using progressive playback. Ensure that the Flash player security sandbox restrictions do not prohibit the loading of the MP3 from the source being specified. Examples of valid stream arguments for progressive playback include:

Note that playback of H.264 files, both streaming and progressive, requires a flash client version greater than 9.0.60.

Parameters

... arguments — name of the stream to play.

unsubscribe()method 
public function unsubscribe():Boolean

Initiates the process of unsubscribing from the active live NetStream. This method can only be called if the class is currently subscribed to a live stream. Since unsubscription is an asynchronous process, confirmation of a successful unsubscription is delivered via the OvpEvent.UNSUBSCRIBED event.

Returns
Boolean — true if previously subscribed, otherwise false.
Event Detail
subscribeattempt Event
Event Object Type: org.openvideoplayer.events.OvpEvent
OvpEvent.type property = OvpEvent.SUBSCRIBE_ATTEMPT

Dispatched when the class is making a new attempt to subscribe to a live stream.

See also

subscribed Event  
Event Object Type: org.openvideoplayer.events.OvpEvent
OvpEvent.type property = OvpEvent.SUBSCRIBED

Dispatched when the class has successfully subscribed to a live stream.

See also

unsubscribed Event  
Event Object Type: org.openvideoplayer.events.OvpEvent
OvpEvent.type property = OvpEvent.UNSUBSCRIBED

Dispatched when the class has unsubscribed from a live stream, or when the live stream it was previously subscribed to has ceased publication.

See also

Constant Detail
LIVE_RETRY_INTERVALConstant
protected const LIVE_RETRY_INTERVAL:Number = 15000

LIVE_RETRY_TIMEOUTConstant 
protected const LIVE_RETRY_TIMEOUT:Number = 1200000