Packagecom.akamai.net.f4f.hds
Classpublic class AkamaiStreamController
InheritanceAkamaiStreamController Inheritance flash.events.EventDispatcher

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 10.1

The AkamaiStreamController class is a non-UI, controller class that handles the complexities of playing HDS (HTTP Dynamic Streaming) media.

View the examples



Public Properties
 PropertyDefined By
  actualIndex : int
[read-only] The current index being downloaded.
AkamaiStreamController
  addManifestQueryArgsToFragmentRequests : Boolean
If set true, then any query args attached to the manifest request will be added to all subsequent fragment requests.
AkamaiStreamController
  alternativeAudioStreamSwitching : Boolean
[read-only] Indicates whether or not an alternative audio stream switch is currently in progress.
AkamaiStreamController
  analyticsBeacon : String
Activates the built-in Akamai Client Side Media Analytics (CSMA) plugin, by specifying the beacon path the plugin should track against.
AkamaiStreamController
  analyticsPluginLoaderInstance : AnalyticsPluginLoader
This function can be used to set an explicit instance of AnalyticsPluginLoader class which is created in the player.
AkamaiStreamController
  audioPan : Number
Pan property of the media.
AkamaiStreamController
  autoPlay : Boolean
Indicates whether the media starts playing right away after calling the play method and as soon as the media has been loaded.
AkamaiStreamController
  autoRewind : Boolean
Indicates whether media is returned to the beginning after playback completes.
AkamaiStreamController
  averageBandwidth : Number
[read-only] Returns the bandwidth estimate, in kbps, averaged over the last 2 segments.
AkamaiStreamController
  bandwidth : Number
[read-only] The estimated bandwidth, in kbps, over which the last fragment was downloaded.
AkamaiStreamController
  bufferLengthAtLiveEOS : Number
[read-only] Value of the buffer length when live playback ends.
AkamaiStreamController
  bufferProfile : String
Two different buffer profiles can be set: AkamaiBufferProfileTypes.LIVE_LOW_LATENCY - provides the lowest "hand-waving latency" possible. AkamaiBufferProfileTypes.LIVE_STABLE (default) - provides a more stable buffer.
AkamaiStreamController
  canPause : Boolean
[read-only] Indicates whether the media can be paused.
AkamaiStreamController
  canSeek : Boolean
[read-only] Indicates whether the media is seekable.
AkamaiStreamController
  captionType : String
Sets the captionType on the streamController for intended captioning.
AkamaiStreamController
  captionURL : String
Takes a URL to the supported caption format used for closed captioning.
AkamaiStreamController
  currentAlternativeAudioStreamIndex : int
[read-only] The index of the alternative audio stream currently in use.
AkamaiStreamController
  currentIndex : int
[read-only] The currently rendered index.
AkamaiStreamController
  currentTimeUpdateInterval : Number
Interval between the dispatch of the TimeEvent.CURRENT_TIME_CHANGE event in milliseconds.
AkamaiStreamController
  DFXPCaptionURL : String
[DEPRECATED] - this property is maintained only to ensure backwards compatibility.
AkamaiStreamController
  displayObject : DisplayObject
Registers an instance of any display object with the NetStream.
AkamaiStreamController
  downloadRatio : Number
[read-only] The ratio of the time it took to download the last fragment to the duration of video held within that fragment.
AkamaiStreamController
  drmEndDate : Date
[read-only] Returns the end date for the playback window.
AkamaiStreamController
  drmPeriod : Number
[read-only] Returns the length of the playback window, in seconds.
AkamaiStreamController
  drmStartDate : Date
[read-only] Returns the start date for the playback window.
AkamaiStreamController
  drmState : String
[read-only] The current state of the DRM for the media.
AkamaiStreamController
  duration : Number
[read-only] Duration of the media's playback, in seconds.
AkamaiStreamController
  durationAsUTC : Number
[read-only] Returns the current duration as an absolute value, the time in seconds since midnight UTC, Jan 1 1970.
AkamaiStreamController
  dvrAvailability : String
[read-only] A string value denoting the dvr availability mode of the current stream.
AkamaiStreamController
  effectiveBitrate : Number
[read-only] Returns the effective bitrate of the last fragment loaded, in kbps.
AkamaiStreamController
  enableAlternateServerMapping : Boolean
Enables an Akamai feature called Alternate Server Mapping which can provide improved performance when edge servers are slow to respond to fragment requests.
AkamaiStreamController
  enableBestEffortDownloadOnFragmentError : Boolean
If enableBestEffortDownloadOnFragmentError is set to true, stream reconnect logic is initiated after unsuccessful attempts of fragment retry due to IOError or Data Gap.
AkamaiStreamController
  enableEndUserMapping : Boolean
Enables an Akamai feature called End User IP Mapping which can provide improved performance by mapping a user to the closest edge server possible.
AkamaiStreamController
  enableLargeBuffersForLongFormContent : Boolean
If set true, then large buffer targets of 60s (for intermediate bitrates) and 300s (for max bitrates) are used for long form content, defined as any VOD stream having a duration longer than 10min.
AkamaiStreamController
  enableLocalSharedObject : Boolean
Setting to true (the default value) allows Akamai to store data in a Flash Shared Object (a Flash cookie).
AkamaiStreamController
  enableLogStringOnFragments : Boolean
A log string is usually appended to each fragment request, allowing QoS stats to be collected on the server.
AkamaiStreamController
  enableSSLTransfer : Boolean
AkamaiStreamController
  encrypted : Boolean
[read-only] Returns true if the current stream is encrypted with Akamai Media Encryption
AkamaiStreamController
  fragmentRetryAttemptsForLostConnectivity : Number
The number of times the class will retry a fragment when all client connectivity has been lost.
AkamaiStreamController
  fragmentRetryDataGapThreshold : Number
We measure the time it takes from the initial request until we receive the first byte of data per fragment download.
AkamaiStreamController
  hasAlternativeAudio : Boolean
[read-only] Indicates whether the media has alternative audio streams or not.
AkamaiStreamController
  hasAudio : Boolean
[read-only] Indicates whether the media has audio.
AkamaiStreamController
  hasDRM : Boolean
[read-only] Returns true if the media is DRM protected.
AkamaiStreamController
  holdbackFromLive : Number
Use this property to set the holdback value from live point for limited-DVR and unlimited DVR live streams with a LIVE_STABLE buffer profile.
AkamaiStreamController
  isBuffering : Boolean
[read-only] If set true, the netstream is in a buffering state.
AkamaiStreamController
  isDVRRecording : Boolean
[read-only] Returns true if the media is DVR-enabled and currently recording, false if the media is either not DVR-enabled, or is DVR-enabled but not currently recording.
AkamaiStreamController
  isDynamicStream : Boolean
