套件 | org.osmf.traits |
類別 | public class AlternativeAudioTrait |
繼承 | AlternativeAudioTrait MediaTraitBase EventDispatcher Object |
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.6 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Use the MediaElement.hasTrait(MediaTraitType.ALTERNATIVE_AUDIO)
method to query whether a media element has a trait of this type.
If hasTrait(MediaTraitType.ALTERNATIVE_AUDIO)
returns true
,
use the MediaElement.getTrait(MediaTraitType.ALTERNATIVE_AUDIO)
method
to get an object of this type.
相關 API 元素
屬性 | 定義自 | ||
---|---|---|---|
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | ||
currentIndex : int [唯讀]
Obtains a 0-based index identifying the current audio stream, or
-1 if no stream is selected. | AlternativeAudioTrait | ||
numAlternativeAudioStreams : int [唯讀]
Obtains the total number of alternative audio streams. | AlternativeAudioTrait | ||
switching : Boolean [唯讀]
Indicates whether an alternative audio stream switch is currently in progress. | AlternativeAudioTrait | ||
traitType : String [唯讀]
The MediaTraitType for this trait. | MediaTraitBase |
屬性 | 定義自 | ||
---|---|---|---|
_indexToSwitchTo : int = -2 | AlternativeAudioTrait |
方法 | 定義自 | ||
---|---|---|---|
AlternativeAudioTrait(numAlternativeAudioStreams:int)
Default Constructor. | AlternativeAudioTrait | ||
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 | ||
Returns the associated streaming item for the specified index. | AlternativeAudioTrait | ||
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | EventDispatcher | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
Switches the current audio stream to the alternate stream specified by the
index value. | AlternativeAudioTrait | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher |
事件 | 摘要 | 定義自 | ||
---|---|---|---|---|
[廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。 | EventDispatcher | |||
Dispatched when an alternative audio stream switch is requested, completed, or has failed. | AlternativeAudioTrait | |||
[廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。 | EventDispatcher | |||
Dispatched when the total number of alternative audio streams has changed. | AlternativeAudioTrait |
常數 | 定義自 | ||
---|---|---|---|
DEFAULT_TRANSITION_INDEX : int = -1 [靜態] | AlternativeAudioTrait | ||
INVALID_TRANSITION_INDEX : int = -2 [靜態] | AlternativeAudioTrait |
_indexToSwitchTo | 屬性 |
protected var _indexToSwitchTo:int = -2
currentIndex | 屬性 |
numAlternativeAudioStreams | 屬性 |
switching | 屬性 |
switching:Boolean
[唯讀] 語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.6 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Indicates whether an alternative audio stream switch is currently in progress.
Returns true
while an audio stream switch has been requested but
not yet acknowledged and no switching failure has occurred. Returns
false
once the switch request is acknowledged or a switching
failure occurs.
實作
public function get switching():Boolean
AlternativeAudioTrait | () | 建構函式 |
getItemForIndex | () | 方法 |
public function getItemForIndex(index:int):StreamingItem
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.6 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Returns the associated streaming item for the specified index. Returns
null
if the index is -1
.
參數
index:int |
StreamingItem |
擲回值
RangeError — If the specified index is less than -1 or
greater than (numAlternativeAudioStreams - 1) .
|
switchTo | () | 方法 |
public function switchTo(index:int):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.6 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Switches the current audio stream to the alternate stream specified by the
index
value. Passing -1
for the index
value resets the current audio stream to the default one.
Note: If media playback is currently paused, the audio stream
switch does not occur until after play resumes.
參數
index:int |
擲回值
RangeError — If the specified index is less than -1 or
greater than numAlternativeAudioStreams-1 .
|
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
).
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 total number of alternative audio streams has changed.
Dispatched when the number of available alternative audio streams has changed..DEFAULT_TRANSITION_INDEX | 常數 |
protected static const DEFAULT_TRANSITION_INDEX:int = -1
INVALID_TRANSITION_INDEX | 常數 |
protected static const INVALID_TRANSITION_INDEX:int = -2
Tue Jun 12 2018, 03:47 PM Z