Packagecom.akamai.hd
Classpublic class HDNetStream
InheritanceHDNetStream Inheritance flash.net.NetStream
Subclasses AkamaiHDNetStream

HDNetStream is the core class for interacting with the Akamai HD HTTP streaming solution. The class encapsulates the multi-bitrate and dynamic streaming features of the solution in a easy-to-consume interface that is already familiar to flash developers - the NetStream.



Public Properties
 PropertyDefined By
  analyticsBeacon : String
Activates the built-in Akamai Client Side Media Analytics plugin, by specifying the beacon path that the plugin should track against.
HDNetStream
  analyticsPluginLoaderInstance : AnalyticsPluginLoader
Use this accessor instead of the analyticsBeacon accessor if you want to add multiple instances of the plugin in the same player.
HDNetStream
  autoRecoverFromTimeout : Boolean
Specifies whether the class should automatically try to recover from a timeout.
HDNetStream
  autoSwitch : Boolean
Defines whether the class should automatically switch between available bitrates.
HDNetStream
  averagePlaybackBitsPerSecond : Number
[read-only] The smoothed and averaged playback bits per second.
HDNetStream
  bandwidthEstimationEnabled : Boolean
[read-only] Returns a Boolean value representing whether bandwidth estimation for MBR content at startup is enabled.
HDNetStream
  bufferLength : Number
[override] [read-only] Returns the buffer length in seconds
HDNetStream
  bufferTime : Number
[override] [Setter is DEPRECATED] Returns the current target buffer time on the netstream.
HDNetStream
  bytesLoaded : uint
[override] [read-only] Returns the bytes loaded since the last play request.
HDNetStream
  client : Object
[override] Sets the client property of the NetStream.
HDNetStream
  considerDimensionsWhenSwitching : Boolean
If enabled, the class will not switch up during multi-bitrate playback if the area that the video is being rendered at is smaller than the the native size of video.
HDNetStream
  cpu : Number
[read-only] The system cpu as a percentage.
HDNetStream
  currentIndex : int
The current index that is rendering for a MBR object source.
HDNetStream
  currentIndexBitrate : Number
[read-only] The bitrate value of the current index,, in kbps.
HDNetStream
  disableAllArchivePlayback : Boolean
If set true, this property will prohibit the class from playing back the archive portion of a live stream.
HDNetStream
  displayObject : DisplayObject
A reference to any object that participates in the display stack and which has a access to the "stage" property.
HDNetStream
  downloadRatio : Number
[read-only] The downloadRatio is the ratio of the rate at which bytes are being downloaded over the rate at which they are being rendered.
HDNetStream
  droppedFPS : Number
[read-only] The estimated dropped-frame rate, expressed in Hz.
HDNetStream
  droppedFrames : uint
[read-only] Returns the absolute count of dropped frames since the last play request
HDNetStream
  duration : Number
[read-only] Returns the duration of the stream in seconds.
HDNetStream
  durationAsTimeCode : String
[read-only] Returns the duration of the stream as HH:MM:SS timecode
HDNetStream
  dvrWindow : Number
[read-only] Specifies the length of the DVR window, if implemented, in seconds.
HDNetStream
  edgeIP : String
Returns the IP address of the Akamai Edge Server to which the client has connected.
HDNetStream
  edgeVersion : String
Returns the version of the Akamai Edge Server to which the client has connected.
HDNetStream
  enableAlternateServerMapping : Boolean
If there is an issue with the stream at startup or during playback it may be caused by a server condition.
HDNetStream
  enableEndUserMapping : Boolean
If you enable this feature and enableAlternateServerMapping is not enabled - enableAlternateServerMapping will be enabled.
HDNetStream
  enableNetSessionDiscovery : Boolean
Enables the class to discover the NetSession interface .
HDNetStream
  estimatedCurrentBandwidth : Number
[read-only] The estimated current throughput between client and server, expressed in kilobits per second.
HDNetStream
  estimatedMaxbandwidth : Number
[read-only] The estimated maximum throughput between client and server, expressed in kilobits per second.
HDNetStream
  estimatedRTT : Number
[read-only] The estimated round-trip time between client and server, expressed in milliseconds.
HDNetStream
  isAsleep : Boolean
[read-only] eturns whether the flash runtime is in sleep mode.
HDNetStream
  isComplete : Boolean
[read-only] True if the stream has ended
HDNetStream
  isLiveStream : Boolean
[read-only] Specifies whether the stream playing is "live".
HDNetStream
  isPausedWhileLive : Boolean
[read-only] True if the stream has was paused while isPlayingLive was true.
HDNetStream
  isPlayingLive : Boolean
[read-only] Specifies whether the the stream is playing at "true" live.
HDNetStream
  isSwitching : Boolean
[read-only] Defines whether the class is currently executing a switch.
HDNetStream
  lastThrottleValue : Number
[read-only] The last throttle value requested form the server.
HDNetStream
  liveDrift : Number
[read-only] For live streams only, the estimated difference between the duration that the class is rendering and the latest duration that the server has, in seconds.
HDNetStream
  loop : Boolean
If enabled, once the stream is complete it will loop back and begin playing from the start.
HDNetStream
  maxBufferLength : Number
Specifies the maximum buffer length in seconds to allow when a) the class is paused b) single bitrate content is playing c) multi-bitrate content is playing at the highest rendition available.
HDNetStream
  maximizeSingleBitrateBuffers : Boolean
Specifies wether the class should set the target buffer to a high value (default is 60s) for non-live single-bitrate content and for non-live multi-bitrate content where you are playing the highest available index.
HDNetStream
  maximumBitrateAllowed : Number
When switching multi-bitrate content in auto-mode, this property specifies the maximum stream bitrate, in kbps, that the class is allowed to play.
HDNetStream
  maxIndexAvailable : Number
[read-only] The highest index available for the current MBR object.
HDNetStream
  maxIndexAvailableBitrate : Number
[read-only] The bitrate value of the highest index that is available, in kbps.
HDNetStream
  maxLiveDriftAllowed : Number
[DEPRECATED] The maximum live drift value allowed, in seconds.
HDNetStream
  maxSecondsWithoutData : Number
[read-only] The maximum number of seconds that the class has not received data while playing.
HDNetStream
  MBRObject : IMBRObject
[read-only] The current IMBRObject instance that the class is playing MBR content, or else null for SBR.
HDNetStream
  netSessionAcceptedEULA : Boolean
[read-only] Returns whether the Akamai NetStession client has had its EULA accepted.
HDNetStream
  netSessionClientAvailable : Boolean
[read-only] Returns true if the Akamai NetSession client is installed on the client machine.
HDNetStream
  netSessionCpCode : String
[write-only] Sets the CP code that the Akamai NetSession client will use.
HDNetStream
  nominalFPS : Number
[read-only] The estimated frame rate of the video.
HDNetStream
  playbackKbps : Number
[read-only] Returns the playback bitrate of the current stream, in kbps.
HDNetStream
  playerIP : String
Returns the IP address of this player.
HDNetStream
  primaryToken : String
[write-only] Sets the primaryToken for the class to use to perform EdgeAuthentication against the Akamai network.
HDNetStream
  qualityOfExperience : Number
[read-only] The quality of experience metric is a single number (with a range of 0-100) which attempts to sum up the quality of the playback experience.
HDNetStream
  reachedTargetBufferFull : Boolean
[read-only] True if the stream has reached its target buffer after starting.
HDNetStream
  requiresEdgeAuth : Boolean
[DEPRECATED] - this property is maintained only to ensure backwards compatibility.
HDNetStream
  resumeDVRAtLive : Boolean
When set to false, if you pause a live stream, the stream will resume playing at the point at which it was paused.
HDNetStream
  secondsUntilBufferEmpties : Number
[read-only] The estimated time in seconds until the buffer is empty.
HDNetStream
  soundTransform : SoundTransform
[override] Sets the soundTransform object of the stream.
HDNetStream
  source : *
[read-only] Returns the source object which the class is currently playing.
HDNetStream
  startingBitrate : Number
Sets the max bitrate value you wish to use at startup in kbps.
HDNetStream
  startingBufferTime : Number
Setting this value will effect the startup time of the stream.
HDNetStream
  startingIndex : Number
