Packagecom.adobe.mediacore
Classpublic final class DefaultMediaPlayer
InheritanceDefaultMediaPlayer Inheritance flash.events.EventDispatcher
Implements MediaPlayer

Default implementation of media player interface provided by PSDK framework.



Public Properties
 PropertyDefined By
  abrControlParameters : ABRControlParameters
Media player parameters that control the playback of MBR content.
DefaultMediaPlayer
  bufferControlParameters : BufferControlParameters
Media player parameters that control the buffering policies.
DefaultMediaPlayer
  bufferedRange : TimeRange
[read-only] Returns the buffered range.
DefaultMediaPlayer
  ccStyle : ClosedCaptionStyles
Closed captioning style.
DefaultMediaPlayer
  ccVisibility : String
Current status of closed captions visibility.
DefaultMediaPlayer
  config : MediaPlayerConfig
Media player configuration.
DefaultMediaPlayer
  context : MediaPlayerContext
[read-only] Media player context.
DefaultMediaPlayer
  currentItem : MediaPlayerItem
[read-only] Gets the current media player item.
DefaultMediaPlayer
  currentTime : Number
[read-only] The current playhead time as reported by the underlying components.
DefaultMediaPlayer
  currentTimeUpdateInterval : uint
Interval between the dispatch of change events for the current time in milliseconds.
DefaultMediaPlayer
  drmManager : DRMManager
[read-only]
DefaultMediaPlayer
  localTime : Number
[read-only] The current playhead time as reported by the underlying components.
DefaultMediaPlayer
  playbackMetrics : PlaybackMetrics
[read-only] Provides the playback metrics associated with this player.
DefaultMediaPlayer
  playbackRange : TimeRange
[read-only] Returns the playback range
DefaultMediaPlayer
  rate : Number
Returns the current playback rate.
DefaultMediaPlayer
  seekableRange : TimeRange
[read-only] Returns the seekable range
DefaultMediaPlayer
  status : String
[read-only] Returns the media player status.
DefaultMediaPlayer
  timeline : Timeline
[read-only] The current timeline containing both main content and associated alternate content (ads).
DefaultMediaPlayer
  view : MediaPlayerView
Returns the view where the media player will render the images.
DefaultMediaPlayer
  volume : Number
Media player volume.
DefaultMediaPlayer
Public Methods
 MethodDefined By
  
Default constructor.
DefaultMediaPlayer
  
convertToLocalTime(time:Number):Number
Calculate the local time which maps to the specified virtual time.
DefaultMediaPlayer
  
[static] Convenience method for creating a media player.
DefaultMediaPlayer
  
pause():void
Pauses the playback of the current media item.
DefaultMediaPlayer
  
play():void
Initiates or resumes the playback of the current media item.
DefaultMediaPlayer
  
prepareToPlay(... args):void
Prepares to play the current selected item.
DefaultMediaPlayer
  
release():void
Releases media player object.
DefaultMediaPlayer
  
replaceCurrentItem(mediaPlayerItem:MediaPlayerItem):void
Replaces the current media item or sets one if none exists by using a previously loaded media resource.
DefaultMediaPlayer
  
Replaces the current media item or sets one if none exists by loading the specified resource.
DefaultMediaPlayer
  
reset():void
Resets the media player to its uninitialized state.
DefaultMediaPlayer
  
seek(position:Number):void
Moves the play head to specified virtual position.
DefaultMediaPlayer
  
seekToLocal(position:Number):void
Moves the play head to specified local position.
DefaultMediaPlayer
Public Constants
 ConstantDefined By
  LIVE_POINT : int = -2
[static] Constant used to seek to the live point.
DefaultMediaPlayer
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
bufferControlParametersproperty 
bufferControlParameters:BufferControlParameters

Media player parameters that control the buffering policies.


Implementation
    public function get bufferControlParameters():BufferControlParameters
    public function set bufferControlParameters(value:BufferControlParameters):void
bufferedRangeproperty 
bufferedRange:TimeRange  [read-only]

Returns the buffered range.


Implementation
    public function get bufferedRange():TimeRange
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
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
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
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
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
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
playbackMetricsproperty 
playbackMetrics:PlaybackMetrics  [read-only]

Provides the playback metrics associated with this player.


Implementation
    public function get playbackMetrics():PlaybackMetrics
playbackRangeproperty 
playbackRange:TimeRange  [read-only]

Returns the playback range


Implementation
    public function get playbackRange():TimeRange
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
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
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
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
Constructor Detail
DefaultMediaPlayer()Constructor
public function DefaultMediaPlayer(context:MediaPlayerContext)

Default constructor.

Parameters
context:MediaPlayerContext
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.
create()method 
public static function create(context:MediaPlayerContext):MediaPlayer

Convenience method for creating a media player.

Parameters

context:MediaPlayerContext — Application context provided by the developer.

Returns
MediaPlayer — default library implementation of media player interface.
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.

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.

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

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

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

Constant Detail
LIVE_POINTConstant
public static const LIVE_POINT:int = -2

Constant used to seek to the live point.