[read-only] Indicates whether the media consists of a dynamic stream.
AkamaiStreamController
  isLiveStream : Boolean
[read-only] Specifies whether the current stream is live or not
AkamaiStreamController
  isPaused : Boolean
[read-only] Returns true if the stream is paused and false if not.
AkamaiStreamController
  isPlaying : Boolean
[read-only] Indicates whether the media is currently playing.
AkamaiStreamController
  isPlayingLive : Boolean
[read-only] Specifies whether the stream is within bounds (60s) of the live point.
AkamaiStreamController
  isSeeking : Boolean
[read-only] Indicates whether the media is currently seeking.
AkamaiStreamController
  isSwitching : Boolean
[read-only] Indicates whether or not a dynamic stream switch is currently in progress.
AkamaiStreamController
  limitMaxSwitchingIndexToPlayerDimensions : Boolean
CR 3087291 By setting the limitMaxSwitchingIndexToPlayerDimensions boolean to true, the player can limit the maximum allowed index to a video height that does not exceed the player dimensions.
AkamaiStreamController
  loop : Boolean
Indicates whether the media should play again after playback has completed.
AkamaiStreamController
  manualSwitchMode : Boolean
Indicates whether or not the media will automatically switch between dynamic streams.
AkamaiStreamController
  maxAllowedIndex : int
The max allowed index in the current rendition set.
AkamaiStreamController
  maxBestEffortDownloadAttemptsOnFragmentError : Number
When fragment download fails due to IOError or data gap, the fragment retry logic kicks in.
AkamaiStreamController
  maximumBitrateAllowed : Number
When switching multi-bitrate content in auto switching mode, this property specifies the maximum stream bitrate in kbps the class is allowed to play.
AkamaiStreamController
  mediaHeight : Number
[read-only] Intrinsic height of the media, in pixels.
AkamaiStreamController
  mediaWidth : Number
[read-only] Intrinsic width of the media, in pixels.
AkamaiStreamController
  minimumBitrateAllowed : Number
When switching multi-bitrate content in auto switching mode, this property specifies the minimum stream bitrate in kbps for the content.
AkamaiStreamController
  muted : Boolean
Indicates whether the media is currently muted.
AkamaiStreamController
  netSessionMode : String
Sets the operation mode for NetSession (HDClient) interaction.
AkamaiStreamController
  netStream : NetStream
[read-only] Returns the current instance of the NetStream class.
AkamaiStreamController
  numDynamicStreams : int
[read-only] The total number of dynamic stream indices.
AkamaiStreamController
  playerDimensions : Object
CR 3087291 This property operates only when the limitMaxSwitchingIndexToPlayerDimensions property is set to true.
AkamaiStreamController
  preloadDecryptionSWF : Boolean
Set this to true if you know you are playing encrypted media and would like to start playback as fast as possible.
AkamaiStreamController
  preventSwitchDownOnDroppedFrames : Boolean
Jira HDCore-133 Jira HDCORE-128 If this property is set, the HDS DroppedFPSRule will not force an emergency switchdown in the requested fragments.
AkamaiStreamController
  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.
AkamaiStreamController
  resource : String
[read-only] Returns a URL of the media file.
AkamaiStreamController
  resumeDVRAtLive : Boolean
Used to determine how a resume is handled after a "Limited DVR" stream is paused beyond the DVR Window.
AkamaiStreamController
  rollingEndOffset : Number
[read-only] The rolling end offset, in seconds.
AkamaiStreamController
  sbrBitrate : Number
[read-only] Returns the bitrate of the stream in case of single bitrate stream.
AkamaiStreamController
  serverIP : String
[read-only] Returns the server IP address once the stream is playing.
AkamaiStreamController
  startingBitrate : Number
Sets the max bitrate value you wish to use at startup in kbps.
AkamaiStreamController
  startingIndex : Number
The starting index to use when playing multi-bitrate content.
AkamaiStreamController
  streamType : String
[read-only] Returns the type of the stream.
AkamaiStreamController
  temporal : Boolean
[read-only] Indicates whether the media is temporal.
AkamaiStreamController
  time : Number
[read-only] Current time of the playhead in seconds.
AkamaiStreamController
  timeAsUTC : Number
[read-only] Returns the current playhead time as an absolute value, the time in seconds since midnight UTC, Jan 1 1970.
AkamaiStreamController
  totalAlternativeAudioIndices : int
[read-only] Returns the total number of alternative audio streams or 0 if there are no alternative audio streams present.
AkamaiStreamController
  usingNetSession : Boolean
[read-only] Returns true if the class is currently using NetSession to request fragments.
AkamaiStreamController
  vbrRatio : Number
[read-only] Returns an estimate of the degree of VBR (variable bitrate encoding) encountered in the current content.
AkamaiStreamController
  volume : Number
Volume of the media.
AkamaiStreamController
Public Methods
 MethodDefined By
  
Constructor.
AkamaiStreamController
  
analyticsSetData(key:String, value:Object):void
Calls AnalyticsPluginLoader.setData with the key/value pair provided to the method.
AkamaiStreamController
  
authenticate(username:String = null, password:String = null):void
Authenticates the media.
AkamaiStreamController
  
authenticateWithToken(token:Object):void
Authenticates the media using an object which serves as a token.
AkamaiStreamController
  
Cleans up the class completely.
AkamaiStreamController
  
convertToUTC(value:Number):Number
Returns the time in seconds since midnight UTC, Jan 1 1970, corresponding to the input number of relative seconds.
AkamaiStreamController
  
getAlternativeAudioItemAt(index:int):StreamingItem
Obtains the alternative audio stream corresponding to the specified (0-based) index.
AkamaiStreamController
  
getBitrateAtQualitylevel(value:uint):Number
Gets the associated bitrate, in kilobytes for the specified dynamic stream index.
AkamaiStreamController
  
getStreamNameAtQualityLevel(value:uint):String
Returns the name of a stream at the index value supplied only after play has been called and only if is dynamic stream, Otherwise it returns null.
AkamaiStreamController
  
pause():void
Pauses the media, if it is not already paused.
AkamaiStreamController
  
play(... args):void
The play method initiates playback of a piece of media.
AkamaiStreamController
  
Jira HDCORE-141 Set the requestAMDLongToken property to true if the HDS stream is of AMD VoD type and token authentication is activated in the SecureHD policy.
AkamaiStreamController
  
resume():void
Resumes the media from a paused state.
AkamaiStreamController
  
seek(value:Number):void
Instructs the playhead to jump to the specified time.
AkamaiStreamController
  
stop():void
Immediately halts playback and returns the playhead to the beginning of the media file.
AkamaiStreamController
  