The starting index to use when playing MBR content.
HDNetStream
  streamStartTime : Number
[read-only] The real world start time of the stream, in milliseconds since midnight January 1, 1970, universal time.
HDNetStream
  streamType : int
Returns in integer representing the type of stream content that is currently rendering.
HDNetStream
  time : Number
[override] [read-only] Returns the playhead time of the stream in seconds.
HDNetStream
  timeAsTimeCode : String
[read-only] Returns the playhead time of the stream as HH:MM:SS timecode
HDNetStream
  tokenService : ITokenService
[write-only] Sets the token service that the class will use to request an EdgeAuth token.
HDNetStream
  trueBufferTime : Number
[read-only] The raw bufferTime value of the underlying netstream class.
HDNetStream
  useFixedThrottleForSBR : Boolean
For single-bite rate content, there can be minimal benefit in constant throttle commands being issued.
HDNetStream
  useVerboseGhostLogs : Boolean
[write-only] Toggles use of verbose logging on GHost.
HDNetStream
  volume : Number
Sets the volume of the stream.
HDNetStream
Public Methods
 MethodDefined By
  
HDNetStream(connection:NetConnection)
Constructor.
HDNetStream
  
Checks to see if the Akamai NetSessionClient is installed on this machine.
HDNetStream
  
close():void
[override] Closes the NeStream and stops all running timers
HDNetStream
  
destroy():void
Prepares the class instance for deletion by cleaning out objects that may be held in memory.
HDNetStream
  
enableMBRIndexStableBuffer(enabled:Boolean = true, observationPeriod:Number, bufferIncrease:Number):void
In version v2.5 a feature was added to help stabilize the buffer by increasing it by 10 seconds per index once the index has been playing without a switch for more than 25 seconds.
HDNetStream
  
getQoSManager():HDN1QoSManager
This is for unit testing only.
HDNetStream
  
installNetSessionClient(filename:String = NetSessionInstaller, acceptedEula:Boolean = false, eulaVersion:String = Unknown EULA version):void
Installs the Akamai NetSession client with a given filename and optional acceptance of the EULA and specificaiton of the EULA version.
HDNetStream
  
Returns whether or not the class is playing multi-bitrate content.
HDNetStream
  
Triggers the class to make a request to the server for an updated TAT time.
HDNetStream
  
Sends a request to the Akamai NetSession client indicating that the user has accepted the EULA.
HDNetStream
  
pause():void
[override] Pauses the video.
HDNetStream
  
play(... args):void
[override] Commences playback of content through this netstream.
HDNetStream
  
resume():void
[override] Resumes playback of paused video.
HDNetStream
  
secondsToTimeCode(value:Number):String
A utility function for converting seconds into HH:MM:SS timecode.
HDNetStream
  
seek(value:Number):void
[override] Seek the stream.
HDNetStream
  
Triggers the class to dispatch an update its stats.
HDNetStream
  
setBandwidthEstimationEnabled(enabled:Boolean, bandwidthEstimationPeriodInSeconds:Number = 1):void
This method should only be used for MBR content and must be set before calling play.
HDNetStream
  
setCurrentIndex(index:Number):void
Sets the desired active index for multibitrate content.
HDNetStream
  
setRenderedDimensions(valueWidth:Number, valueHeight:Number):void
Tells the player what the dimensions of the rendered area for the video.
HDNetStream
  
For testing QOS alternate server mapping switch back to primary.
HDNetStream
  
For testing QOS Alternate server mapping force tag
HDNetStream
  
Triggers the class to dispatch a HDEvent.RENDITION_CHANGE event, which carries information about the current index that is rendering and the max index that is available.
HDNetStream
Events
 Event Summary Defined By
  Dispatched when the class fails over to the alternate server map.HDNetStream
  Dispatched when the disableAllArchivePlayback property is set true, and the class detects that the user is trying to access a live stream (or a stream that was formerly live) at a point other than true live, which is defined as being within 10s of the latest TAT time returned by the server.HDNetStream
  Dispatched when a new estimate of the maximum bandwidth available between client and server is available from the class.HDNetStream
  Dispatched when stream playback is complete.HDNetStream
  Dispatched when the class receives a data message embedded in the stream.HDNetStream
  Dispatched when the class detects that no bytes have been received in 10s following a buffer empty event.HDNetStream
  Contains a debug message.HDNetStream
  Dispatched when the DVR window is detected or is changed.HDNetStream
  Dispatched when the player is paused on a live stream with dvr window enabled, and the player slides out of the available dvr window.HDNetStream
  Dispatched when this class receives an error from the server.HDNetStream
  Dispatched when the server informs the client that it must disconnect from the HTTP network and fail-over to the RTMP network.HDNetStream
  Dispatched when a failure event occurs in one of the sub-classes which this class invokes, specifically the HDPrimaryTokenService or the HDController.HDNetStream
  Dispatched when the buffering state of the class changes.HDNetStream
  Dispatched when the state of the stream switches between live and archive.HDNetStream
  Dispatched when the state of the stream switches between playing live and not playing live.HDNetStream
  Dispatched when the stream loops back and plays from the start after completing.HDNetStream
  Dispatched when a onMetaData callback has been received by the class.HDNetStream
  Dispatched when the class detects a change in the presence of the Akamai NetSession client.HDNetStream
  Dispatched when the class detects a change in the EULA status of the Akamai NetSession client.HDNetStream
  Returns the NetStatus events.HDNetStream
  Dispatched when the class has been given a pause command.HDNetStream
  Dispatched when the class receives a play request.HDNetStream
  The progress event is an update event that is dispatched by the class at 100ms intervals.HDNetStream
  Dispatched after the stream has experienced an unexpected rebuffer event during playback and has successfully re-filled its buffer.HDNetStream
  Dispatched when there is a change in the rendition index that is being rendered.HDNetStream
  Dispatched when the class has been given a resume command.HDNetStream
  Dispatched when a new estimate of the Round Trip Time between client and server is available from the class.HDNetStream
  Dispatched when the class has been given a seek command.HDNetStream
  Dispatched when the class receives a new session ID from the server Data object carries the sessionID as a string.HDNetStream
  Dispatched when the Flash Player's sleep mode has changed.HDNetStream
  Dispatched when there is a change in the stream name being rendered.HDNetStream
  Dispatched when the stream cannot be found on the server.HDNetStream
  Dispatched when the class receives a stream-not-found message from the server during the course of normal playback.HDNetStream
  Dispatched when the class detects a change in the stream start time.HDNetStream
  Dispatched when there is a change in the type of stream being rendered.HDNetStream
  Dispatched when a switch has completed.HDNetStream
  Dispatched when a switch failure has been indicated by the server.HDNetStream
  Dispatched when switch has commenced between multi-bitrate renditions.HDNetStream
  Dispatched when the server times-out the connection due to its being idle past the idle-threshold.HDNetStream
Public Constants
 ConstantDefined By
  SLEEP_MODE_CHANGE : String = sleepModeChange
[static] Dispatched when the Flash Player sleep state changes.
HDNetStream
Property Detail
analyticsBeaconproperty
analyticsBeacon:String

Activates the built-in Akamai Client Side Media Analytics plugin, by specifying the beacon path that the plugin should track against. To turn-off the tracking after enabling it, pass "" as the value. This property greatly simplifies integration with CSMA, by only requiring this singe point of activation. The beacon path is something you would obtain from your Akamai CSMA account manager after you have established a valid CSMA account.

The default value is true.


Implementation
    public function get analyticsBeacon():String
    public function set analyticsBeacon(value:String):void
analyticsPluginLoaderInstanceproperty 
analyticsPluginLoaderInstance:AnalyticsPluginLoader

Use this accessor instead of the analyticsBeacon accessor if you want to add multiple instances of the plugin in the same player. This is ideal for tracking AD or PIP on a separate analytics channel.


Implementation
    public function get analyticsPluginLoaderInstance():AnalyticsPluginLoader
    public function set analyticsPluginLoaderInstance(value:AnalyticsPluginLoader):void

See also

analyticsBeacon

