Packagecom.adobe.mediacore
Interfacepublic interface MediaPlayer extends flash.events.IEventDispatcher
Implementors DefaultMediaPlayer

Media player class.



Public Properties
 PropertyDefined By
  abrControlParameters : ABRControlParameters
Media player parameters that control the playback of MBR content.
MediaPlayer
  bufferControlParameters : BufferControlParameters
Media player parameters that control the buffering policies.
MediaPlayer
  bufferedRange : TimeRange
[read-only] Returns the buffered range.
MediaPlayer
  ccStyle : ClosedCaptionStyles
Closed captioning style.
MediaPlayer
  ccVisibility : String
Current status of closed captions visibility.
MediaPlayer
  config : MediaPlayerConfig
Media player configuration.
MediaPlayer
  context : MediaPlayerContext
[read-only] Media player context.
MediaPlayer
  currentItem : MediaPlayerItem
[read-only] Gets the current media player item.
MediaPlayer
  currentTime : Number
[read-only] The current playhead time as reported by the underlying components.
MediaPlayer
  currentTimeUpdateInterval : uint
Interval between the dispatch of change events for the current time in milliseconds.
MediaPlayer
  drmManager : DRMManager
[read-only]
MediaPlayer
  localTime : Number
[read-only] The current playhead time as reported by the underlying components.
MediaPlayer
  playbackMetrics : PlaybackMetrics
[read-only] Provides the playback metrics associated with this player.
MediaPlayer
  playbackRange : TimeRange
[read-only] Returns the playback range
MediaPlayer
  rate : Number
Returns the current playback rate.
MediaPlayer
  seekableRange : TimeRange
[read-only] Returns the seekable range
MediaPlayer
  status : String
[read-only] Returns the media player status.
MediaPlayer
  timeline : Timeline
[read-only] The current timeline containing both main content and associated alternate content (ads).
MediaPlayer
  view : MediaPlayerView
Returns the view where the media player will render the images.
MediaPlayer
  volume : Number
Media player volume.
MediaPlayer
Public Methods
 MethodDefined By
  
convertToLocalTime(time:Number):Number
Calculate the local time which maps to the specified virtual time.
MediaPlayer
  
pause():void
Pauses the playback of the current media item.
MediaPlayer
  
play():void
Initiates or resumes the playback of the current media item.
MediaPlayer
  
prepareToPlay(... args):void
Prepares to play the current selected item.
MediaPlayer
  
release():void
Releases media player object.
MediaPlayer
  
replaceCurrentItem(mediaPlayerItem:MediaPlayerItem):void
Replaces the current media item or sets one if none exists by using a previously loaded media resource.
MediaPlayer
  
Replaces the current media item or sets one if none exists by loading the specified resource.
MediaPlayer
  
reset():void
Resets the media player to its uninitialized state.
MediaPlayer
  
seek(position:Number):void
Moves the play head to specified virtual position.
MediaPlayer
  
seekToLocal(position:Number):void
Moves the play head to specified local position.
MediaPlayer
Events
 Event Summary Defined By
  Event dispatched when an ad break completes.MediaPlayer
  Event dispatched when an ad break is skipped.MediaPlayer
  Event dispatched when an ad break starts.MediaPlayer
  Event dispatched when an ad completes.MediaPlayer
  Event dispatched when playback progresses while playing an ad.MediaPlayer
  Event dispatched when an ad starts.MediaPlayer
  Event dispatched by the MediaPlayer when playback stalls due buffer underflow.MediaPlayer
  Event dispatched by the MediaPlayer when buffer is full.MediaPlayer
  Event dispatched when new load information is available.MediaPlayer
  Event dispatched by the MediaPlayer every time a resource is successfully loaded through the replaceCurrentResource method.MediaPlayer
  Event dispatched by the MediaPlayer every time a live/linear media player item is successfully update during playback due to manifest/playlist updates.MediaPlayer
  Event dispatched when new load information is available.MediaPlayer
  Event dispatched when the new playback rate is visible on the screen.MediaPlayer
  Event dispatched when a new value is set to rate property on MediaPlayer.MediaPlayer
  Event dispatched by the MediaPlayer when seek operation starts.MediaPlayer
  Event dispatched by the MediaPlayer when seek operation ends.MediaPlayer
  Event dispatched by the MediaPlayer when seek position is adjusted due internal or external rules.MediaPlayer
  Event dispatched by the MediaPlayer every time it transitions to a new status.MediaPlayer
  Event dispatched when the media player change its playhead position.MediaPlayer
  Event dispatched when new timed metadata is available.MediaPlayer
  Event dispatched when the media player timeline has changed.MediaPlayer