Changes the current audio stream to the alternative audio stream specified by a 0-based index value.
AkamaiStreamController
  
switchTo(value:int):void
Switch to a specific dynamic stream index.
AkamaiStreamController
  
timeCode(value:Number):String
A utility method which converts seconds into TimeCode.
AkamaiStreamController
  
Unloads the media completely, requiring a new call to the play method.
AkamaiStreamController
Events
 Event Summary Defined By
  Dispatched when the long token request for an AMD VoD stream returns with a valid response body.AkamaiStreamController
  Dispatched when a stream has played to completion.AkamaiStreamController
  Dispatched when a DRM protected stream requires a token to authenticate.AkamaiStreamController
  Dispatched when an error which impacts the operation of media playback occurs.AkamaiStreamController
  Dispatched when the hasAlternativeAudio property has changed.AkamaiStreamController
  Dispatched with the HTTP status code of each fragment before a complete/error.AkamaiStreamController
  Dispatched when the buffering state of the media changes.AkamaiStreamController
  Dispatched after the stream has been loaded and determined to be a live stream.AkamaiStreamController
  Dispatched when the isPlayingLive property changes state.AkamaiStreamController
  Dispatched when the currentTime property of the MediaElement associated with this TimelineMetadata has reached the duration offset of one of the TimelineMarkers in this TimelineMetadata.AkamaiStreamController
  Dispatched when the currentTime property of the MediaElement associated with this TimelineMetadata has reached the time value of one of the TimelineMarkers in this TimelineMetadata.AkamaiStreamController
  Dispatched when the netStream property is ready for use (meaning it will return a non-null object).AkamaiStreamController
  Dispatched during the life of the stream with an interval of 100ms.AkamaiStreamController
  Dispatched when a DRM protected stream requires a username and password to authenticate.AkamaiStreamController
  Dispatched when stream duration has been determined.AkamaiStreamController
  For dynamic streaming, indicates the switch is complete and is visible to the user.AkamaiStreamController
  For dynamic streaming, dispatched when either a manual switch has been requested or a switching rule has requested a switch to a new index.AkamaiStreamController
Property Detail
actualIndexproperty
actualIndex:int  [read-only]

The current index being downloaded.


Implementation
    public function get actualIndex():int
addManifestQueryArgsToFragmentRequestsproperty 
addManifestQueryArgsToFragmentRequests:Boolean

If set true, then any query args attached to the manifest request will be added to all subsequent fragment requests. Default value is true.


Implementation
    public function get addManifestQueryArgsToFragmentRequests():Boolean
    public function set addManifestQueryArgsToFragmentRequests(value:Boolean):void
alternativeAudioStreamSwitchingproperty 
alternativeAudioStreamSwitching:Boolean  [read-only]

Indicates whether or not an alternative audio stream switch is currently in progress. This property will return true while an audio stream switch has been requested and the switch has not yet been acknowledged and no switch failure has occurred. Once the switch request has been acknowledged or a failure occurs, the property will return false.


Implementation
    public function get alternativeAudioStreamSwitching():Boolean
analyticsBeaconproperty 
analyticsBeacon:String

Activates the built-in Akamai Client Side Media Analytics (CSMA) plugin, by specifying the beacon path the plugin should track against. To turn-off the tracking after enabling it, pass the empty string ("") as the value. This property greatly simplifies integration with CSMA, by only requiring this single point of activation.

The beacon path is something you would obtain from your Akamai CSMA account manager after you have established a CSMA account.

The default value is true.


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

This function can be used to set an explicit instance of AnalyticsPluginLoader class which is created in the player. This is useful with the integrating of pre-roll advertisements.


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

Pan property of the media. Ranges from -1 (full pan left) to 1 (full pan right).

If the media does not have audio, then the pan property will be set to this value as soon as the media has audio.


Implementation
    public function get audioPan():Number
    public function set audioPan(value:Number):void
autoPlayproperty 
autoPlay:Boolean

Indicates whether the media starts playing right away after calling the play method and as soon as the media has been loaded. The default is true.

If setting to false call the resume method after calling the play method once the media has been loaded. Listening for the AkamaiHDSEvent.NETSTREAM_READY event will ensure the media has been loaded and is ready to resume.


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

See also

autoRewindproperty 
autoRewind:Boolean

Indicates whether media is returned to the beginning after playback completes. If true, when playback completes, the player displays the first frame of the media. If false, when playback completes, the last frame is displayed. The default is true. The autoRewind property is ignored if the loop property is set to true.


Implementation
    public function get autoRewind():Boolean
    public function set autoRewind(value:Boolean):void
averageBandwidthproperty 
averageBandwidth:Number  [read-only]

Returns the bandwidth estimate, in kbps, averaged over the last 2 segments. The bandwidth property gives the bandwidth estimated over the last downloaded fragment.


Implementation
    public function get averageBandwidth():Number
bandwidthproperty 
bandwidth:Number  [read-only]

The estimated bandwidth, in kbps, over which the last fragment was downloaded. Only holds a meaningful value of the first fragment has been fully downloaded.


Implementation
    public function get bandwidth():Number
bufferLengthAtLiveEOSproperty 
bufferLengthAtLiveEOS:Number  [read-only]

Value of the buffer length when live playback ends. This returns the amount of content still left in the buffer, when live streaming stops or in case the encoder ends abruptly.


Implementation
    public function get bufferLengthAtLiveEOS():Number
bufferProfileproperty 
bufferProfile:String

Two different buffer profiles can be set:


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

See also

canPauseproperty 
canPause:Boolean  [read-only]

Indicates whether the media can be paused.


Implementation
    public function get canPause():Boolean
canSeekproperty 
canSeek:Boolean  [read-only]

Indicates whether the media is seekable.


Implementation
    public function get canSeek():Boolean
captionTypeproperty 
captionType:String

Sets the captionType on the streamController for intended captioning.


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

See also

captionURLproperty 
captionURL:String

Takes a URL to the supported caption format used for closed captioning. You can listen for the events TimelineMetadataEvent.MARKER_TIME_REACHED and TimelineMetadataEvent.MARKER_DURATION_REACHED dispatched from this class. The captionType is ideally set before setting the captionURL on the controller. Depending on the captionType and captionURL set, the appropriate captioning plugin is loaded by HDCore.


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

See also

org.osmf.events.TimelineMetadataEvent
currentAlternativeAudioStreamIndexproperty 
currentAlternativeAudioStreamIndex:int  [read-only]

The index of the alternative audio stream currently in use. Returns the 0-based index of the selected stream, or -1 if no stream is selected.


Implementation
    public function get currentAlternativeAudioStreamIndex():int
currentIndexproperty 
currentIndex:int  [read-only]