Example
Example usage:
 
         var analyticsPluginLoaderInstance:AnalyticsPluginLoader = AnalyticsPluginLoader(AnalyticsPluginLoader.getLoader("PlayerName"));
         if (analyticsPluginLoaderInstance == null)
         {
             analyticsPluginLoaderInstance = AnalyticsPluginLoader.loadPluginMultiPlay("http://79423.analytics.edgesuite.net/csma/plugin/csma.swf", ANALYTICS_BEACON_URL);
             AnalyticsPluginLoader.putLoader("PlayerName", analyticsPluginLoaderInstance)
         }
         netstream.analyticsPluginLoaderInstance = this.analyticsPluginLoaderInstance;    
         
autoRecoverFromTimeoutproperty 
autoRecoverFromTimeout:Boolean

Specifies whether the class should automatically try to recover from a timeout. Normally, this should always be left true. The one exception would be the instance of streams protected by edge auth tokens, where the token service is unable to generate streams after an idle-timeout. IN this case, the player application should listen for the HDEvent.TIMEOUT event and then set autoRecoverFromTimeout to false to prevent the class from trying to reconnect without valid tokens.

The default value is true.


Implementation
    public function get autoRecoverFromTimeout():Boolean
    public function set autoRecoverFromTimeout(value:Boolean):void
autoSwitchproperty 
autoSwitch:Boolean

Defines whether the class should automatically switch between available bitrates. If a switch is already underway you cannot modify the switching mode.

The default value is true.


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

See also

averagePlaybackBitsPerSecondproperty 
averagePlaybackBitsPerSecond:Number  [read-only]

The smoothed and averaged playback bits per second. The instantaneous value can be obtained from playbackKbps.


Implementation
    public function get averagePlaybackBitsPerSecond():Number

See also

bandwidthEstimationEnabledproperty 
bandwidthEstimationEnabled:Boolean  [read-only]

Returns a Boolean value representing whether bandwidth estimation for MBR content at startup is enabled.


Implementation
    public function get bandwidthEstimationEnabled():Boolean
bufferLengthproperty 
bufferLength:Number  [read-only] [override]

Returns the buffer length in seconds


Implementation
    public function get bufferLength():Number
bufferTimeproperty 
bufferTime:Number[override]

[Setter is DEPRECATED] Returns the current target buffer time on the netstream. IMPORTANT - the class will not use the bufferTime value supplied by this method. The bufferTime in this class is actively managed by the class through a series of throttling command calls. Buffer behavior incorporates a fastStart mode for archive viewing, whereby the player builds only a small buffer before playback commences and then builds a larger buffer in the background while play is underway. The short-term target will be defined by startingBufferTimeOndemand. Once playback is underway, the bufferLength is actively managed to stay close to the target buffer time. This target time is set to linearly vary from TARGET_BUFFER_TIME_LOW_LATENCY at a RTT estimate of LOW_RTT to TARGET_BUFFER_TIME_HIGH_LATENCY at a RTT estimate of HIGH_RTT. These constants are fixed in this class and to adjust the buffer behavior you will need to modify the class itself. The current target buffer time being used can be obtained by reading the bufferTime property.


Implementation
    public function get bufferTime():Number
    public function set bufferTime(value:Number):void
bytesLoadedproperty 
bytesLoaded:uint  [read-only] [override]

Returns the bytes loaded since the last play request.


Implementation
    public function get bytesLoaded():uint
clientproperty 
client:Object[override]

Sets the client property of the NetStream. Since the class must also monitor callbacks against the client, a proxy object is used. This ensures that both the class and its parent can listen to callback functions such as onMetadata.


Implementation
    public function get client():Object
    public function set client(value:Object):void
considerDimensionsWhenSwitchingproperty 
considerDimensionsWhenSwitching:Boolean

If enabled, the class will not switch up during multi-bitrate playback if the area that the video is being rendered at is smaller than the the native size of video. This rule is valid as long as the MBR package has been encoded with consistent "quality density" (i.e bitrate/pixel ratio), which implies that it is pointless to move up in an index if the video is already being scaled-down for display, since the video will not look any better to the end-user.

The default value is false.


Implementation
    public function get considerDimensionsWhenSwitching():Boolean
    public function set considerDimensionsWhenSwitching(value:Boolean):void
cpuproperty 
cpu:Number  [read-only]

The system cpu as a percentage. This property is only available on computers which have the Akamai NetSessionClient installed.


Implementation
    public function get cpu():Number
currentIndexproperty 
currentIndex:int

The current index that is rendering for a MBR object source.


Implementation
    public function get currentIndex():int
    public function set currentIndex(value:int):void
currentIndexBitrateproperty 
currentIndexBitrate:Number  [read-only]

The bitrate value of the current index,, in kbps.


Implementation
    public function get currentIndexBitrate():Number

See also

disableAllArchivePlaybackproperty 
disableAllArchivePlayback:Boolean

If set true, this property will prohibit the class from playing back the archive portion of a live stream. This includes accessing the archive while the stream is still being published (i.e DVR) as well as after publishing is complete. If a stream starts and the player realizes that it is archive, then class will halt playback and dispatch a new HDEVENT.ARCHIVE_PLAYBACK_DISABLED event. If both encoders stop and loop is false, then the live stream will just end with the HDEvent.COMPLETE. If loop is true, then loop will be disabled, playback will cease and the HDEVENT.ARCHIVE_PLAYBACK_DISABLED event dispatched.

If VOD content is played, then this setting is ignored.


Implementation
    public function get disableAllArchivePlayback():Boolean
    public function set disableAllArchivePlayback(value:Boolean):void
displayObjectproperty 
displayObject:DisplayObject

A reference to any object that participates in the display stack and which has a access to the "stage" property. This reference is only required when SWF Authentication is required. This property must be set prior to play() being called or swf authentication will fail.


Implementation
    public function get displayObject():DisplayObject
    public function set displayObject(value:DisplayObject):void
downloadRatioproperty 
downloadRatio:Number  [read-only]

The downloadRatio is the ratio of the rate at which bytes are being downloaded over the rate at which they are being rendered. A downloadRatio > 1 means the buffer will grow, < 1 means it will shrink. The class uses this metric as a trigger to switch down to a lower bitrate. Note that the downloadRatio is affected by the throttle setting. A throtle < 100% will cause the ratio to appear smaller than it really is.


Implementation
    public function get downloadRatio():Number
droppedFPSproperty 
droppedFPS:Number  [read-only]

The estimated dropped-frame rate, expressed in Hz. This is a backwards looking estimate, calculated over the prior second.


Implementation
    public function get droppedFPS():Number
droppedFramesproperty 
droppedFrames:uint  [read-only]

Returns the absolute count of dropped frames since the last play request


Implementation
    public function get droppedFrames():uint
durationproperty 
duration:Number  [read-only]

Returns the duration of the stream in seconds. For live streams, this number will constantly increase as long as the live source continues publishing.


Implementation
    public function get duration():Number
durationAsTimeCodeproperty 
durationAsTimeCode:String  [read-only]

Returns the duration of the stream as HH:MM:SS timecode


Implementation
    public function get durationAsTimeCode():String
dvrWindowproperty 
dvrWindow:Number  [read-only]

Specifies the length of the DVR window, if implemented, in seconds. The DVR window is an optional rolling window that defines which portion of a live stream is accessible. For example, a live news broadcaster may want to make the last hour of their live 24x7 newscast available. In this case the dvrWindow will return a value of 3600. DVR window must be set as a property of the Akamai account and must be configured and initiated through the Akamai portal. DVR window only applies to LIVE streams or archives of formerly live streams, it does not apply to VOD streams. Listen for the HDEvent.DVR_WINDOW event to know when this property is detected or changed.

The default value of -1 indicates that no DVR window has been set.


Implementation
    public function get dvrWindow():Number
edgeIPproperty 
edgeIP:String

Returns the IP address of the Akamai Edge Server to which the client has connected. This property will only hold a valid value after the first onEdge data message has been received following a play() request.


Implementation
    public function get edgeIP():String
    public function set edgeIP(value:String):void
edgeVersionproperty 
edgeVersion:String

Returns the version of the Akamai Edge Server to which the client has connected. This property will only hold a valid value after the first onEdge data message has been received following a play() request.


Implementation
    public function get edgeVersion():String
    public function set edgeVersion(value:String):void
enableAlternateServerMappingproperty 
enableAlternateServerMapping:Boolean

