| 套件 | org.osmf.traits |
| 類別 | public class TraitEventDispatcher |
| 繼承 | TraitEventDispatcher EventDispatcher Object |
| 子類別 | MediaPlayer |
| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
| 屬性 | 定義自 | ||
|---|---|---|---|
![]() | constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | |
| media : MediaElement
The MediaElement which will be monitored, and whose trait events
will be redispatched. | TraitEventDispatcher | ||
| 方法 | 定義自 | ||
|---|---|---|---|
Constructor. | TraitEventDispatcher | ||
![]() | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。 | EventDispatcher | |
![]() |
會將事件傳送到事件流程。 | EventDispatcher | |
![]() |
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | EventDispatcher | |
![]() |
指出物件是否有已定義的指定屬性。 | Object | |
![]() |
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | |
![]() |
指出指定的屬性是否存在,以及是否可列舉。 | Object | |
![]() |
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | |
![]() |
為迴圈作業設定動態屬性的可用性。 | Object | |
![]() |
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | |
![]() |
會傳回指定之物件的字串形式。 | Object | |
![]() |
會傳回指定之物件的基本值。 | Object | |
![]() |
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher | |
| 事件 | 摘要 | 定義自 | ||
|---|---|---|---|---|
![]() | [廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。 | EventDispatcher | ||
| Dispatched when an alternative audio stream switch is requested, completed, or has failed. | TraitEventDispatcher | |||
| Dispatched when the autoSwitch property has changed. | TraitEventDispatcher | |||
| Dispatched when the buffering property has changed. | TraitEventDispatcher | |||
| Dispatched when the bufferTime property has changed. | TraitEventDispatcher | |||
| Dispatched when the bytesTotal property has changed. | TraitEventDispatcher | |||
| Dispatched when the canPause property has changed. | TraitEventDispatcher | |||
| Dispatched when the media has completed playback. | TraitEventDispatcher | |||
![]() | [廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。 | EventDispatcher | ||
| Dispatched when the displayObject property of the media has changed. | TraitEventDispatcher | |||
| Dispatched when the state of the DRMTrait has changed. | TraitEventDispatcher | |||
| Dispatched when the duration property of the media has changed. | TraitEventDispatcher | |||
| Dispatched when the isRecording property has changed. | TraitEventDispatcher | |||
| Dispatched when the state of the LoadTrait has changed. | TraitEventDispatcher | |||
| Dispatched when the mediaWidth and/or mediaHeight property of the media has changed. | TraitEventDispatcher | |||
| Dispatched when the muted property of the media has changed. | TraitEventDispatcher | |||
| Dispatched when the number of alternative audio streams has changed. | TraitEventDispatcher | |||
| Dispatched when the number of dynamic streams has changed. | TraitEventDispatcher | |||
| Dispatched when the pan property of the media has changed. | TraitEventDispatcher | |||
| Dispatched when the playing or paused property of the media has changed. | TraitEventDispatcher | |||
| Dispatched when the seeking property of the media has changed. | TraitEventDispatcher | |||
| Dispatched when a dynamic stream switch change occurs. | TraitEventDispatcher | |||
| Dispatched when the volume property of the media has changed. | TraitEventDispatcher | |||
media | 屬性 |
media:MediaElement| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
The MediaElement which will be monitored, and whose trait events will be redispatched.
實作
public function get media():MediaElement public function set media(value:MediaElement):voidTraitEventDispatcher | () | 建構函式 |
public function TraitEventDispatcher()| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Constructor.
audioSwitchingChange | 事件 |
org.osmf.events.AlternativeAudioEvent屬性 AlternativeAudioEvent.type =
org.osmf.events.AlternativeAudioEvent.AUDIO_SWITCHING_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.6 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when an alternative audio stream switch is requested, completed, or has failed.
Dispatched when the switching state of the alternative audio stream has changed. Usually for any successful switching operation, two AUDIO_SWITCHING_CHANGE events will be triggered. One when the switch operation starts ( theswitching
property will be set to true ) and one when the operation ends ( the
switching property will be set to false ).
autoSwitchChange | 事件 |
org.osmf.events.DynamicStreamEvent屬性 DynamicStreamEvent.type =
org.osmf.events.DynamicStreamEvent.AUTO_SWITCH_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the autoSwitch property has changed.
bufferingChange | 事件 |
org.osmf.events.BufferEvent屬性 BufferEvent.type =
org.osmf.events.BufferEvent.BUFFERING_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the buffering property has changed.
bufferTimeChange | 事件 |
org.osmf.events.BufferEvent屬性 BufferEvent.type =
org.osmf.events.BufferEvent.BUFFER_TIME_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the bufferTime property has changed.
bytesTotalChange | 事件 |
org.osmf.events.LoadEvent屬性 LoadEvent.type =
org.osmf.events.LoadEvent| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the bytesTotal property has changed.
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.
complete | 事件 |
org.osmf.events.TimeEvent屬性 TimeEvent.type =
org.osmf.events.TimeEvent.COMPLETE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the media has completed playback.
The TimeEvent.COMPLETE constant defines the value of the type property of the event object for a complete event.displayObjectChange | 事件 |
org.osmf.events.DisplayObjectEvent屬性 DisplayObjectEvent.type =
org.osmf.events.DisplayObjectEvent.DISPLAY_OBJECT_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the displayObject property of the media has changed.
drmStateChange | 事件 |
org.osmf.events.DRMEvent屬性 DRMEvent.type =
org.osmf.events.DRMEvent.DRM_STATE_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10.1, AIR 1.5 |
Dispatched when the state of the DRMTrait has changed.
The DRMEvent.DRM_STATE_CHANGE constant defines the value of the type property of the event object for a change to the drmState of a DRMTrait.durationChange | 事件 |
org.osmf.events.TimeEvent屬性 TimeEvent.type =
org.osmf.events.TimeEvent.DURATION_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the duration property of the media has changed.
isRecordingChange | 事件 |
org.osmf.events.DVREvent屬性 DVREvent.type =
org.osmf.events.DVREvent.IS_RECORDING_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10.1, AIR 1.5 |
Dispatched when the isRecording property has changed.
loadStateChange | 事件 |
org.osmf.events.LoadEvent屬性 LoadEvent.type =
org.osmf.events.LoadEvent.LOAD_STATE_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the state of the LoadTrait has changed.
The LoadEvent.LOAD_STATE_CHANGE constant defines the value of the type property of the event object for a loadStateChange event.mediaSizeChange | 事件 |
org.osmf.events.DisplayObjectEvent屬性 DisplayObjectEvent.type =
org.osmf.events.DisplayObjectEvent.MEDIA_SIZE_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the mediaWidth and/or mediaHeight property of the
media has changed.
mutedChange | 事件 |
org.osmf.events.AudioEvent屬性 AudioEvent.type =
org.osmf.events.AudioEvent.MUTED_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the muted property of the media has changed.
numAlternativeAudioStreamsChange | 事件 |
org.osmf.events.AlternativeAudioEvent屬性 AlternativeAudioEvent.type =
org.osmf.events.AlternativeAudioEvent.NUM_ALTERNATIVE_AUDIO_STREAMS_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.6 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the number of alternative audio streams has changed.
Dispatched when the number of available alternative audio streams has changed..numDynamicStreamsChange | 事件 |
org.osmf.events.DynamicStreamEvent屬性 DynamicStreamEvent.type =
org.osmf.events.DynamicStreamEvent.NUM_DYNAMIC_STREAMS_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the number of dynamic streams has changed.
The DynamicStreamEvent.NUM_DYNAMIC_STREAMS_CHANGE constant defines the value of the type property of the event object for a numDynamicStreamsChange event.panChange | 事件 |
org.osmf.events.AudioEvent屬性 AudioEvent.type =
org.osmf.events.AudioEvent.PAN_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the pan property of the media has changed.
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 playing or paused property of the media has changed.
seekingChange | 事件 |
org.osmf.events.SeekEvent屬性 SeekEvent.type =
org.osmf.events.SeekEvent.SEEKING_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the seeking property of the media has changed.
switchingChange | 事件 |
org.osmf.events.DynamicStreamEvent屬性 DynamicStreamEvent.type =
org.osmf.events.DynamicStreamEvent.SWITCHING_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when a dynamic stream switch change occurs.
The DynamicStreamEvent.SWITCHING_CHANGE constant defines the value of the type property of the event object for a switchingChange event.volumeChange | 事件 |
org.osmf.events.AudioEvent屬性 AudioEvent.type =
org.osmf.events.AudioEvent.VOLUME_CHANGE| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the volume property of the media has changed.
package
{
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import org.osmf.elements.VideoElement;
import org.osmf.events.AudioEvent;
import org.osmf.events.PlayEvent;
import org.osmf.media.MediaPlayerSprite;
import org.osmf.media.URLResource;
import org.osmf.traits.TraitEventDispatcher;
public class TraitEventDispatcherExample extends Sprite
{
public function TraitEventDispatcherExample()
{
super();
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
var mediaPlayerSprite:MediaPlayerSprite = new MediaPlayerSprite();
var urlResource:URLResource = new URLResource("rtmp://cp67126.edgefcs.net/ondemand/mediapm/strobe/content/test/SpaceAloneHD_sounas_640_500_short");
var videoElement:VideoElement = new VideoElement();
videoElement.resource = urlResource;
var dispatcher:TraitEventDispatcher = new TraitEventDispatcher();
dispatcher.media = videoElement;
dispatcher.addEventListener(AudioEvent.VOLUME_CHANGE, onVolumeChange);
dispatcher.addEventListener(PlayEvent.PLAY_STATE_CHANGE, onPlayStateChange);
addChild(mediaPlayerSprite);
mediaPlayerSprite.media = videoElement;
}
private function onVolumeChange(event:AudioEvent):void
{
trace("onVolumeChange");
}
private function onPlayStateChange(event:PlayEvent):void
{
trace("onPlayStateChange");
}
}
}
Tue Jun 12 2018, 03:47 PM Z
隱藏繼承公用屬性
顯示繼承公用屬性