Property Detail
abrControlParametersproperty
abrControlParameters:ABRControlParameters

Media player parameters that control the playback of MBR content.


Implementation
    public function get abrControlParameters():ABRControlParameters
    public function set abrControlParameters(value:ABRControlParameters):void

Throws
IllegalStateException — if media player was already released.
bufferControlParametersproperty 
bufferControlParameters:BufferControlParameters

Media player parameters that control the buffering policies.


Implementation
    public function get bufferControlParameters():BufferControlParameters
    public function set bufferControlParameters(value:BufferControlParameters):void

Throws
IllegalStateException — if media player was already released.
bufferedRangeproperty 
bufferedRange:TimeRange  [read-only]

Returns the buffered range.


Implementation
    public function get bufferedRange():TimeRange

Throws
IllegalStateException — if the media player was already released.
ccStyleproperty 
ccStyle:ClosedCaptionStyles

Closed captioning style. Used to control the closed captioning font, size, color, edge and opacity. This method is safe to use even if the current media stream doesn't have closed captions.


Implementation
    public function get ccStyle():ClosedCaptionStyles
    public function set ccStyle(value:ClosedCaptionStyles):void

Throws
com.adobe.mediacore.errors:IllegalStateException
ccVisibilityproperty 
ccVisibility:String

Current status of closed captions visibility. ClosedCaptionsVisibility.VISIBLE if closed captions should be displayed when available, or ClosedCaptionsVisibility.HIDDEN if otherwise. This method is safe to use even if the current media stream doesn't have closed captions.


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

Throws
IllegalStateException — if media player was already released.
configproperty 
config:MediaPlayerConfig

Media player configuration. Allows for configuration and customization of various media player components like content resolving or analytics service.


Implementation
    public function get config():MediaPlayerConfig
    public function set config(value:MediaPlayerConfig):void

Throws
IllegalStateException — if the media player was already released.
contextproperty 
context:MediaPlayerContext  [read-only]

Media player context. Return the MediaPlayerContext. used to access the authorizedFeatures


Implementation
    public function get context():MediaPlayerContext
currentItemproperty 
currentItem:MediaPlayerItem  [read-only]

Gets the current media player item.


Implementation
    public function get currentItem():MediaPlayerItem

Throws
IllegalStateException — if the media player item is not yet available or the media player was already released.
currentTimeproperty 
currentTime:Number  [read-only]

The current playhead time as reported by the underlying components. The playhead time is calculated relative to the resolved stream, one which can contain multiple ads inserted.


Implementation
    public function get currentTime():Number

Throws
IllegalStateException — if the media player was already released.
currentTimeUpdateIntervalproperty 
currentTimeUpdateInterval:uint

Interval between the dispatch of change events for the current time in milliseconds. The default is 250 milliseconds. A zero value disables the dispatch of the change events. The minimum accepted value (except zero) is 50 milliseconds, due to performance concerns. Attempting to set the interval to a lower value will result in it being set to 50.


Implementation
    public function get currentTimeUpdateInterval():uint
    public function set currentTimeUpdateInterval(value:uint):void
drmManagerproperty 
drmManager:DRMManager  [read-only]


Implementation
    public function get drmManager():DRMManager
localTimeproperty 
localTime:Number  [read-only]

The current playhead time as reported by the underlying components. The playhead time is calculated relative to the original stream, any ad inserted is ignored.


Implementation
    public function get localTime():Number

Throws
IllegalStateException — if the media player was already released.
playbackMetricsproperty 
playbackMetrics:PlaybackMetrics  [read-only]

Provides the playback metrics associated with this player.


Implementation
    public function get playbackMetrics():PlaybackMetrics

Throws
IllegalStateException — if media player was already released.
playbackRangeproperty 
playbackRange:TimeRange  [read-only]

Returns the playback range


Implementation
    public function get playbackRange():TimeRange

Throws
IllegalStateException — if media player was already released.
rateproperty 
rate:Number

Returns the current playback rate.


Implementation
    public function get rate():Number
    public function set rate(value:Number):void
seekableRangeproperty 
seekableRange:TimeRange  [read-only]

Returns the seekable range


Implementation
    public function get seekableRange():TimeRange

Throws
IllegalStateException — if media player was already released.
statusproperty 
status:String  [read-only]

Returns the media player status.


Implementation
    public function get status():String
timelineproperty 
timeline:Timeline  [read-only]

The current timeline containing both main content and associated alternate content (ads). The timeline can update over time as more and more alternate content is placed on it.