If there is an issue with the stream at startup or during playback it may be caused by a server condition. If this feature is enabled and your account is provision for this feature, when an issue arises, the stream will be re-requested from anther server that will have more resources available. The stream will continue from the same point on the new host.


Implementation
    public function get enableAlternateServerMapping():Boolean
    public function set enableAlternateServerMapping(value:Boolean):void
enableEndUserMappingproperty 
enableEndUserMapping:Boolean

If you enable this feature and enableAlternateServerMapping is not enabled - enableAlternateServerMapping will be enabled. Setting enableEndUserMapping to true will result in multiple ident requests to servers both mapped from nameserver and an end user's ip Depending on a comparison of the RTT value in these ident, a primary host is determined. This could result in locating a server closer to the end user and providing better over-all performance.


Implementation
    public function get enableEndUserMapping():Boolean
    public function set enableEndUserMapping(value:Boolean):void
enableNetSessionDiscoveryproperty 
enableNetSessionDiscovery:Boolean

Enables the class to discover the NetSession interface . This property must be set true before play() is called, in order to prompt the class to make the discovery request to verify if NetSession is installed. This property must be set true if the netSessionClientAvailable is to be queried and the NETSESSION_CLIENT event be dispatched when playback starts.

The default value is true.


Implementation
    public function get enableNetSessionDiscovery():Boolean
    public function set enableNetSessionDiscovery(value:Boolean):void
estimatedCurrentBandwidthproperty 
estimatedCurrentBandwidth:Number  [read-only]

The estimated current throughput between client and server, expressed in kilobits per second.


Implementation
    public function get estimatedCurrentBandwidth():Number
estimatedMaxbandwidthproperty 
estimatedMaxbandwidth:Number  [read-only]

The estimated maximum throughput between client and server, expressed in kilobits per second.


Implementation
    public function get estimatedMaxbandwidth():Number
estimatedRTTproperty 
estimatedRTT:Number  [read-only]

The estimated round-trip time between client and server, expressed in milliseconds. This value is only available after the first bitrate test has been completed.


Implementation
    public function get estimatedRTT():Number
isAsleepproperty 
isAsleep:Boolean  [read-only]

eturns whether the flash runtime is in sleep mode.


Implementation
    public function get isAsleep():Boolean
isCompleteproperty 
isComplete:Boolean  [read-only]

True if the stream has ended


Implementation
    public function get isComplete():Boolean
isLiveStreamproperty 
isLiveStream:Boolean  [read-only]

Specifies whether the stream playing is "live". A live stream is defined as one for which the duration is constantly increasing. Note that since DVR is enabled, it is possible to play a live stream at both "true live" i.e the latest possible time and also in archive mode. The difference can be determined by examining the isPlayingLive property.

The default value is false.


Implementation
    public function get isLiveStream():Boolean

See also

isPausedWhileLiveproperty 
isPausedWhileLive:Boolean  [read-only]

True if the stream has was paused while isPlayingLive was true. This state is tracked separately since the connection is actually dropped completely if the user pauses while isPlayingLive is true, whereas normally the connection is maintained and throttling is set to zero.

The default value is false.


Implementation
    public function get isPausedWhileLive():Boolean

See also

isPlayingLiveproperty 
isPlayingLive:Boolean  [read-only]

Specifies whether the the stream is playing at "true" live. This is true if the stream is a live stream and the current time is within 5s of the duration.


Implementation
    public function get isPlayingLive():Boolean

See also

isSwitchingproperty 
isSwitching:Boolean  [read-only]

Defines whether the class is currently executing a switch. If it is, then you cannot change the switching mode.


Implementation
    public function get isSwitching():Boolean

See also

lastThrottleValueproperty 
lastThrottleValue:Number  [read-only]

The last throttle value requested form the server. Throttle values are expressed as percentage of stream bitrate. So a throttle of 0 means stop sending data, a throttle of 100 means send data at the stream bitrate and a throttle of 200 means send data at twice the stream bitrate.


Implementation
    public function get lastThrottleValue():Number
liveDriftproperty 
liveDrift:Number  [read-only]

For live streams only, the estimated difference between the duration that the class is rendering and the latest duration that the server has, in seconds. This drift will be induced due to buffering on the client.


Implementation
    public function get liveDrift():Number
loopproperty 
loop:Boolean

If enabled, once the stream is complete it will loop back and begin playing from the start. Note that the HDEvent.COMPLETE event will not be dispatched when the content loops. The HDEvent.LOOP event will be dispatched in its place.

The default value is false.


Implementation
    public function get loop():Boolean
    public function set loop(value:Boolean):void
maxBufferLengthproperty 
maxBufferLength:Number

Specifies the maximum buffer length in seconds to allow when a) the class is paused b) single bitrate content is playing c) multi-bitrate content is playing at the highest rendition available. For multi-bitrate renditions below the maximum, or LIVE streams playing at the true live point, the buffer length is automatically managed to balance transition time with buffer robustness.

Note that the edge server will time-out the connection if it does not deliver any bytes in 120s. So if you pause a stream and it fills all the available buffer and then click resume after more than 2min has elapsed, then the connection with the server will actually be closed. This means that ALL CONTROL requests will fail against that server. However, the stream will continue to play and does not require these control commands since you have buffered all the content locally. Any seek in to the buffered section will however always result in a new GET request to the server as the class is not yet optimized to seek within its forward buffer. Note that for secure content protected with token auth, if the player is left paused for > 120s and you try to seek, it will fail as the session the token is valid against would have ended.

The default value is 60.


Implementation
    public function get maxBufferLength():Number
    public function set maxBufferLength(value:Number):void
maximizeSingleBitrateBuffersproperty 
maximizeSingleBitrateBuffers:Boolean

Specifies wether the class should set the target buffer to a high value (default is 60s) for non-live single-bitrate content and for non-live multi-bitrate content where you are playing the highest available index. The reasoning here is that in either of these two scenarios, you are playing at your optimum quality level, so it is best to build a larger buffer to ensure some robustness over transient variance in throughput. The situation in which you may not want to do this is if you intend to manually switch out of the highest bitrate in a MBR package, in order to force it to a thumbnail view for example. The default value is false.

The default value is true;.


Implementation
    public function get maximizeSingleBitrateBuffers():Boolean
    public function set maximizeSingleBitrateBuffers(value:Boolean):void
maximumBitrateAllowedproperty 
maximumBitrateAllowed:Number

When switching multi-bitrate content in auto-mode, this property specifies the maximum stream bitrate, in kbps, that the class is allowed to play. Even if the class finds a very high estimated bandwidth, it will only allow itself to play the highest rendition which is <= this value. If you set this property to a value lower than that currently playing, the class will switch down to satisfy this requirement. If you set it to a value that is lower than the lowest bitrate, it will still play that lowest bitrate.

A good use-case would be to limit the playback of a 3mbps rendition to fullscreen only. Let's imagine the next highest rendition is at 2mbps. So in normal playback mode, before calling the play() method, we could set maximumBitrateAllowed to 2500. This will force at most the 2mbps to stream to play in stage mode. As the user selects fullsreen, we could then set maximumBitrateAllowed to 3500. This would enable the class to switch up to the 3mbps rendition, assuming the user has bandwidth and is not dropping frames. As they exit fullscreen, we would again set maximumBitrateAllowed to 2500, which would force the class to switch down to the 2mbps stream.

Note - this property is IGNORED in manual switching mode. It only applies and is enforced in auto-switching mode.

The default value is int.MAX_VALUE.


Implementation
    public function get maximumBitrateAllowed():Number
    public function set maximumBitrateAllowed(value:Number):void
maxIndexAvailableproperty 
maxIndexAvailable:Number  [read-only]

The highest index available for the current MBR object. The max index available may be limited by the maximumBitrateAllowed setting, which is why this property may not correspond to the highest index specified in the MBR object. Index values start at zero.


Implementation
    public function get maxIndexAvailable():Number

See also

maxIndexAvailableBitrateproperty 
maxIndexAvailableBitrate:Number  [read-only]

The bitrate value of the highest index that is available, in kbps.


Implementation
    public function get maxIndexAvailableBitrate():Number

See also

maxLiveDriftAllowedproperty 
maxLiveDriftAllowed:Number

