Package | com.adobe.mediacore |
Class | public final class DefaultMediaPlayer |
Inheritance | DefaultMediaPlayer ![]() |
Implements | MediaPlayer |
Property | Defined 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 |
Method | Defined By | ||
---|---|---|---|
DefaultMediaPlayer(context:MediaPlayerContext)
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 |
Constant | Defined By | ||
---|---|---|---|
LIVE_POINT : int = -2 [static]
Constant used to seek to the live point. | DefaultMediaPlayer |
abrControlParameters | property |
abrControlParameters:ABRControlParameters
Media player parameters that control the playback of MBR content.
public function get abrControlParameters():ABRControlParameters
public function set abrControlParameters(value:ABRControlParameters):void
bufferControlParameters | property |
bufferControlParameters:BufferControlParameters
Media player parameters that control the buffering policies.
public function get bufferControlParameters():BufferControlParameters
public function set bufferControlParameters(value:BufferControlParameters):void
bufferedRange | property |
bufferedRange:TimeRange
[read-only] Returns the buffered range.
public function get bufferedRange():TimeRange
ccStyle | property |
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.
public function get ccStyle():ClosedCaptionStyles
public function set ccStyle(value:ClosedCaptionStyles):void
ccVisibility | property |
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.
public function get ccVisibility():String
public function set ccVisibility(value:String):void
config | property |
config:MediaPlayerConfig
Media player configuration. Allows for configuration and customization of various media player components like content resolving or analytics service.
public function get config():MediaPlayerConfig
public function set config(value:MediaPlayerConfig):void
context | property |
context:MediaPlayerContext
[read-only] Media player context. Return the MediaPlayerContext. used to access the authorizedFeatures
public function get context():MediaPlayerContext
currentItem | property |
currentItem:MediaPlayerItem
[read-only] Gets the current media player item.
public function get currentItem():MediaPlayerItem
currentTime | property |
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.
public function get currentTime():Number
currentTimeUpdateInterval | property |
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.
public function get currentTimeUpdateInterval():uint
public function set currentTimeUpdateInterval(value:uint):void
drmManager | property |
drmManager:DRMManager
[read-only]
public function get drmManager():DRMManager
localTime | property |
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.
public function get localTime():Number
playbackMetrics | property |
playbackMetrics:PlaybackMetrics
[read-only] Provides the playback metrics associated with this player.
public function get playbackMetrics():PlaybackMetrics
playbackRange | property |
playbackRange:TimeRange
[read-only] Returns the playback range
public function get playbackRange():TimeRange
rate | property |
rate:Number
Returns the current playback rate.
public function get rate():Number
public function set rate(value:Number):void
seekableRange | property |
seekableRange:TimeRange
[read-only] Returns the seekable range
public function get seekableRange():TimeRange
status | property |
status:String
[read-only] Returns the media player status.
public function get status():String
timeline | property |
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.
public function get timeline():Timeline
view | property |
view:MediaPlayerView
Returns the view where the media player will render the images.
public function get view():MediaPlayerView
public function set view(value:MediaPlayerView):void
volume | property |
volume:Number
Media player volume. Ranges from 0 (silent) to 1 (full volume).
public function get volume():Number
public function set volume(value:Number):void
DefaultMediaPlayer | () | Constructor |
public function DefaultMediaPlayer(context:MediaPlayerContext)
Default constructor.
Parameterscontext:MediaPlayerContext |
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.
|
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.
|
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
|
LIVE_POINT | Constant |
public static const LIVE_POINT:int = -2
Constant used to seek to the live point.