The currently rendered index.


Implementation
    public function get currentIndex():int
currentTimeUpdateIntervalproperty 
currentTimeUpdateInterval:Number

Interval between the dispatch of the TimeEvent.CURRENT_TIME_CHANGE event in milliseconds.

The default is 250 milliseconds. A non-positive value disables the dispatch of the time change events.


Implementation
    public function get currentTimeUpdateInterval():Number
    public function set currentTimeUpdateInterval(value:Number):void
DFXPCaptionURLproperty 
DFXPCaptionURL:String

[DEPRECATED] - this property is maintained only to ensure backwards compatibility. Use 'captionType' and 'captionURL' instead to set the type and URL for a caption. Takes a URL to the DFXP content file used for closed captioning. You can listen for the events TimelineMetadataEvent.MARKER_TIME_REACHED and TimelineMetadataEvent.MARKER_DURATION_REACHED dispatched from this class.


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

See also

org.osmf.events.TimelineMetadataEvent
displayObjectproperty 
displayObject:DisplayObject

Registers an instance of any display object with the NetStream. This property must be set before play is called against a resource that will implement player verification.


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

The ratio of the time it took to download the last fragment to the duration of video held within that fragment. Only holds a meaningful value of the first fragment has been fully downloaded.


Implementation
    public function get downloadRatio():Number
drmEndDateproperty 
drmEndDate:Date  [read-only]

Returns the end date for the playback window. Returns null if authentication hasn't taken place or if if hasDRM is false.


Implementation
    public function get drmEndDate():Date
drmPeriodproperty 
drmPeriod:Number  [read-only]

Returns the length of the playback window, in seconds. Returns NaN if authentication hasn't taken place or if hasDRM is false. Note that this property will generally be the difference between startDate and endDate, but is included as a property because there may be times where the duration is known up front, but the start or end dates are not (e.g. a one week rental).


Implementation
    public function get drmPeriod():Number
drmStartDateproperty 
drmStartDate:Date  [read-only]

Returns the start date for the playback window. Returns null if authentication hasn't taken place or if hasDRM is false.


Implementation
    public function get drmStartDate():Date
drmStateproperty 
drmState:String  [read-only]

The current state of the DRM for the media. The states are explained in the DRMState enumeration in the org.osmf.drm package. Returns DRMState.UNINITIALIZED if hasDRM is false.


Implementation
    public function get drmState():String
durationproperty 
duration:Number  [read-only]

Duration of the media's playback, in seconds.


Implementation
    public function get duration():Number
durationAsUTCproperty 
durationAsUTC:Number  [read-only]

Returns the current duration as an absolute value, the time in seconds since midnight UTC, Jan 1 1970. Note - this property only has meaning for live streams, or streams which were once live. The streambaseTime property must be >0 for this property to have meaning. A value of NaN will be returned if streambaseTime is 0.


Implementation
    public function get durationAsUTC():Number
dvrAvailabilityproperty 
dvrAvailability:String  [read-only]

A string value denoting the dvr availability mode of the current stream. This can be one of the DVR_AVAILABILITY types found in AkamaiStreamType.


Implementation
    public function get dvrAvailability():String

See also

effectiveBitrateproperty 
effectiveBitrate:Number  [read-only]

Returns the effective bitrate of the last fragment loaded, in kbps. The effective bitrate represents the size of the last fragment divided by the play time it represents. For CBR encoded content, this should be close to the target bitrate for the current rendition. if it is different from the target bitrate bitrate, then it indicates that VBR encoding is being encountered. Note that the last fragment loaded is not the fragment currently playing. The two are separated by the current buffer length.

Before the first fragment has loaded, property value will return NaN.


Implementation
    public function get effectiveBitrate():Number
enableAlternateServerMappingproperty 
enableAlternateServerMapping:Boolean

Enables an Akamai feature called Alternate Server Mapping which can provide improved performance when edge servers are slow to respond to fragment requests.

See your Akamai account rep for information on this feature. Once your account is set up for Alternate Server Mapping, calling this method is all that is required from the player-side to enable it.


Implementation
    public function get enableAlternateServerMapping():Boolean
    public function set enableAlternateServerMapping(value:Boolean):void
enableBestEffortDownloadOnFragmentErrorproperty 
enableBestEffortDownloadOnFragmentError:Boolean

If enableBestEffortDownloadOnFragmentError is set to true, stream reconnect logic is initiated after unsuccessful attempts of fragment retry due to IOError or Data Gap. Best effort attempts are made to download the next valid fragment ahead of the current invalid fragment. Value: Boolean Default: True


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

Enables an Akamai feature called End User IP Mapping which can provide improved performance by mapping a user to the closest edge server possible.

See your Akamai account rep for information on this feature. Once your account is set up for End User IP Mapping, calling this method is all that is required from the player-side to enable it.


Implementation
    public function get enableEndUserMapping():Boolean
    public function set enableEndUserMapping(value:Boolean):void
enableLargeBuffersForLongFormContentproperty 
enableLargeBuffersForLongFormContent:Boolean

If set true, then large buffer targets of 60s (for intermediate bitrates) and 300s (for max bitrates) are used for long form content, defined as any VOD stream having a duration longer than 10min.

Default is true.


Implementation
    public function get enableLargeBuffersForLongFormContent():Boolean
    public function set enableLargeBuffersForLongFormContent(value:Boolean):void
enableLocalSharedObjectproperty 
enableLocalSharedObject:Boolean

Setting to true (the default value) allows Akamai to store data in a Flash Shared Object (a Flash cookie). Setting to false means Akamai will not read or write data from/to any Flash Shared Object.

The default value is true.


Implementation
    public function get enableLocalSharedObject():Boolean
    public function set enableLocalSharedObject(value:Boolean):void
enableLogStringOnFragmentsproperty 
enableLogStringOnFragments:Boolean

A log string is usually appended to each fragment request, allowing QoS stats to be collected on the server. If you are trying to cache the fragments within a network, then you can turn off the "als" query arg by setting this property to false.

The default value is true.


Implementation
    public function get enableLogStringOnFragments():Boolean
    public function set enableLogStringOnFragments(value:Boolean):void
enableSSLTransferproperty 
enableSSLTransfer:Boolean


Implementation
    public function get enableSSLTransfer():Boolean
    public function set enableSSLTransfer(value:Boolean):void
encryptedproperty 
encrypted:Boolean  [read-only]

Returns true if the current stream is encrypted with Akamai Media Encryption


Implementation
    public function get encrypted():Boolean
fragmentRetryAttemptsForLostConnectivityproperty 
fragmentRetryAttemptsForLostConnectivity:Number

The number of times the class will retry a fragment when all client connectivity has been lost. The default is 60.