[DEPRECATED] The maximum live drift value allowed, in seconds. If the stream is playing at true live and the liveDrift value exceeds this value, then the class will automatically pull itself back to live by making a new play request for seek=live

The default value is INT.MAX_VALUE.


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

See also

maxSecondsWithoutDataproperty 
maxSecondsWithoutData:Number  [read-only]

The maximum number of seconds that the class has not received data while playing.


Implementation
    public function get maxSecondsWithoutData():Number
MBRObjectproperty 
MBRObject:IMBRObject  [read-only]

The current IMBRObject instance that the class is playing MBR content, or else null for SBR.


Implementation
    public function get MBRObject():IMBRObject
netSessionAcceptedEULAproperty 
netSessionAcceptedEULA:Boolean  [read-only]

Returns whether the Akamai NetStession client has had its EULA accepted.


Implementation
    public function get netSessionAcceptedEULA():Boolean

See also

netSessionClientAvailableproperty 
netSessionClientAvailable:Boolean  [read-only]

Returns true if the Akamai NetSession client is installed on the client machine. This property will only contain a meaningful value if enableNetSessionDiscovery is set to true prior to calling play(). It will take a few seconds to detect the NetSession client after play() is called, so wait for the NETSESSION_CLIENT event before querying this property.


Implementation
    public function get netSessionClientAvailable():Boolean

See also

netSessionCpCodeproperty 
netSessionCpCode:String  [write-only]

Sets the CP code that the Akamai NetSession client will use. This property must be set before calling play() on the HDNetStream class. This property is only required if the Akamai NetSession client is being used by this class.


Implementation
    public function set netSessionCpCode(value:String):void
nominalFPSproperty 
nominalFPS:Number  [read-only]

The estimated frame rate of the video. This metric is estimated by taking the max of the currentFPS property for the stream. It is calculated since it is not provided reliably in the onMetaData object.


Implementation
    public function get nominalFPS():Number
playbackKbpsproperty 
playbackKbps:Number  [read-only]

Returns the playback bitrate of the current stream, in kbps. This rate includes the sum of the audio and video bitrates for flash player 10.0.32.18+. For lower versions, due to a flash player bug, it only returns the audio component of the bitrate.


Implementation
    public function get playbackKbps():Number
playerIPproperty 
playerIP:String

Returns the IP address of this player. This property will only hold a valid value after the first onEdge data message has been received following a play() request.


Implementation
    public function get playerIP():String
    public function set playerIP(value:String):void
primaryTokenproperty 
primaryToken:String  [write-only]

Sets the primaryToken for the class to use to perform EdgeAuthentication against the Akamai network. Note that this property provides a simplified path to token use and is not to be confused with the tokenService property. The primaryToken property must be set before the start of play. The class will use it once, upon making its first play request but will then discard it. You must ensure that the token correctly hashes the first stream that will be requested. By default this is the largest bitrate <= 500kbps. If the getStartingIndex() method has been over-written or an explicit startingIndex has been supplied, then the appropriate token must be supplied.

If you supply a tokenService, then the class can use that service to generate a token whenever it needs one, such as after a long pause which has caused the secure session to time-out. primaryToken and tokenService are replacements for one another and should not be used in combination.

Note that you can supply the token appended as a param to a SMIL url when fed directly to the play() method. The reserved query arg "primaryToken" must be used. The class will strip off the token from the SMIL url and then re-insert it when the stream request is made.


Implementation
    public function set primaryToken(value:String):void

See also

qualityOfExperienceproperty 
qualityOfExperience:Number  [read-only]

The quality of experience metric is a single number (with a range of 0-100) which attempts to sum up the quality of the playback experience. It updates constantly throughout a playback session. Much like your GPA was used to represent your ability at school, so the QoE metric attempts to characterize the playback expereince which the user is receiving. It takes bandwidth, switching, rebuffers and framedrops in to account.

This property is calculated by the Media Analytics component and will ONLY be available if you have set a value for the analyticsBeacon property. If this has not been set then qualityOfExperience will return NaN.


Implementation
    public function get qualityOfExperience():Number

See also

analyticsBeacon
reachedTargetBufferFullproperty 
reachedTargetBufferFull:Boolean  [read-only]

True if the stream has reached its target buffer after starting.


Implementation
    public function get reachedTargetBufferFull():Boolean
requiresEdgeAuthproperty 
requiresEdgeAuth:Boolean

[DEPRECATED] - this property is maintained only to ensure backwards compatibility.

To enforce the use of Edge Authentication, supply either a primaryToken or set a tokenService.


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

See also

resumeDVRAtLiveproperty 
resumeDVRAtLive:Boolean

When set to false, if you pause a live stream, the stream will resume playing at the point at which it was paused. If the pause point falls outside of a limited DVR window, the resume point will be the beginning of the DVR window. If the content is secure and it is paused over 120 seconds, a new token and play method call will be required. When set to true, if you pause a live stream while at the live position, the stream will resume playing at the live point - unless the content is secure and it is paused over 120 seconds. In this case you will need to request a new token and issue a play command with the new token and this will result in the stream starting at the live point. If not playing at the live position the stream will resume at the paused point. Default value is true


Implementation
    public function get resumeDVRAtLive():Boolean
    public function set resumeDVRAtLive(value:Boolean):void
secondsUntilBufferEmptiesproperty 
secondsUntilBufferEmpties:Number  [read-only]

The estimated time in seconds until the buffer is empty. A 5s buffer will last 5s only if zero data is being sent by the server. If the buffer were declining at 0.5s per second, then the buffer would empty after 10s. This property captures that time and is used in several of the switching decisions.

A negative value indicates that the buffer is actually growing and thus will never empty.


Implementation
    public function get secondsUntilBufferEmpties():Number
soundTransformproperty 
soundTransform:SoundTransform[override]

Sets the soundTransform object of the stream.


Implementation
    public function get soundTransform():SoundTransform
    public function set soundTransform(value:SoundTransform):void
sourceproperty 
source:*  [read-only]

Returns the source object which the class is currently playing. This will be either an HDMBRObject, or a String.


Implementation
    public function get source():*

See also

startingBitrateproperty 
startingBitrate:Number

Sets the max bitrate value you wish to use at startup in kbps. The index chosen will be the largest index whose total bitrate is smaller than or equal to this value. This property must be set before play() is called. Note that the bitrate value used is the sum of the video and audio, so if a rendition is labeled as "_700" its true bandwidth may be 786kbps. It's generally good practice then to specify a starting bitrate at N kbps or so higher than the bitrate you intend to target, where N is the max audio bitrate you are using. If you set both startingIndex and startingBitrate, startingIndex will be used. Set it to NaN to turn it off after setting it.


Implementation
    public function get startingBitrate():Number
    public function set startingBitrate(value:Number):void
startingBufferTimeproperty 
startingBufferTime:Number

Setting this value will effect the startup time of the stream. The minimum accepted value is .75 seconds. The maximum accepted value is 10 seconds. If you set the value lower or higher then the accepted values, your value will be coerced to the closest acceptable value.

Benefits of changing this value are as follows:

Default .75 seconds


Implementation
    public function get startingBufferTime():Number
    public function set startingBufferTime(value:Number):void
startingIndexproperty 
startingIndex:Number

The starting index to use when playing MBR content. This index is zeroth based. If this value is not set (the default is null), then the starting index will be determined by the protected getStartingIndex() function. If you wish to add custom business logic for determining how the starting index is selected, then extend this class and override that function.


Implementation
    public function get startingIndex():Number
    public function set startingIndex(value:Number):void
streamStartTimeproperty 
streamStartTime:Number  [read-only]

The real world start time of the stream, in milliseconds since midnight January 1, 1970, universal time.


Implementation
    public function get streamStartTime():Number
streamTypeproperty 
public var streamType:int

Returns in integer representing the type of stream content that is currently rendering. Possible stream types are

Type Number Type Description
0UNKNOWN
1VIDEO-ONLY
2AUDIO-ONLY
3VIDEO AND AUDIO

timeproperty 
time:Number  [read-only] [override]

Returns the playhead time of the stream in seconds.


Implementation
    public function get time():Number
timeAsTimeCodeproperty 
timeAsTimeCode:String  [read-only]

Returns the playhead time of the stream as HH:MM:SS timecode