Implementation
    public function get timeline():Timeline

Throws
IllegalStateException — if the media player was already released.
viewproperty 
view:MediaPlayerView

Returns the view where the media player will render the images.


Implementation
    public function get view():MediaPlayerView
    public function set view(value:MediaPlayerView):void

Throws
IllegalStateException — if the media player was already released.
volumeproperty 
volume:Number

Media player volume. Ranges from 0 (silent) to 1 (full volume).


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

Throws
IllegalStateException — if media player was already released.
Method Detail
convertToLocalTime()method
public function convertToLocalTime(time:Number):Number

Calculate the local time which maps to the specified virtual time. If there are no ads inserted on the timeline, then the local time and virtual time are the same.

Parameters

time:Number — Virtual time which needs to be mapped.

Returns
Number — returns local time.
pause()method 
public function pause():void

Pauses the playback of the current media item. If the current media item was already paused, calling this method will have no effect. In order to resume the playback of the current media item, call play() method.


Throws
IllegalStateException — if the media player is in a state different from PREPARED, PAUSED or PLAYING state.
play()method 
public function play():void

Initiates or resumes the playback of the current media item. If the current media item is not yet ready to play it will invoke prepareToPlay first. If the current media item was paused, then invoking this command will resume the playback from where it was paused, otherwise it will start the playback from the beginning. If the current media item was already playing, calling this method will have no effect.


Throws
IllegalStateException — if the media player is in a state different from PREPARED, PAUSED or PLAYING state.
prepareToPlay()method 
public function prepareToPlay(... args):void

Prepares to play the current selected item. Initiates the loading of specified resource or media player item. The process is asynchronous and may be successful or not depending on the resource availability and if the resource is compatible with our runtime.

Parameters

... args


Throws
IllegalStateException — if the media player is in a state different from INITIALIZED state.
release()method 
public function release():void

Releases media player object. IMPORTANT! The media player being released can't be used anymore. Invoking any method of the media player once has been released will result in an IllegalStateException being thrown. It will release the underlying resources associated with this media player object. It is considered good practice to call this method when you're done using it. In addition to unnecessary resources being held, failure to call this method immediately if a media player object is no longer needed may also lead to continuous battery consumption for mobile devices, and playback failure for other applications if no multiple instances of the same codec are supported on a device.

replaceCurrentItem()method 
public function replaceCurrentItem(mediaPlayerItem:MediaPlayerItem):void

Replaces the current media item or sets one if none exists by using a previously loaded media resource. Use this method to continue playing a resource which was previously loaded and processed. The prepareToPlay() method should be called afterwards.

Parameters

mediaPlayerItem:MediaPlayerItem — the media player item to be set.

replaceCurrentResource()method 
public function replaceCurrentResource(mediaResource:MediaResource, config:MediaPlayerItemConfig = null):void

Replaces the current media item or sets one if none exists by loading the specified resource. Use this method to automatically load and process the media to be played. The media resource contains information about the stream URL to be played alongside metadata (such as ad breaks information). The prepareToPlay() should be called afterwards.

Parameters

mediaResource:MediaResource — The media resource to be set
 
config:MediaPlayerItemConfig (default = null) — The media player item configuration to be used with this resource. If null value is provided, then the global PSDK configuration will be used.

reset()method 
public function reset():void

Resets the media player to its uninitialized state. After calling this method, you will have to initialize it again by setting the media player item through replaceCurrentItem() method and calling prepareToPlay() method.

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

Moves the play head to specified virtual position. The specified position is resolved considering all the additional content which might be spliced into the stream (ads, slates, etc). The actual start position after seek may be different than the desired one due additional rules which may apply. For example seeking in the middle of an ad is not permitted and in this case the seek position will be adjusted based on the specified ad policies. Developers should listen for SEEK_POSITION_ADJUSTED event which will provide the adjusted position. The actual position in the stream after seek will be provided through SEEK_COMPLETE notification.

Parameters

position:Number — the desired position from where to start the playback


Throws
IllegalStateException — if the media player is in a state different from PREPARED, PAUSED or PLAYING state.
seekToLocal()method 
public function seekToLocal(position:Number):void

Moves the play head to specified local position. The specified position is resolved excluding all the additional content which might be spliced into the stream (ads, slates, etc). Only the original stream is considered. The actual start position after seek may be different than the desired one due additional rules which may apply. For example seeking in the middle of an ad is not permitted and in this case the seek position will be adjusted based on the specified ad policies. Developers should listen for SEEK_POSITION_ADJUSTED event which will provide the adjusted position. The actual position in the stream after seek will be provided through SEEK_COMPLETE notification.

