Package | com.adobe.mediacore |
Interface | public interface MediaPlayer extends flash.events.IEventDispatcher |
Implementors | DefaultMediaPlayer |
Property | Defined 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 |
Method | Defined 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 |
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 |
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
IllegalStateException — if media player was already released.
|
bufferControlParameters | property |
bufferControlParameters:BufferControlParameters
Media player parameters that control the buffering policies.
public function get bufferControlParameters():BufferControlParameters
public function set bufferControlParameters(value:BufferControlParameters):void
IllegalStateException — if media player was already released.
|
bufferedRange | property |
bufferedRange:TimeRange
[read-only] Returns the buffered range.
public function get bufferedRange():TimeRange
IllegalStateException — if the media player was already released.
|
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
com.adobe.mediacore.errors:IllegalStateException
— |
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
IllegalStateException — if media player was already released.
|
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
IllegalStateException — if the media player was already released.
|
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
IllegalStateException — if the media player item is not yet available or the media player was already released.
|
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
IllegalStateException — if the media player was already released.
|
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
IllegalStateException — if the media player was already released.
|
playbackMetrics | property |
playbackMetrics:PlaybackMetrics
[read-only] Provides the playback metrics associated with this player.
public function get playbackMetrics():PlaybackMetrics
IllegalStateException — if media player was already released.
|
playbackRange | property |
playbackRange:TimeRange
[read-only] Returns the playback range
public function get playbackRange():TimeRange
IllegalStateException — if media player was already released.
|
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
IllegalStateException — if media player was already released.
|
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
IllegalStateException — if the media player was already released.
|
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
IllegalStateException — if the media player was already released.
|
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
IllegalStateException — if media player was already released.
|
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.
|
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.
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.
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 |
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
|
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
|
IllegalStateException — if the media player is in a state different from
PREPARED, PAUSED or PLAYING state.
|
adBreakCompleted | Event |
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 |
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 |
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 |
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 |
com.adobe.mediacore.events.AdPlaybackEvent
Event dispatched when playback progresses while playing an ad.
adStart | Event |
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 |
com.adobe.mediacore.events.BufferEvent
Event dispatched by the MediaPlayer when playback stalls due buffer underflow.
bufferingEnd | Event |
com.adobe.mediacore.events.BufferEvent
Event dispatched by the MediaPlayer when buffer is full.
drmMetadataInfoAvailable | Event |
com.adobe.mediacore.events.DRMMetadataInfoEvent
Event dispatched when new load information is available. The obtained load information is exposed through loadInformation property.
itemCreated | Event |
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 |
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 |
com.adobe.mediacore.events.LoadInformationEvent
Event dispatched when new load information is available. The obtained load information is exposed through loadInformation property.
ratePlaying | Event |
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 |
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 |
com.adobe.mediacore.events.SeekEvent
Event dispatched by the MediaPlayer when seek operation starts.
seekEnd | Event |
com.adobe.mediacore.events.SeekEvent
Event dispatched by the MediaPlayer when seek operation ends.
seekPositionAdjusted | Event |
com.adobe.mediacore.events.SeekEvent
Event dispatched by the MediaPlayer when seek position is adjusted due internal or external rules.
statusChanged | Event |
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 |
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 |
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 |
com.adobe.mediacore.events.TimelineEvent
Event dispatched when the media player timeline has changed. The actual timeline is exposed through timeline property.