Implementation
    public function get timeAsTimeCode():String
tokenServiceproperty 
tokenService:ITokenService  [write-only]

Sets the token service that the class will use to request an EdgeAuth token. This property is only required when playing content protected by EdgeAuth. The property must be set to a valid instance of an ITokenService before the play() method is called.


Implementation
    public function set tokenService(value:ITokenService):void

See also

trueBufferTimeproperty 
trueBufferTime:Number  [read-only]

The raw bufferTime value of the underlying netstream class. This is separate from the bufferTime property, which returns the target buffer time which the class is trying to achieve.


Implementation
    public function get trueBufferTime():Number

See also

useFixedThrottleForSBRproperty 
useFixedThrottleForSBR:Boolean

For single-bite rate content, there can be minimal benefit in constant throttle commands being issued. Therefore, if this property is set true, the class will build the buffer using a throttle of 200% to its target and after that, will have a fixed throttle of 100%. No bandwidth tests or RTT tests will be run.

The default value is false.


Implementation
    public function get useFixedThrottleForSBR():Boolean
    public function set useFixedThrottleForSBR(value:Boolean):void
useVerboseGhostLogsproperty 
useVerboseGhostLogs:Boolean  [write-only]

Toggles use of verbose logging on GHost. Turning verbose logging on can assist with debugging server-side delivery issues.


Implementation
    public function set useVerboseGhostLogs(value:Boolean):void
volumeproperty 
volume:Number

Sets the volume of the stream. Volume ranges from 0 (mute) to 1(max loudness).


Implementation
    public function get volume():Number
    public function set volume(value:Number):void
Constructor Detail
HDNetStream()Constructor
public function HDNetStream(connection:NetConnection)

Constructor. The class requires a NetConnection in its constructor. This NetConnection must be connected to "null" since HD is a purely progressive solution.

Parameters
connection:NetConnection — a NetConnection that is connected to null

Throws
an — Argument error if the NetConneciton is not null
Method Detail
checkForNetSessionClient()method
public function checkForNetSessionClient():void

Checks to see if the Akamai NetSessionClient is installed on this machine. Since the request is asynchronous, this method does not return a response. Instead, you must listen for the HDEvent.NETSESSION_CLIENT event which will return a Boolean data property indicating whether the client is present or not.

See also

com.akamai.hd.HDEvent.NETSESSION_CLIENT
close()method 
override public function close():void

Closes the NeStream and stops all running timers

destroy()method 
public function destroy():void

Prepares the class instance for deletion by cleaning out objects that may be held in memory. Only call this method once you intend to dispose of the class instance. The class will not function correctly after this method has been called. This should be the last method you call on this class. This method will call the public close method so there is no need to call netStream.close if you are calling netStream.destroy.

enableMBRIndexStableBuffer()method 
public function enableMBRIndexStableBuffer(enabled:Boolean = true, observationPeriod:Number, bufferIncrease:Number):void

In version v2.5 a feature was added to help stabilize the buffer by increasing it by 10 seconds per index once the index has been playing without a switch for more than 25 seconds. Now there is a public API to enable or disable that functionality as well as configure the observationPeriod and the amount of time to increase the buffer.

This feature is enabled by default

Parameters

enabled:Boolean (default = true) — If set to true the buffer will be increased by the value defined in the public var bufferIncreaseInSecondsAfterStabilization once the current index has been playing continuously for more than the value defined by public var stableIndexThreshold. If set to false the feature will never be turned on or if you set to false after playback has begun, the feature will be turned off immediately
 
observationPeriod:Number (default = NaN) — The value in seconds that will define the observation interval to determine if the current index is stable.
 
bufferIncrease:Number (default = NaN) — The value in seconds to increase the buffer after it has been playing on the same index for longer than the value defined by observationPeriod. The increased buffer time is only added once per index and it is not unusual to see the value fluctuate to the "unstable" buffer time after a switch or seek has occurred. At which time it would take another full observationPeriod to pass on the new index to increase the buffer time again. One you reach the highest index of a MBR profile, this feature is not ignored and the maxBufferTime is the value that is used.

See also

maxBufferLength
getQoSManager()method 
public function getQoSManager():HDN1QoSManager

This is for unit testing only.

Returns
HDN1QoSManager
installNetSessionClient()method 
public function installNetSessionClient(filename:String = NetSessionInstaller, acceptedEula:Boolean = false, eulaVersion:String = Unknown EULA version):void

Installs the Akamai NetSession client with a given filename and optional acceptance of the EULA and specificaiton of the EULA version.

Parameters

filename:String (default = NetSessionInstaller)
 
acceptedEula:Boolean (default = false)
 
eulaVersion:String (default = Unknown EULA version)

See also

isPlayingMBRcontent()method 
public function isPlayingMBRcontent():Boolean

Returns whether or not the class is playing multi-bitrate content. A SMIL can be supplied with only a single bitrate, so it will be true if a SMIL source has been supplied and if that source has at least 2 bitrates.

Returns
Boolean — true if the class is playing multi-bitrate content
makeTATrequest()method 
public function makeTATrequest():void

Triggers the class to make a request to the server for an updated TAT time.

netSessionAcceptEULA()method 
public function netSessionAcceptEULA():void

Sends a request to the Akamai NetSession client indicating that the user has accepted the EULA.

See also

pause()method 
override public function pause():void

Pauses the video. Must only be called after a play() or seek() request otherwise it will have no effect. An HDEvent.PAUSE event will be dispatched when this method is called.

play()method 
override public function play(... args):void

Commences playback of content through this netstream. Two different content types are supported:

  1. Simple URL: a simple string URL can be passed in referencing a single asset. Typical structure would be

    http://<customer.edgesuite.net>/event_angle_bitrate@xxxxx

    where
    • <customer.edgesuite.net> = a HD-enabled domain on the Akamai FreeFlow network
    • event_angle_bitrate@xxxxx = the stream name, comprised of the event (common to an event such as a sports game), the angle (a view of the event synced with other angles), the bitrate (a rendition of that angle at a specific bitrate) and the stream ID (which is unique across the Akamai namespace and assigned by our portal). The class can switch smoothly between angles and bitrates.
    Examples include http://demo2.HD.akamai.com/quantum_top_1500k@123456 http://demo2.HD.akamai.com/quantum_side_700k@123456 http://demo2.HD.akamai.com/quantum_side_1500k@123456

    If a domain is protected with SWfAuth, then the authorizing cp code must be appended to the URL as a query param with the reserved name "authCP". An example would be:

    http://demo2.HD.akamai.com/quantum_h264_1500k@123456?authCP=59606
  2. Simple path (URL) to a SMIL file. An example would be

    http://mydomain.com/smil/mymbrcontent.smil

    If this resource is located on a different domain to that serving the swf, then be sure to provide a crossdomain.xml file at the root of the server delivering the SMIL. The SMIL format currently used is this:

    <?xml version="1.0"?> <!DOCTYPE smil PUBLIC "-//W3C//DTD SMIL 2.0//EN" "http://www.w3.org/2001/SMIL20/SMIL20.dtd"> <smil xmlns="http://www.w3.org/2001/SMIL20/Language"> <head> <meta name="title" content="Earth Trailer" /> <meta name="httpBase" content="http://efvod-hdnetwork.akamai.com.edgesuite.net/" </head> <body> <switch id="Earth Trailer"> <video src="earth2_h264_3500@14411" system-bitrate="3500000"/> <video src="earth2_h264_2500@14411" system-bitrate="2500000"/> <video src="earth2_h264_1500@14411" system-bitrate="1500000"/> <video src="earth2_h264_700@14411" system-bitrate="700000"/> <video src="earth2_h264_300@14411" system-bitrate="300000"/> </switch> </body> </smil>
  3. IMBRObject - basically a collection of renditions of the same piece of content at different bitrates. It represents a package of files which the class may switch through as bandwidth conditions change. The HDMBRObject implements IMBRObject and conveniently bundles an array representing the stream names and their bitrates, along with the associated httpbase, rtmpBase and title of the package.
  4. USMIL format - a url format that contains the required elements of a SMIL file. This has the same results as if you are using a .smil or IMBRObject to define a MBR profile.
    • Example of url including the optional width and height parms: - http://tceast-f.hdflash.edgesuite.net/will/robin_hood_25fps_,a~300~320~180,b~600~640~360,c~1200~640~360,d~1800~640~360,e~2400~1280~720,f~3000~1280~720,.f4v.usmil
    • Example of url excluding the optional width and height parms: - http://tceast-f.hdflash.edgesuite.net/will/robin_hood_25fps_,a~300,b~600,c~1200,d~1800,e~2400,f~3000,.f4v.usmil
    • Example of live stream usmil url: - http://live.edgeflash.akamai.com.edgesuite.net/akamai247_2_,800~800,1600~1600,@13903.usmil

    The parts of a usmil url are:
    • HTTP Base: http://tceast-f.hdflash.edgesuite.net/
    • Common Stream name: will/robin_hood_25fps_
    • MBR CSV: unique_name~300~320~180, [unique file name, bitrate, width (optional), height (optional)]
    • Extension (VOD): .f4v.usmil
    • Extension (LIVE): @XXXXX.usmil

