Package | org.osmf.traits |
Class | public class PlayTrait |
Inheritance | PlayTrait MediaTraitBase EventDispatcher Object |
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Use the MediaElement.hasTrait(MediaTraitType.PLAY)
method to query
whether a media element has a trait of this type.
If hasTrait(MediaTraitType.PLAY)
returns true
,
use the MediaElement.getTrait(MediaTraitType.PLAY)
method
to get an object of this type.
Related API Elements
Property | Defined By | ||
---|---|---|---|
canPause : Boolean [read-only]
Indicates whether the media can be paused. | PlayTrait | ||
constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | ||
playState : String [read-only]
The current playback state, of type PlayState. | PlayTrait | ||
traitType : String [read-only]
The MediaTraitType for this trait. | MediaTraitBase |
Method | Defined By | ||
---|---|---|---|
Constructor. | PlayTrait | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event. | EventDispatcher | ||
Dispatches an event into the event flow. | EventDispatcher | ||
Disposes of any resources used by this trait. | MediaTraitBase | ||
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event. | EventDispatcher | ||
Indicates whether an object has a specified property defined. | Object | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
Pauses the media if it is not already paused. | PlayTrait | ||
Plays the media if it is not already playing. | PlayTrait | ||
Indicates whether the specified property exists and is enumerable. | Object | ||
Removes a listener from the EventDispatcher object. | EventDispatcher | ||
Sets the availability of a dynamic property for loop operations. | Object | ||
Stops the media if it is not already stopped. | PlayTrait | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
Returns the string representation of the specified object. | Object | ||
Returns the primitive value of the specified object. | Object | ||
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type. | EventDispatcher |
Method | Defined By | ||
---|---|---|---|
Called just after the playState property value
has changed. | PlayTrait | ||
Called immediately before the playState property value is changed. | PlayTrait | ||
Sets the canPause property for this PlayTrait. | PlayTrait |
Event | Summary | Defined By | ||
---|---|---|---|---|
[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher | |||
Dispatched when the canPause property has changed. | PlayTrait | |||
[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher | |||
Dispatched when playback resumes after a live stall | PlayTrait | |||
Dispatched when playback runs out of content for a live stream but the stream is not done. | PlayTrait | |||
Dispatched when the playState of the PlayTrait has changed. | PlayTrait |
canPause | property |
playState | property |
PlayTrait | () | Constructor |
public function PlayTrait()
Constructor.
pause | () | method |
public final function pause():void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Pauses the media if it is not already paused.
Throws
IllegalOperationError — If canPause returns false.
|
play | () | method |
public final function play():void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Plays the media if it is not already playing.
playStateChangeEnd | () | method |
protected function playStateChangeEnd():void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Called just after the playState
property value
has changed. Dispatches the change event.
Subclasses that override should call this method to dispatch the relevant PlayEvent.
playStateChangeStart | () | method |
protected function playStateChangeStart(newPlayState:String):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Called immediately before the playState
property value is changed.
Subclasses can override this method to communicate the change to the media.
Parameters
newPlayState:String |
setCanPause | () | method |
stop | () | method |
public final function stop():void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Stops the media if it is not already stopped.
When media is stopped, then any subsequent call to
play
should start from the beginning (though
this is up to the actual implementation).
canPauseChange | Event |
org.osmf.events.PlayEvent
property PlayEvent.type =
org.osmf.events.PlayEvent.CAN_PAUSE_CHANGE
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Dispatched when the canPause property has changed.
The PlayEvent.CAN_PAUSE_CHANGE constant defines the value of the type property of the event object for a canPauseChange event.liveResume | Event |
org.osmf.events.PlayEvent
property PlayEvent.type =
org.osmf.events.PlayEvent.LIVE_RESUME
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 2.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Dispatched when playback resumes after a live stall
The PlayEvent.LIVE_RESUME constant defines the value of the type property of the event object for a liveResume event.
Dispatched when playback resumes after a live stall
liveStall | Event |
org.osmf.events.PlayEvent
property PlayEvent.type =
org.osmf.events.PlayEvent.LIVE_STALL
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 2.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Dispatched when playback runs out of content for a live stream but the stream is not done.
The PlayEvent.LIVE_STALL constant defines the value of the type property of the event object for a liveStall event.
Dispatched when playback runs out of content for a live stream but the stream is not done.
playStateChange | Event |
org.osmf.events.PlayEvent
property PlayEvent.type =
org.osmf.events.PlayEvent.PLAY_STATE_CHANGE
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Dispatched when the playState of the PlayTrait has changed.
The PlayEvent.PLAY_STATE_CHANGE constant defines the value of the type property of the event object for a playStateChange event.Thu Dec 6 2018, 01:12 PM -08:00