套件 | org.osmf.traits |
類別 | public class PlayTrait |
繼承 | PlayTrait MediaTraitBase EventDispatcher Object |
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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.
相關 API 元素
屬性 | 定義自 | ||
---|---|---|---|
canPause : Boolean [唯讀]
Indicates whether the media can be paused. | PlayTrait | ||
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | ||
playState : String [唯讀]
The current playback state, of type PlayState. | PlayTrait | ||
traitType : String [唯讀]
The MediaTraitType for this trait. | MediaTraitBase |
方法 | 定義自 | ||
---|---|---|---|
Constructor. | PlayTrait | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。 | EventDispatcher | ||
會將事件傳送到事件流程。 | EventDispatcher | ||
Disposes of any resources used by this trait. | MediaTraitBase | ||
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | EventDispatcher | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
Pauses the media if it is not already paused. | PlayTrait | ||
Plays the media if it is not already playing. | PlayTrait | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
Stops the media if it is not already stopped. | PlayTrait | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher |
方法 | 定義自 | ||
---|---|---|---|
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 |
事件 | 摘要 | 定義自 | ||
---|---|---|---|---|
[廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。 | EventDispatcher | |||
Dispatched when the canPause property has changed. | PlayTrait | |||
[廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。 | 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 | 屬性 |
playState | 屬性 |
PlayTrait | () | 建構函式 |
public function PlayTrait()
Constructor.
pause | () | 方法 |
public final function pause():void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Pauses the media if it is not already paused.
擲回值
IllegalOperationError — If canPause returns false.
|
play | () | 方法 |
public final function play():void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Plays the media if it is not already playing.
playStateChangeEnd | () | 方法 |
protected function playStateChangeEnd():void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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 | () | 方法 |
setCanPause | () | 方法 |
stop | () | 方法 |
public final function stop():void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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 | 事件 |
org.osmf.events.PlayEvent
屬性 PlayEvent.type =
org.osmf.events.PlayEvent.CAN_PAUSE_CHANGE
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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 | 事件 |
org.osmf.events.PlayEvent
屬性 PlayEvent.type =
org.osmf.events.PlayEvent.LIVE_RESUME
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 2.0 |
執行階段版本: | 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 | 事件 |
org.osmf.events.PlayEvent
屬性 PlayEvent.type =
org.osmf.events.PlayEvent.LIVE_STALL
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 2.0 |
執行階段版本: | 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 | 事件 |
org.osmf.events.PlayEvent
屬性 PlayEvent.type =
org.osmf.events.PlayEvent.PLAY_STATE_CHANGE
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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.Tue Jun 12 2018, 03:47 PM Z