UTC Start time for LIVE streams To start a live stream at a certain point, a UTC time can be supplied as a query arg appended to the media url or as the second argument to the play method.

If the start time value supplied is > 1262304000, then it will be interpreted automatically as an absolute start request - i.e it should specify the start time as the time in seconds since midnight UTC, Jan 1 1970. Only LIVE and LIVE ARCHIVE streams can support this type of absolute start time. Note that for any LIVE or LIVE ARCHIVE stream you should always specify the start time using a UTC value and not a relative one. Note - using either method of suppling a UTC start time will NOT create a sub-clip and all content previous to the UTC start time will be seekable.

Sub-Clips Sub-clips are only supported for VOD content. The play method supports the following argument combinations for sub-clips:

Sub-clips are also supported in a SMIL file using the clipBegin and clipEnd attributes on a media tag. For example:

<switch id="Seas Trailer"> <video src="seas2_h264_3500@14411" system-bitrate="3500000" clipBegin="60" clipEnd="65"/> <video src="seas2_h264_2500@14411" system-bitrate="2500000" clipBegin="60" clipEnd="65"/> <video src="seas2_h264_1500@14411" system-bitrate="1500000" clipBegin="60" clipEnd="65"/> <video src="seas2_h264_700@14411" system-bitrate="700000" clipBegin="60" clipEnd="65"/> <video src="seas2_h264_300@14411" system-bitrate="300000" clipBegin="60" clipEnd="65"/> </switch>

If the clipEnd tag is missing, this class will assume the clipEnd to be the natural duration of the content. You can also specify -1 as a clipEnd. Note that all of the clipBegin and clipEnd values are identical for each stream. If they are not behavior is undefined.

Sub-clips are also supported via the IMBRObject2 interface. There are properties for setting clipBegin and clipEnd and this class will honor them if you supply an object which implements that interface.

Parameters

... args


Throws
ArgumentError — if the argument is not a string or a IMBRObject.

See also

resume()method 
override public function resume():void

Resumes playback of paused video. Must only be called after a pause() request otherwise it will have no effect. An HDEvent.RESUME event will be dispatched when this method is called.

secondsToTimeCode()method 
public function secondsToTimeCode(value:Number):String

A utility function for converting seconds into HH:MM:SS timecode.

Parameters

value:Number

Returns
String
seek()method 
override public function seek(value:Number):void

Seek the stream. If the value is -1, then this indicates a desire to seek to the latest available portion of a live stream.

Parameters

value:Number — seek time in seconds, or -1 if you wish to seek to LIVE

sendUpdatedStats()method 
public function sendUpdatedStats():void

Triggers the class to dispatch an update its stats. Currently this only involves updating the rendition stats and the isLive status.

See also

setBandwidthEstimationEnabled()method 
public function setBandwidthEstimationEnabled(enabled:Boolean, bandwidthEstimationPeriodInSeconds:Number = 1):void

This method should only be used for MBR content and must be set before calling play. When enabled, a bandwidth test will be conducted and last for the length of time specified by the second arg of this method. The default time is 1 second. The results of this test will then explicitly set the starting index of the MBR content to the nearest kbps.

Parameters

enabled:Boolean
 
bandwidthEstimationPeriodInSeconds:Number (default = 1) — Increase or decrease this value to change the accuracy of the test. The longer the test is the more accurate the test is. The downside of a longer test is a longer startup time for playback

setCurrentIndex()method 
public function setCurrentIndex(index:Number):void

Sets the desired active index for multibitrate content. This method will only work if you are playing multi-bitrate content, autoSwitching is enabled and if the index you are attempting to set is not the index that is already playing or that is being ignored.

Parameters

index:Number — the zeroth-based index in a

setRenderedDimensions()method 
public function setRenderedDimensions(valueWidth:Number, valueHeight:Number):void

Tells the player what the dimensions of the rendered area for the video. The player will use this to make switching decisions if considerDimensionsWhenSwitching is true.

Parameters

valueWidth:Number
 
valueHeight:Number

See also

simulateFailbackToPrimaryTimerComplete()method 
public function simulateFailbackToPrimaryTimerComplete():void

For testing QOS alternate server mapping switch back to primary.

simulateForceTimerComplete()method 
public function simulateForceTimerComplete():void

For testing QOS Alternate server mapping force tag

updateCurrentRendition()method 
public function updateCurrentRendition():void

Triggers the class to dispatch a HDEvent.RENDITION_CHANGE event, which carries information about the current index that is rendering and the max index that is available. Typically this information is used to update a HD meter.

Note that the data object of the event will carry the current index, the max index separated by a comma.

See also

com.akamai.hd.HDEvent.RENDITION_CHANGE
Event Detail
altservermapfailover Event
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the class fails over to the alternate server map. This will only occur if the enableAlternateSeverMapping property has been set true. Failover occurs when the class receives no incoming data for 5s, the buffer length is smaller than 5s and the stream is not paused.

Data object carries an object with the following structure -

See also

archiveplaybackdisabled Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the disableAllArchivePlayback property is set true, and the class detects that the user is trying to access a live stream (or a stream that was formerly live) at a point other than true live, which is defined as being within 10s of the latest TAT time returned by the server.

Data object is null.

See also

disableAllArchivePlayback
bandwidth Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when a new estimate of the maximum bandwidth available between client and server is available from the class.

Data object carries the estimated bandwidth in kbps, as a Number.

Example usage:

trace("The estimated bandwidth is " + event.data.toString() + " kbps");

complete Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when stream playback is complete. This event is also dispatched if a player is paused and the DVR Window slides out from under its paused position.

Data object is null

datamessage Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the class receives a data message embedded in the stream. These data messages do not include onMetaData or onEdge messages. However, all other custom messages will trigger this event.

Data object carries an object with the following structure:

Example usage:

If the encoder embeds a data message with value "myAdTag" and value "123456", then you could retrieve it by listening for this event and then using trace("Data message received: name=" + event.data.name + " value=" + event.data.value);

deadconnection Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the class detects that no bytes have been received in 10s following a buffer empty event. Developers may use this as an indication that the connectivity to the server has been lost and can take appropriate action such as attempting a new request. The class will not shut down any of its metrics functions when this event is dispatched and will continue to attempt to play the existing stream.

Data object is null.

debug Event  
Event Object Type: com.akamai.hd.HDEvent

Contains a debug message. These messages are not intended for consumers but are provided to help developers debug the player code. This class will bubble up debug events it receives from the HDPrimaryTokenService class.

Data object is the debug message as a string

Example usage:

trace("the debug message is " + event.data as String);

dvrwindow Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the DVR window is detected or is changed. A stream which does not have DVR window enabled will not dispatch this event after play() is called.

Data object carries the DVR window value in seconds.

See also

dvrwindowclosed Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the player is paused on a live stream with dvr window enabled, and the player slides out of the available dvr window. Once this event is dispatched, playback is halted and can only be resumed through a seek(0) or play() request. By calling seek(0), the stream will start at the beginning of the DVR window. By calling play, the stream will start at the live point.

Data object carries the DVR window value in seconds.

See also

error Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when this class receives an error from the server. Possible errors include

Error Number Error Description
1STREAM NOT FOUND
2TRACK NOT FOUND
3SEEK OUT OF BOUNDS
4AUTHENTICATION FAILED
5DVR DISABLED
6INVALID BITRATE TEST
7RTMP FALLBACK

