| 套件 | org.osmf.traits |
| 類別 | public class DynamicStreamTrait |
| 繼承 | DynamicStreamTrait MediaTraitBase EventDispatcher Object |
| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Use the MediaElement.hasTrait(MediaTraitType.DYNAMIC_STREAM) method to query
whether a media element has a trait of this type.
If hasTrait(MediaTraitType.DYNAMIC_STREAM) returns true,
use the MediaElement.getTrait(MediaTraitType.DYNAMIC_STREAM) method
to get an object of this type.
相關 API 元素
| 屬性 | 定義自 | ||
|---|---|---|---|
| autoSwitch : Boolean
Defines whether or not the trait should be in manual
or auto-switch mode. | DynamicStreamTrait | ||
![]() | constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | |
| currentIndex : int [唯讀]
The index of the current dynamic stream. | DynamicStreamTrait | ||
| maxAllowedIndex : int
The maximum allowed index. | DynamicStreamTrait | ||
| numDynamicStreams : int [唯讀]
The total number of dynamic streams. | DynamicStreamTrait | ||
| switching : Boolean [唯讀]
Indicates whether or not a switch is currently in progress. | DynamicStreamTrait | ||
![]() | traitType : String [唯讀]
The MediaTraitType for this trait. | MediaTraitBase | |
| 方法 | 定義自 | ||
|---|---|---|---|
Constructor. | DynamicStreamTrait | ||
![]() | 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 bitrate, in kilobits per second, for the specified index. | DynamicStreamTrait | ||
![]() |
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | EventDispatcher | |
![]() |
指出物件是否有已定義的指定屬性。 | Object | |
![]() |
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | |
![]() |
指出指定的屬性是否存在,以及是否可列舉。 | Object | |
![]() |
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | |
![]() |
為迴圈作業設定動態屬性的可用性。 | Object | |
Switch to a specific index. | DynamicStreamTrait | ||
![]() |
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | |
![]() |
會傳回指定之物件的字串形式。 | Object | |
![]() |
會傳回指定之物件的基本值。 | Object | |
![]() |
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher | |
| 方法 | 定義自 | ||
|---|---|---|---|
Called just after the autoSwitch property has changed. | DynamicStreamTrait | ||
Called immediately before the autoSwitch property is changed. | DynamicStreamTrait | ||
Called just after the maxAllowedIndex property has changed. | DynamicStreamTrait | ||
Called immediately before the maxAllowedIndex property is changed. | DynamicStreamTrait | ||
Invoking this setter will result in the trait's currentIndex
property changing. | DynamicStreamTrait | ||
Invoking this setter will result in the trait's numDynamicStreams
property changing. | DynamicStreamTrait | ||
Must be called by the implementing media on completing a switch. | DynamicStreamTrait | ||
Called just after the switching property has changed. | DynamicStreamTrait | ||
Called immediately before the switching property is changed. | DynamicStreamTrait | ||
| 事件 | 摘要 | 定義自 | ||
|---|---|---|---|---|
![]() | [廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。 | EventDispatcher | ||
| Dispatched when the autoSwitch property changed. | DynamicStreamTrait | |||
![]() | [廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。 | EventDispatcher | ||
| Dispatched when the number of dynamic streams has changed. | DynamicStreamTrait | |||
| Dispatched when a stream switch is requested, completed, or failed. | DynamicStreamTrait | |||
autoSwitch | 屬性 |
autoSwitch:Boolean| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Defines whether or not the trait should be in manual
or auto-switch mode. If in manual mode the switchTo
method can be used to manually switch to a specific stream.
實作
public function get autoSwitch():Boolean public function set autoSwitch(value:Boolean):voidcurrentIndex | 屬性 |
maxAllowedIndex | 屬性 |
maxAllowedIndex:int| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
The maximum allowed index. This can be set at run-time to provide a ceiling for the switching profile, for example, to keep from switching up to a higher quality stream when the current video is too small to handle a higher quality stream. The default is the highest stream index.
實作
public function get maxAllowedIndex():int public function set maxAllowedIndex(value:int):void擲回值
RangeError — If the specified index is less than zero or
greater than the total number of dynamic streams.
|
numDynamicStreams | 屬性 |
switching | 屬性 |
switching:Boolean [唯讀] | 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Indicates whether or not a switch is currently in progress.
This property will return true while a switch has been
requested and the switch has not yet been acknowledged and no switch failure
has occurred. Once the switch request has been acknowledged or a
failure occurs, the property will return false.
實作
public function get switching():BooleanDynamicStreamTrait | () | 建構函式 |
public function DynamicStreamTrait(autoSwitch:Boolean = true, currentIndex:int = 0, numDynamicStreams:int = 1)| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Constructor.
參數autoSwitch:Boolean (default = true) — The initial autoSwitch state for the trait. The default is true.
| |
currentIndex:int (default = 0) — The initial stream index for the trait. The default is zero.
| |
numDynamicStreams:int (default = 1) — The total number of dynamic streams.
|
autoSwitchChangeEnd | () | 方法 |
protected function autoSwitchChangeEnd():void| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Called just after the autoSwitch property has changed.
Dispatches the change event.
Subclasses that override should call this method to dispatch the change event.
autoSwitchChangeStart | () | 方法 |
protected function autoSwitchChangeStart(value:Boolean):void| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Called immediately before the autoSwitch property is changed.
Subclasses can override this method to communicate the change to the media.
參數
value:Boolean — New value for the autoSwitch property.
|
getBitrateForIndex | () | 方法 |
public function getBitrateForIndex(index:int):Number| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Returns the associated bitrate, in kilobits per second, for the specified index.
參數
index:int |
Number |
擲回值
RangeError — If the specified index is less than zero or
greater than the highest index available.
|
maxAllowedIndexChangeEnd | () | 方法 |
protected function maxAllowedIndexChangeEnd():void| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Called just after the maxAllowedIndex property has changed.
maxAllowedIndexChangeStart | () | 方法 |
protected function maxAllowedIndexChangeStart(newIndex:int):void| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Called immediately before the maxAllowedIndex property is changed.
Subclasses can override this method to communicate the change to the media.
參數
newIndex:int — New value for the maxAllowedIndex property.
|
setCurrentIndex | () | 方法 |
setNumDynamicStreams | () | 方法 |
setSwitching | () | 方法 |
protected final function setSwitching(newSwitching:Boolean, index:int):void| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Must be called by the implementing media on completing a switch.
Calls the switchingChangeStart() and switchingChangeEnd()
methods.
參數
newSwitching:Boolean — New switching value for the trait.
| |
index:int — The index to which the switch shall (or did) occur.
|
switchingChangeEnd | () | 方法 |
protected function switchingChangeEnd(index:int):void| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Called just after the switching property has changed.
Dispatches the change event.
Subclasses that override should call this method to dispatch the change event.
參數
index:int — The index of the switched-to stream.
|
switchingChangeStart | () | 方法 |
protected function switchingChangeStart(newSwitching:Boolean, index:int):void| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Called immediately before the switching property is changed.
Subclasses can override this method to communicate the change to the media.
參數
newSwitching:Boolean — New value for the switching property.
| |
index:int — The index of the stream to switch to.
|
switchTo | () | 方法 |
public function switchTo(index:int):void| 語言版本: | ActionScript 3.0 |
| 產品版本: | OSMF 1.0 |
| 執行階段版本: | Flash Player 10, AIR 1.5 |
Switch to a specific index. To switch up, use the currentIndex
property, such as:
obj.switchTo(obj.currentIndex + 1);
參數
index:int |
擲回值
RangeError — If the specified index is less than zero or
greater than maxAllowedIndex.
Note: If the media is paused, switching will not take place until after play resumes.
| |
IllegalOperationError — If the stream is not in manual switch mode.
|
相關 API 元素
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 changed.
The DynamicStreamEvent.AUTO_SWITCH_CHANGE constant defines the value of the type property of the event object for an autoSwitchChange event.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.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 stream switch is requested, completed, or failed.
The DynamicStreamEvent.SWITCHING_CHANGE constant defines the value of the type property of the event object for a switchingChange event.Tue Jun 12 2018, 03:47 PM Z
隱藏繼承公用屬性
顯示繼承公用屬性