Implementation
    public function get fragmentRetryAttemptsForLostConnectivity():Number
    public function set fragmentRetryAttemptsForLostConnectivity(value:Number):void
fragmentRetryDataGapThresholdproperty 
fragmentRetryDataGapThreshold:Number

We measure the time it takes from the initial request until we receive the first byte of data per fragment download. If we exceed this value we consider it a timeout and move onto the retry logic for the fragment. If Alternate Server Mapping / End User IP Mapping is enabled, this value will only apply if playing on alternate server for fragment retry logic and will be overridden by the value delivered in the Ident.xml if playing on primary host. The default is 20 seconds. We suggest not setting this value below 5 seconds. Anything below 20 seconds is more aggressive and may result in more stream not found errors. A higher value may result in more rebuffers.


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

See also

fragmentRetryAttemptsForLostConnectivity
enableAlternateServerMapping
hasAlternativeAudioproperty 
hasAlternativeAudio:Boolean  [read-only]

Indicates whether the media has alternative audio streams or not.


Implementation
    public function get hasAlternativeAudio():Boolean
hasAudioproperty 
hasAudio:Boolean  [read-only]

Indicates whether the media has audio.


Implementation
    public function get hasAudio():Boolean
hasDRMproperty 
hasDRM:Boolean  [read-only]

Returns true if the media is DRM protected.


Implementation
    public function get hasDRM():Boolean
holdbackFromLiveproperty 
holdbackFromLive:Number

Use this property to set the holdback value from live point for limited-DVR and unlimited DVR live streams with a LIVE_STABLE buffer profile. This value needs to be in the range of 10 - 60 secs. It defaults to 10 secs and will be reset to that value for No DVR streams.


Implementation
    public function get holdbackFromLive():Number
    public function set holdbackFromLive(value:Number):void
isBufferingproperty 
isBuffering:Boolean  [read-only]

If set true, the netstream is in a buffering state.


Implementation
    public function get isBuffering():Boolean
isDVRRecordingproperty 
isDVRRecording:Boolean  [read-only]

Returns true if the media is DVR-enabled and currently recording, false if the media is either not DVR-enabled, or is DVR-enabled but not currently recording.


Implementation
    public function get isDVRRecording():Boolean
isDynamicStreamproperty 
isDynamicStream:Boolean  [read-only]

Indicates whether the media consists of a dynamic stream.


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

Specifies whether the current stream is live or not


Implementation
    public function get isLiveStream():Boolean
isPausedproperty 
isPaused:Boolean  [read-only]

Returns true if the stream is paused and false if not.


Implementation
    public function get isPaused():Boolean
isPlayingproperty 
isPlaying:Boolean  [read-only]

Indicates whether the media is currently playing.


Implementation
    public function get isPlaying():Boolean
isPlayingLiveproperty 
isPlayingLive:Boolean  [read-only]

Specifies whether the stream is within bounds (60s) of the live point.


Implementation
    public function get isPlayingLive():Boolean
isSeekingproperty 
isSeeking:Boolean  [read-only]

Indicates whether the media is currently seeking.


Implementation
    public function get isSeeking():Boolean
isSwitchingproperty 
isSwitching:Boolean  [read-only]

Indicates whether or not a dynamic stream switch is currently in progress. This property will return true while a switch has been requested and the switch has not yet been acknowledged and no switch failure has occurred. Once the switch request has been acknowledged or a failure occurs, the property will return false.


Implementation
    public function get isSwitching():Boolean
limitMaxSwitchingIndexToPlayerDimensionsproperty 
limitMaxSwitchingIndexToPlayerDimensions:Boolean

CR 3087291 By setting the limitMaxSwitchingIndexToPlayerDimensions boolean to true, the player can limit the maximum allowed index to a video height that does not exceed the player dimensions. Rendering content of a higher resolution usually requires downsizing to fit to player dimensions. This can sometimes introduce artifacts when the content has a lot of text, for example. By limiting stream index dimensions to the embedded player height, downsizing can be avoided, if preferred. If there was a previous maxAllowedIndex setting, it will still apply as the max value for an index chosen through this setting. Value: Boolean Default: False


Implementation
    public function get limitMaxSwitchingIndexToPlayerDimensions():Boolean
    public function set limitMaxSwitchingIndexToPlayerDimensions(value:Boolean):void
loopproperty 
loop:Boolean

Indicates whether the media should play again after playback has completed. The loop property takes precedence over the autoRewind property, so if loop is set to true, the autoRewind property is ignored.

The default is false.


Implementation
    public function get loop():Boolean
    public function set loop(value:Boolean):void
manualSwitchModeproperty 
manualSwitchMode:Boolean

Indicates whether or not the media will automatically switch between dynamic streams. If in manual mode the switchTo method can be used to manually switch to a specific stream.

The default is false.


Implementation
    public function get manualSwitchMode():Boolean
    public function set manualSwitchMode(value:Boolean):void
maxAllowedIndexproperty 
maxAllowedIndex:int

The max allowed index in the current rendition set. Returns -1 if this property has not been set.


Implementation
    public function get maxAllowedIndex():int
    public function set maxAllowedIndex(value:int):void

See also

numDynamicStreams
maxBestEffortDownloadAttemptsOnFragmentErrorproperty 
maxBestEffortDownloadAttemptsOnFragmentError:Number

When fragment download fails due to IOError or data gap, the fragment retry logic kicks in. Following maximum unsuccessful retry attempts, if enableBestEffortDownloadOnFragmentError is set to true, HDCore will try to download the next valid forward fragment, with this value representing the number of such attempts. The default value is 10.


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

When switching multi-bitrate content in auto switching mode, this property specifies the maximum stream bitrate in kbps 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 fullscreen, 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.


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

Intrinsic height of the media, in pixels. The intrinsic height is the height of the media before any processing has been applied. The default if no Display Object is present, is NaN.


Implementation
    public function get mediaHeight():Number
mediaWidthproperty 
mediaWidth:Number  [read-only]

Intrinsic width of the media, in pixels. The intrinsic width is the width of the media before any processing has been applied. The default if no Display Object is present, is NaN.


Implementation
    public function get mediaWidth():Number
minimumBitrateAllowedproperty 
minimumBitrateAllowed:Number

When switching multi-bitrate content in auto switching mode, this property specifies the minimum stream bitrate in kbps for the content. NOTE: If setting this value along with the maximumBitrateAllowed setting, insure that this value is less than the maximum bitrate value by at least one index. For example: max bitrate = 2000 min bitrate = 1500 Make sure that the bitrate range includes a playable index. This is a one time setting that will prune the media items from the manifest that have bitrates less than the corresponding minimum index. These will not be available thereafter in the currently loaded stream.