Data object carries the error number.

Example usage:

trace("The error number received is " + event.data as Number);

failovertortmp Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the server informs the client that it must disconnect from the HTTP network and fail-over to the RTMP network. This event would be sent only in a worst-case scenario and should not be considered a part of normal operating procedure. Note that this class will NOT support RTMP streaming. It is up to the player implementing this class to invoke a new standard NetStream over which it can stream the fail-over content.

The data property carries the actual source object that is rendering in the player. THis will be HDMBRObject if the source was a HDMBRObject or a string referencing a .smil file, or a string representing the direct path to a single bit-rate source.

failure Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when a failure event occurs in one of the sub-classes which this class invokes, specifically the HDPrimaryTokenService or the HDController.

Data object carries a description of the failure condition as a String.

Example usage:

trace("A failure occurred" + event.data as String);

See also

com.akamai.hd.HDPrimaryTokenService
com.akamai.hd.HDServerController
isbuffering Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the buffering state of the class changes. A stream is considered to be buffering between the NetStream.Play.Start event and the NetStream.Buffer.Full NEtStreamStatus events.

Data object is a Boolean true if the class is buffering and false if it is not.

Example usage:

trace("Stream is " + event.data ? "buffering" : "not buffering");

isLiveStream Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the state of the stream switches between live and archive. A live stream is one in which the duration is constantly increasing. Note that a stream can be live and you can still play through its archive component. A purely archived stream will have a constant duration.

Data object is a Boolean true if the stream is live and false if it is not live.

Example usage:

trace("The stream is " + event.data ? " live":" not live");

isPlayingLive Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the state of the stream switches between playing live and not playing live. Since a live stream is one for which the duration is constantly increasing, you are playing live if the current playhead time is within 10s of the duration. You can be not playing live, but still viewing a live stream, if you are viewing that live stream at a playhead position that is more than 10s back from live. You can never play an on-demand stream in true live mode.

Data object is a Boolean true if the stream is playing in true live mode and false if it is not playing at true live. True live is defined as playback where the current playhead time is within 10s of the duration and the stream is live.

Example usage:

trace("You are watching " + event.data ? " live":" archive" +" content");

loop Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the stream loops back and plays from the start after completing. Note that the HDEvent.COMPLETE event will not be dispatched when the content loops. The HDEvent.LOOP event will be dispatched in its place.

The data property is null.

See also

metadata Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when a onMetaData callback has been received by the class. This is triggered whenever the class finds an onMetdata event embedded in the stream. onMetadata events are typically received after each play or seek command and also at switch boundaries.

Data object carries the metadata object.

Example usage:

for (var s:String in event.data) { trace(s+": " + event.data[s]); }

netsessionclient Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the class detects a change in the presence of the Akamai NetSession client.

Data object carries a Boolean true if the NetSession client is installed or false if it is not.

netsessioneula Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the class detects a change in the EULA status of the Akamai NetSession client.

Data object carries a Boolean true if the NetSession client EULA is accepted or false if it is not.

netstatus Event  
Event Object Type: com.akamai.hd.HDEvent

Returns the NetStatus events. This is a copy of what you would get by listening for flash.events.NetStatusEvent, but it is provided as an HDEvent for consistency in handling.

Data object is the NetStream.info object.

Example usage:

if (event.code == "NetStream.Buffer.Empty") ...

pause Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the class has been given a pause command.

Data object is null

See also

play Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the class receives a play request.

Data object carries an object with the following structure -

Note that this event will only be dispatched once at the start of playback. If you want to track the switching progression through a MBR package, then listen to the SWITCH_START and SWITCH_COMPLETE events.

Example usage:

trace("Now playing " + event.data["source"].toString() + " using " + event.data["stream"].toString() + " with index " + event.data["index"].toString());

See also

progress Event  
Event Object Type: com.akamai.hd.HDEvent

The progress event is an update event that is dispatched by the class at 100ms intervals. It is used to drive updates to UI elements such as time displays and scrub bars. The progress event will start after play() is called and will stop after

  1. close() is called
  2. onEdge receives a status of 3 - COMPLETE

Data object is null.

rebuffer Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched after the stream has experienced an unexpected rebuffer event during playback and has successfully re-filled its buffer. Note that this event is not dispatched during normal play() and seek() behaviors, when rebuffering is expected.

Data object carries the duration of the rebuffer period in seconds as a Number.

renditionchange Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when there is a change in the rendition index that is being rendered. This event will still be dispatched for single bitrate content, in which case current will always be 0 and max index will always equal 1 and the currentKbps will be null, since it is not known.

Data object carries an object with the following structure:

Example usage:

trace("Now playing index " + event.data.currentIndex + " out of " + event.data.maxIndex + " with a bitrate of " + event.data.currentKbps + " kbps");

resume Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the class has been given a resume command.

Data object is null

See also

rtt Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when a new estimate of the Round Trip Time between client and server is available from the class.

Data object carries the estimated RTT in milliseconds, as a Number.

Example usage:

trace("The estimated RTT ivalue is " + event.data.toString() + " ms");

seek Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the class has been given a seek command.

Data object carries an object with the following structure -

Example usage:

trace("The class is seeking from " + (event.data["seekFrom"] as Number) + "s to " + (event.data["seekTo"] as Number) + "s" );

See also

sessionid Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the class receives a new session ID from the server

Data object carries the sessionID as a string.

sleepModeChange Event  
Event Object Type: flash.events.Event

Dispatched when the Flash Player's sleep mode has changed.

See also

streamnamechange Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when there is a change in the stream name being rendered.

Data object carries the new stream name

Example usage:

trace("The stream now playing is " + event.data as String);

streamnotfound Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the stream cannot be found on the server.

Data object is the URL that cannot be located, as a string.

Example usage:

trace("The stream " + event.data as String + " cannot be found on the server");

streamnotfoundwhileplaying Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the class receives a stream-not-found message from the server during the course of normal playback. Typically this will occur with live streams if both primary and backend encoders loose connectivity and do not stop publishing cleanly. This event is distinct from HDEvent.STREAM_NOT_FOUND, which is usually dispatched right when playback is attempted, but never begins. Note that all timers will be stopped after this event is dispatched, so playback will only resume after a new play() is issued.

Data object is null.

See also

HDEvent.STREAM_NOT_FOUND
streamstarttime Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the class detects a change in the stream start time. This event is only dispatched for live streams.

Data object carries the real world start time of the stream, in milliseconds, since midnight January 1, 1970, universal time.

streamtypechange Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when there is a change in the type of stream being rendered. Possible stream types are

Type Number Type Description
0UNKNOWN
1VIDEO-ONLY
2AUDIO-ONLY
3VIDEO AND AUDIO

Data object carries the new stream type number as a Number.

Example usage:

var types:Array = ["Unknown","Video-only", "Audio-only", "Video and Audio"]; trace("Stream-type identified: " + types[event.data as Number]);

switchcomplete Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when a switch has completed.

Data object carries the current index that is now rendering, as a Number.

Example usage:

trace("The switch to index " + (event.data as Number) + " is complete");

switchfailure Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when a switch failure has been indicated by the server.

Data object carries the current index that is now rendering, as a Number.

Note: to ensure backward compatibility with previous versions of HDCore, a switch complete event will immediately follow this event. This will keep players unaware of this event from remaining in a perpetual switching state.

switchstart Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when switch has commenced between multi-bitrate renditions.

Data object carries an object with the following structure -

Example usage:

trace("A switch has begun to index " + event.data["index"] + " since " + event.data["reason"]);

timeout Event  
Event Object Type: com.akamai.hd.HDEvent

Dispatched when the server times-out the connection due to its being idle past the idle-threshold. The current idle threshold is 120 seconds. An idle state is when the stream is paused and throttled to 0, so that the server is not sending any data to the client. When a timeout is encountered, the class will automatically try to reconnect. This involves repeating the entire authentication process, including retrieving the primaryToken if a tokenService has been supplied and establishing the session token if requiresSwfAuth is true.

The data property is null for this event.

See also

Constant Detail
SLEEP_MODE_CHANGEConstant
public static const SLEEP_MODE_CHANGE:String = sleepModeChange

Dispatched when the Flash Player sleep state changes. Call the isAsleep property to get the current state.

See also