Parameters

position:Number — the desired position from where to start the playback


Throws
IllegalStateException — if the media player is in a state different from PREPARED, PAUSED or PLAYING state.
Event Detail
adBreakCompleted Event
Event Object Type: com.adobe.mediacore.events.AdBreakPlaybackEvent

Event dispatched when an ad break completes. The ad break which just completed is provided through adBreak property of the event.

adBreakSkipped Event  
Event Object Type: com.adobe.mediacore.events.AdBreakPlaybackEvent

Event dispatched when an ad break is skipped. The ad break which has just skipped is provided through the adBreak property of the event.

adBreakStart Event  
Event Object Type: com.adobe.mediacore.events.AdBreakPlaybackEvent

Event dispatched when an ad break starts. The ad break which just started is provided through adBreak property of the event.

adCompleted Event  
Event Object Type: com.adobe.mediacore.events.AdPlaybackEvent

Event dispatched when an ad completes. The ad which just started is provided through the ad property of the event. Also the ad break containing this ad is also provided through adBreak property of the event.

adProgress Event  
Event Object Type: com.adobe.mediacore.events.AdPlaybackEvent

Event dispatched when playback progresses while playing an ad.

adStart Event  
Event Object Type: com.adobe.mediacore.events.AdPlaybackEvent

Event dispatched when an ad starts. The ad which just started is provided through the ad property of the event. Also the ad break containing this ad is also provided through adBreak property of the event.

bufferingBegin Event  
Event Object Type: com.adobe.mediacore.events.BufferEvent

Event dispatched by the MediaPlayer when playback stalls due buffer underflow.

bufferingEnd Event  
Event Object Type: com.adobe.mediacore.events.BufferEvent

Event dispatched by the MediaPlayer when buffer is full.

drmMetadataInfoAvailable Event  
Event Object Type: com.adobe.mediacore.events.DRMMetadataInfoEvent

Event dispatched when new load information is available. The obtained load information is exposed through loadInformation property.

itemCreated Event  
Event Object Type: com.adobe.mediacore.events.MediaPlayerItemEvent

Event dispatched by the MediaPlayer every time a resource is successfully loaded through the replaceCurrentResource method. The newly created MediaPlayerItem is available through the item property of the event.

itemUpdated Event  
Event Object Type: com.adobe.mediacore.events.MediaPlayerItemEvent

Event dispatched by the MediaPlayer every time a live/linear media player item is successfully update during playback due to manifest/playlist updates. The updated MediaPlayerItem is available through the item property of the event.

loadInformationAvailable Event  
Event Object Type: com.adobe.mediacore.events.LoadInformationEvent

Event dispatched when new load information is available. The obtained load information is exposed through loadInformation property.

ratePlaying Event  
Event Object Type: com.adobe.mediacore.events.PlaybackRateEvent

Event dispatched when the new playback rate is visible on the screen. The actual playback rate is exposed through rate property.

rateSelected Event  
Event Object Type: com.adobe.mediacore.events.PlaybackRateEvent

Event dispatched when a new value is set to rate property on MediaPlayer. The set rate is exposed through rate property.

seekBegin Event  
Event Object Type: com.adobe.mediacore.events.SeekEvent

Event dispatched by the MediaPlayer when seek operation starts.

seekEnd Event  
Event Object Type: com.adobe.mediacore.events.SeekEvent

Event dispatched by the MediaPlayer when seek operation ends.

seekPositionAdjusted Event  
Event Object Type: com.adobe.mediacore.events.SeekEvent

Event dispatched by the MediaPlayer when seek position is adjusted due internal or external rules.

statusChanged Event  
Event Object Type: com.adobe.mediacore.events.MediaPlayerStatusChangeEvent

Event dispatched by the MediaPlayer every time it transitions to a new status. The newly MediaPlayer status is provided through the status property of the event. When MediaPlayer transitions to ERROR status then the error which triggered this transition is available through the error property of the event.

timeChanged Event  
Event Object Type: com.adobe.mediacore.events.TimeChangeEvent

Event dispatched when the media player change its playhead position. The current time is exposed through currentTime property. When the player goes into ERROR status the current time is no longer updated.

timedMetadataAvailable Event  
Event Object Type: com.adobe.mediacore.events.TimedMetadataEvent

Event dispatched when new timed metadata is available. The available timed metdata object is exposed through timedMetadata property.

timelineUpdated Event  
Event Object Type: com.adobe.mediacore.events.TimelineEvent

Event dispatched when the media player timeline has changed. The actual timeline is exposed through timeline property.