Implementation
    public function get minimumBitrateAllowed():Number
    public function set minimumBitrateAllowed(value:Number):void
mutedproperty 
muted:Boolean

Indicates whether the media is currently muted.

If the media does not have audio then the muted state will be set to this value as soon as the media has audio.


Implementation
    public function get muted():Boolean
    public function set muted(value:Boolean):void
netSessionModeproperty 
netSessionMode:String

Sets the operation mode for NetSession (HDClient) interaction. The various modes are set via static string constants available in AkamaiNetSessionType.

NETSESSION_USAGE_OPPORTUNISTIC - defines the default netsession usage mode whereby the client will try to use NetSession if it is available. This mode will start the stream playing without using NetSession. Once the first buffer.full event is reached, a discovery request will be made to see if NetSession is installed. If it is, then all subsequent requests will be made through NetSession. If it isn't, then normal playback will continue. Selecting this mode while playback is underway will cause the client to immediately test for NetSession. If NetSession is available, then it will start using it.

NETSESSION_USAGE_NEVER - defines the netsession usage mode whereby the client will never use NetSession. Selecting this mode before playback starts will cause all requests to be directed directly to the edge server. Selecting this mode while playback is underway will cause the client to immediately stop using NetSession if it is using peer-assisted delivery.

An ArgumentError will be thrown if the argument does not match one of these values.


Implementation
    public function get netSessionMode():String
    public function set netSessionMode(value:String):void
netStreamproperty 
netStream:NetStream  [read-only]

Returns the current instance of the NetStream class. Use AkamaiHDSEvent.NETSTREAM_READY event listen to when the netstream is ready.


Implementation
    public function get netStream():NetStream
numDynamicStreamsproperty 
numDynamicStreams:int  [read-only]

The total number of dynamic stream indices.


Implementation
    public function get numDynamicStreams():int
playerDimensionsproperty 
playerDimensions:Object

CR 3087291 This property operates only when the limitMaxSwitchingIndexToPlayerDimensions property is set to true. Set the player dimensions on the controller as an object. The object should have two member variables, "width" representing the width of the embedded player and "height" representing the height of the embedded player. This API should ideally be used on every resize event. This insures the right target switching index is chosen if the limitMaxSwitchingIndexToPlayerDimensions property is set. Example: var dimensions:Object = new Object(); dimensions.width = playerWidth; dimensions.height = playerHeight; //For HDCore: streamController.playerDimensions = dimensions; For AASP: (netStream as AkamaiHTTPNetStream).hdsproperties.playerDimensions = dimensions;


Implementation
    public function get playerDimensions():Object
    public function set playerDimensions(value:Object):void
preloadDecryptionSWFproperty 
preloadDecryptionSWF:Boolean

Set this to true if you know you are playing encrypted media and would like to start playback as fast as possible. Setting to true will bypass the need to wait for encryption to be detected and will automaticlly download the decryption.swf at startup.

The default value is false.


Implementation
    public function get preloadDecryptionSWF():Boolean
    public function set preloadDecryptionSWF(value:Boolean):void
preventSwitchDownOnDroppedFramesproperty 
preventSwitchDownOnDroppedFrames:Boolean

Jira HDCore-133 Jira HDCORE-128 If this property is set, the HDS DroppedFPSRule will not force an emergency switchdown in the requested fragments. Frame dropping is usually observed on switching between tabs. Setting this property on the stream controller will override a recommendation by the OSMF rules to switch down due to dropped frames.


Implementation
    public function get preventSwitchDownOnDroppedFrames():Boolean
    public function set preventSwitchDownOnDroppedFrames(value:Boolean):void
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
resourceproperty 
resource:String  [read-only]

Returns a URL of the media file. String is only valid after the play method has been called.


Implementation
    public function get resource():String
resumeDVRAtLiveproperty 
resumeDVRAtLive:Boolean

Used to determine how a resume is handled after a "Limited DVR" stream is paused beyond the DVR Window. If this property is false (the default value), the stream would resume at the start of DVR Window. If this property is true, the stream would resume at live. (Similar to No DVR). This can be used in cases where Limited DVR with very small DVR Window is used and you want the user to resume at live after a pause.


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

The rolling end offset, in seconds. This defines a rolling window of allowable play time behind the live point of a live stream.


Implementation
    public function get rollingEndOffset():Number
sbrBitrateproperty 
sbrBitrate:Number  [read-only]

Returns the bitrate of the stream in case of single bitrate stream. The value is in kbps.


Implementation
    public function get sbrBitrate():Number
serverIPproperty 
serverIP:String  [read-only]

Returns the server IP address once the stream is playing.


Implementation
    public function get serverIP():String
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 a 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
startingIndexproperty 
startingIndex:Number

The starting index to use when playing multi-bitrate content. This index is zero-based.


Implementation
    public function get startingIndex():Number
    public function set startingIndex(value:Number):void
streamTypeproperty 
streamType:String  [read-only]

Returns the type of the stream. This can be one of the AKAMAI_STREAM_TYPE_ in the AkamaiStreamType class


Implementation
    public function get streamType():String

See also

temporalproperty 
temporal:Boolean  [read-only]

Indicates whether the media is temporal. Temporal media supports a duration and a currentTime within that duration.


Implementation
    public function get temporal():Boolean
timeproperty 
time:Number  [read-only]

Current time of the playhead in seconds.


Implementation
    public function get time():Number
timeAsUTCproperty 
timeAsUTC:Number  [read-only]

Returns the current playhead time as an absolute value, the time in seconds since midnight UTC, Jan 1 1970. Note - this property only has meaning for live streams, or streams which were once live. For Akamai version 1 manifest the streambaseTime property must be >0 for this property to have meaning. A value of NaN will be returned if streambaseTime is 0.


Implementation
    public function get timeAsUTC():Number
totalAlternativeAudioIndicesproperty 
totalAlternativeAudioIndices:int  [read-only]

Returns the total number of alternative audio streams or 0 if there are no alternative audio streams present.


Implementation
    public function get totalAlternativeAudioIndices():int
usingNetSessionproperty 
usingNetSession:Boolean  [read-only]

Returns true if the class is currently using NetSession to request fragments.


Implementation
    public function get usingNetSession():Boolean
vbrRatioproperty 
vbrRatio:Number  [read-only]

Returns an estimate of the degree of VBR (variable bitrate encoding) encountered in the current content. For CBR encoded content, this value should be 1. For VBR content with a floor of 30% and peak of 500% (where 100% represents the target bitrate), then this value should range from 0.3 to 5.0.

Note this value is calculated from the last fragment downloaded. This is not the same as the fragment which is currently rendering. The two are separated by the current buffer length.

Before the first fragment has loaded, property value will return NaN.


Implementation
    public function get vbrRatio():Number
volumeproperty 
volume:Number

Volume of the media. Ranges from 0 (silent) to 1 (full volume).


Implementation
    public function get volume():Number
    public function set volume(value:Number):void
Constructor Detail
AkamaiStreamController()Constructor
public function AkamaiStreamController()

Constructor.

Method Detail
analyticsSetData()method
public function analyticsSetData(key:String, value:Object):void

Calls AnalyticsPluginLoader.setData with the key/value pair provided to the method. You can call this before or after calling the analyticsBeacon setter property. See the "Media Analytics Plug-in Integration Guide for Adobe Flash Players" for more information on the AnalyticsPluginLoader.setData method.

Parameters

key:String
 
value:Object

See also

authenticate()method 
public function authenticate(username:String = null, password:String = null):void

Authenticates the media. Can be used for both anonymous and credential-based authentication under Adobe Flash Access. Listen for the requiresUsernamePassword event to know if user/pass info is required for this content.

Parameters

username:String (default = null) — The username. Should be null for anonymous authentication.
 
password:String (default = null) — The password. Should be null for anonymous authentication.

authenticateWithToken()method 
public function authenticateWithToken(token:Object):void

Authenticates the media using an object which serves as a token. Can be used for both anonymous and credential-based authentication with Adobe Flash Access. Can be String or ByteArray. If a String is provided, the token will be automatically created at the proper time and set on the drmService. You can call this anytime before play is called with a String. If you are manually creating the token externally as an Object, you must not call this method until the event AkamaiHDSEvent.DRM_AUTHENTICATING has been dispatched.

Parameters

token:Object — The token to use for authentication.

See also

com.akamai.net.f4f.hds.events.AkamaiHDSEvent.DRM_AUTHENTICATING
closeAndDestroy()method 
public function closeAndDestroy():void

Cleans up the class completely. A new instance of this class is required after calling this method. You should set your instance to null immediately after calling this method.

convertToUTC()method 
public function convertToUTC(value:Number):Number

Returns the time in seconds since midnight UTC, Jan 1 1970, corresponding to the input number of relative seconds. The input should be a time value in seconds relative to the current start time and play duration boundaries (if any). This method is used to enable a scrub bar to show absolute time while being scrubbed. It should be used in conjunction with the timeAsUTC and durationAsUTC properties which give the playhead and max duration as UTC time respectively

Note - this property only has meaning for live streams, or streams which were once live.

Parameters

value:Number

Returns
Number
getAlternativeAudioItemAt()method 
public function getAlternativeAudioItemAt(index:int):StreamingItem

Obtains the alternative audio stream corresponding to the specified (0-based) index. Returns null if the index is -1.

Parameters

index:int

Returns
StreamingItem

Throws
RangeError — if the specified alternative audio stream index is less than -1 or greater than the highest alternative audio index available.
 
IllegalOperationError — if the currently loaded media does not have any associated alternative audio streams.
getBitrateAtQualitylevel()method 
public function getBitrateAtQualitylevel(value:uint):Number

Gets the associated bitrate, in kilobytes for the specified dynamic stream index.

Parameters

value:uint

Returns
Number

Throws
RangeError — If the specified dynamic stream index is less than zero or greater than the highest dynamic stream index available.
 
IllegalOperationError — If the media is not a dynamic stream.
getStreamNameAtQualityLevel()method 
public function getStreamNameAtQualityLevel(value:uint):String

Returns the name of a stream at the index value supplied only after play has been called and only if is dynamic stream, Otherwise it returns null.

Parameters

value:uint — a uint indicating which index of the dynamic streaming item.

Returns
String
pause()method 
public function pause():void

Pauses the media, if it is not already paused.


Throws
IllegalOperationError — if the media cannot be paused.
play()method 
public function play(... args):void

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 10.1

The play method initiates playback of a piece of media. Three arguments are supported:

  1. source - required - a String resource pointing at a valid f4m manifest containing Adobe HTTP Dynamic Streaming content.
  2. start time - optional - a Number indicating the desired start time of the clip in seconds. For example, if the duration of the media is 100s and a start time of 20 is supplied, the class will play a sub-clip of the original content, starting at time 20 and going to 100. The duration property for the class will show 80 and the playhead time will increase from 0 to 80. 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 streams and archivesof live streams can support this type of absolute start time. Note that for any LIVE or ARCHIVED LIVE stream you should always specify the start time using a UTC value and not a relative one.

    The start time argument -1 is supported. It implies that a live stream only can be played. If -1 is supplied and the manifest turns out to represent recorded playback then the stream will immediately end.

    Note that use of startTime always creates a sub-clip. It is not possible to start a stream at 20 and still give the user access to the portion from 0-20. For that use case, you should call play(src) and then issue a seek(20) as soon as you receive the AkamaiHDSEvent.NETSTREAM_READY event or the isPlaying property returns true.
  3. play duration - optional - a Number indicating the desired play duration in seconds. For example if the parent stream is 100s long and the start parameter is 20 and the play duration parameter is 30, then a subclip of duration 30 will be created, containing content from time 20 to time 50 of the parent stream. The playhead time will start at 0 and will increase to 30 during playback. Play duration will also work in conjunction with absolute start times. For example, if you called play(src,1316132030,30), it would play the live stream (or live stream archive) identified by src, starting at unix time 1316132030, for 30 seconds.

    The negative argument -1 is supported. It means that the stream will play through to its normal end and is functionally equivalent to omitting this argument entirely.

    If a play duration of 0 is specified, it will cause the stream to seek to the time specified by the start time parameter and then stop, essentially creating a thumbnail at that time. This works with relative start times for VOD streams as well as absolute times for live streams. Note that the stop may not be immediate and the stream may render for a few seconds before stopping. This is due to the fact that there is no rendering event for the NetStream and we cannot be sure when an image is actually visible to the end-user. Therefore the class is conservative and allows it to play for a brief period of time in order to guarantee an image across all OS/browser combinations.

Parameters

... args

requestAMDLongTokenForManifestURL()method 
public function requestAMDLongTokenForManifestURL(url:String):void

Jira HDCORE-141 Set the requestAMDLongToken property to true if the HDS stream is of AMD VoD type and token authentication is activated in the SecureHD policy. AMD Live is currently not supported and may be supported in the future. Setting to true will create and make a request for the long token to be appended to future AMD fragment requests.

Parameters

url:String

resume()method 
public function resume():void

Resumes the media from a paused state.

seek()method 
public function seek(value:Number):void

Instructs the playhead to jump to the specified time.

If time is NaN or negative, does not attempt to seek.

Parameters

value:Number — Time to seek to in seconds.


Throws
IllegalOperationError — if the media cannot be seeked.
stop()method 
public function stop():void

Immediately halts playback and returns the playhead to the beginning of the media file.

switchAlternativeAudioIndex()method 
public function switchAlternativeAudioIndex(index:int):void

Changes the current audio stream to the alternative audio stream specified by a 0-based index value. Passing -1 as the index value resets the current audio stream to the default audio stream. Note that if media playback is paused, the audio stream switch does not occur until after play resumes.

Parameters

index:int


Throws
RangeError — if the specified alternative audio stream index is less than -1 or greater than numAlternativeAudioStreams - 1.
 
IllegalOperationError — if the currently loaded media does not have any associated alternative audio streams.
switchTo()method 
public function switchTo(value:int):void

Switch to a specific dynamic stream index. To switch up, use the currentIndex property.

Parameters

value:int


Throws
RangeError — If the specified dynamic stream index is less than zero or greater than maxAllowedIndex.
 
IllegalOperationError — If the media is not a dynamic stream, or if the dynamic stream is not in manual switch mode.

See also

maxAllowedIndex
timeCode()method 
public function timeCode(value:Number):String

A utility method which converts seconds into TimeCode.

Parameters

value:Number

Returns
String
unloadMedia()method 
public function unloadMedia():void

Unloads the media completely, requiring a new call to the play method.

Event Detail
amdLongToken Event
Event Object Type: com.akamai.net.f4f.hds.events.AkamaiHDSEvent

Dispatched when the long token request for an AMD VoD stream returns with a valid response body.

complete Event  
Event Object Type: com.akamai.net.f4f.hds.events.AkamaiHDSEvent

Dispatched when a stream has played to completion.

drmAuthenticating Event  
Event Object Type: com.akamai.net.f4f.hds.events.AkamaiHDSEvent

Dispatched when a DRM protected stream requires a token to authenticate.

NOTE: there is a convenient way of authenticating a token protected Flash Access stream by using the authenticateWithToken method. This method will accept a token and handle authentication when required, no event listener is necessary in this case.

See also

error Event  
Event Object Type: com.akamai.net.f4f.hds.events.AkamaiHDSEvent

Dispatched when an error which impacts the operation of media playback occurs. The data object contains an org.osmf.events.MediaError object.

hasAlternativeAudioChange Event  
Event Object Type: com.akamai.net.f4f.hds.events.AkamaiHDSEvent

Dispatched when the hasAlternativeAudio property has changed.

See also

httpStatus Event  
Event Object Type: com.akamai.net.f4f.hds.events.AkamaiHTTPStatusEvent

Dispatched with the HTTP status code of each fragment before a complete/error. Contains following properties: - status : The HTTP status code - url : The URL of request

isbuffering Event  
Event Object Type: com.akamai.net.f4f.hds.events.AkamaiHDSEvent

Dispatched when the buffering state of the media changes. The data object is a Boolean.

islivestream Event  
Event Object Type: com.akamai.net.f4f.hds.events.AkamaiHDSEvent

Dispatched after the stream has been loaded and determined to be a live stream.

isPlayingLive Event  
Event Object Type: com.akamai.net.f4f.hds.events.AkamaiHDSEvent

Dispatched when the isPlayingLive property changes state.

markerDurationReached Event  
Event Object Type: org.osmf.events.TimelineMetadataEvent

Dispatched when the currentTime property of the MediaElement associated with this TimelineMetadata has reached the duration offset of one of the TimelineMarkers in this TimelineMetadata.

markerTimeReached Event  
Event Object Type: org.osmf.events.TimelineMetadataEvent

Dispatched when the currentTime property of the MediaElement associated with this TimelineMetadata has reached the time value of one of the TimelineMarkers in this TimelineMetadata.

netStreamReady Event  
Event Object Type: com.akamai.net.f4f.hds.events.AkamaiHDSEvent

Dispatched when the netStream property is ready for use (meaning it will return a non-null object). There is no payload with this event, it is simply a notifier event.

progress Event  
Event Object Type: com.akamai.net.f4f.hds.events.AkamaiHDSEvent

Dispatched during the life of the stream with an interval of 100ms. Like a heart-beat indicating the stream is active.

requiresUsernamePassword Event  
Event Object Type: com.akamai.net.f4f.hds.events.AkamaiHDSEvent

Dispatched when a DRM protected stream requires a username and password to authenticate.

     private function onRequiresPassword(event:Event):void
     {
             // Since the stream get's re-loaded after authentication, you will need to listen
             // for the AkamaiHDSEvent.NETSTREAM_READY event and re-attach the
             // NetStream object to the video object.
             streamController.addEventListener(AkamaiHDSEvent.NETSTREAM_READY, onNetStreamReady);
     
             // ... Prompt the user for username and password ...
             getUsernamePassword();
     
             // Authenticate
         streamController.authenticate(userInput.text, passwordInput.text);
     }
     

See also

streamlength Event  
Event Object Type: com.akamai.net.f4f.hds.events.AkamaiHDSEvent

Dispatched when stream duration has been determined. The data property will be the stream length.

switchComplete Event  
Event Object Type: com.akamai.net.f4f.hds.events.AkamaiHDSEvent

For dynamic streaming, indicates the switch is complete and is visible to the user. The data object for the event will contain:

switchRequested Event  
Event Object Type: com.akamai.net.f4f.hds.events.AkamaiHDSEvent

For dynamic streaming, dispatched when either a manual switch has been requested or a switching rule has requested a switch to a new index. The data object for the event will contain these items:

Examples
Simple example of using the AkamaiStreamController:
     package
     {
         import com.akamai.net.f4f.hds.AkamaiStreamController;
         import com.akamai.net.f4f.hds.events.AkamaiHDSEvent;
     
         import flash.display.Sprite;
         import flash.media.Video;
     
         public class AkamaiStreamControllerExample extends Sprite
         {
         private var MEDIA:String = "http://multiplatform-f.akamaihd.net/z/multi/april11/hdworld/hdworld_,512x288_450_b,640x360_700_b,768x432_1000_b,1024x576_1400_m,1280x720_1900_m,1280x720_2500_m,1280x720_3500_m,.mp4.csmil/manifest.f4m";
             private var streamController:AkamaiStreamController;
     
             public function AkamaiStreamControllerExample()
             {
                 streamController = new AkamaiStreamController();
                 streamController.addEventListener(AkamaiHDSEvent.NETSTREAM_READY, onNetStreamReady);
                 streamController.play(MEDIA);
             }
     
             private function onNetStreamReady(event:AkamaiHDSEvent):void
             {
                 var video:Video = new Video(320, 180);
                 video.attachNetStream(streamController.netStream);
                 addChild(video);
             }
         }
     }