套件 | org.osmf.net.httpstreaming |
類別 | public class DefaultHTTPStreamingSwitchManager |
繼承 | DefaultHTTPStreamingSwitchManager RuleSwitchManagerBase NetStreamSwitchManagerBase EventDispatcher Object |
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 2.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
相關 API 元素
org.osmf.net.abr.RuleBase
屬性 | 定義自 | ||
---|---|---|---|
actualIndex : int [唯讀]
The index of the currently downloading quality level
| RuleSwitchManagerBase | ||
autoSwitch : Boolean [覆寫] | RuleSwitchManagerBase | ||
climbFactor : Number
A factor to be applied when switching up. | DefaultHTTPStreamingSwitchManager | ||
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | ||
currentIndex : uint [覆寫] [唯讀] | RuleSwitchManagerBase | ||
emergencyRules : Vector.<RuleBase> [唯讀]
Array of normal rules to be used in the algorithm. | RuleSwitchManagerBase | ||
maxAllowedIndex : int
The highest stream index that the switching manager is
allowed to switch to. | NetStreamSwitchManagerBase | ||
maxDownSwitchLimit : int
The maximum difference between the indices of the old
and new quality level when switching down. | DefaultHTTPStreamingSwitchManager | ||
maxReliabilityRecordSize : uint
The maximum length of the reliability record (how many switches to remember)
| DefaultHTTPStreamingSwitchManager | ||
maxUpSwitchLimit : int
The maximum difference between the indices of the old
and new quality level when switching up. | DefaultHTTPStreamingSwitchManager | ||
metricRepository : MetricRepository [唯讀]
The metric repository responsible with providing the metrics
| RuleSwitchManagerBase | ||
minReliability : Number
The minimum reliability for a quality level to be used. | DefaultHTTPStreamingSwitchManager | ||
minReliabilityRecordSize : uint
The minimum length of the reliability record below which reliability is not an issue
| DefaultHTTPStreamingSwitchManager | ||
normalRules : Vector.<RuleBase> [唯讀]
Array of normal rules to be used in the algorithm. | DefaultHTTPStreamingSwitchManager | ||
normalRuleWeights : Vector.<Number>
The weights of the normal rules (their importance in the algorithm).
Valid values must obey the following rules:
same number of weights as there are rules
all rules must be equal or greater than zero
at least one weight must be non-zero
| DefaultHTTPStreamingSwitchManager |
方法 | 定義自 | ||
---|---|---|---|
DefaultHTTPStreamingSwitchManager(notifier:EventDispatcher, switcher:NetStreamSwitcher, metricRepository:MetricRepository, emergencyRules:Vector.<RuleBase> = null, autoSwitch:Boolean = true, normalRules:Vector.<RuleBase> = null, normalRuleWeights:Vector.<Number> = null, minReliability:Number = 0.85, minReliabilityRecordSize:uint = 5, maxReliabilityRecordSize:uint = 30, climbFactor:Number = 0.9, maxUpSwitchLimit:int = 1, maxDownSwitchLimit:int = 2)
Constructor. | DefaultHTTPStreamingSwitchManager | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。 | EventDispatcher | ||
會將事件傳送到事件流程。 | EventDispatcher | ||
The current reliability of the specified index. | DefaultHTTPStreamingSwitchManager | ||
[覆寫]
Returns an index that satisfies the maxBitrate constraint
| DefaultHTTPStreamingSwitchManager | ||
[覆寫]
Computes the necessary rules and metrics and determines the index to switch to. | DefaultHTTPStreamingSwitchManager | ||
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | EventDispatcher | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
[覆寫] | RuleSwitchManagerBase | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher |
方法 | 定義自 | ||
---|---|---|---|
Determines maximum available index whose declared bitrate is smaller than maxBitrate. | DefaultHTTPStreamingSwitchManager | ||
Determines whether an index is reliable.
This is achieved by comparing the index's reliability with the minimumReliability
| DefaultHTTPStreamingSwitchManager | ||
Array of normal rules to be used in the algorithm. | DefaultHTTPStreamingSwitchManager |
climbFactor | 屬性 |
climbFactor:Number
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 2.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
A factor to be applied when switching up. For example: currently playing 300kbps; new ideal bitrate = 1000kbps This means that: max bitrate = 300 + climbFactor x (1000 - 300)
It must be equal or greater than 0
實作
public function get climbFactor():Number
public function set climbFactor(value:Number):void
擲回值
ArgumentError — If it is set to a negative value
|
maxDownSwitchLimit | 屬性 |
maxDownSwitchLimit:int
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 2.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
The maximum difference between the indices of the old and new quality level when switching down. Set this to a -1 to disable the constraint.
This works in conjunction with the reliability constraint. If no reliable stream is available inside the maxDownSwitchLimit, no switch will be performed. The maxDownSwitchLimit constraint does not apply to emergency switches.
實作
public function get maxDownSwitchLimit():int
public function set maxDownSwitchLimit(value:int):void
maxReliabilityRecordSize | 屬性 |
maxUpSwitchLimit | 屬性 |
maxUpSwitchLimit:int
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 2.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
The maximum difference between the indices of the old and new quality level when switching up. Set this to a -1 to disable the constraint.
This works in conjunction with the reliability constraint. If no reliable stream is available inside the maxUpSwitchLlimit, no switch will be performed.
實作
public function get maxUpSwitchLimit():int
public function set maxUpSwitchLimit(value:int):void
minReliability | 屬性 |
minReliability:Number
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 2.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
The minimum reliability for a quality level to be used. This value must be a number in the [0-1] interval (inclusive)
實作
public function get minReliability():Number
public function set minReliability(value:Number):void
擲回值
ArgumentError — If it is set to an invalid value
|
minReliabilityRecordSize | 屬性 |
normalRules | 屬性 |
normalRuleWeights | 屬性 |
normalRuleWeights:Vector.<Number>
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 2.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
The weights of the normal rules (their importance in the algorithm). Valid values must obey the following rules:
- same number of weights as there are rules
- all rules must be equal or greater than zero
- at least one weight must be non-zero
實作
public function get normalRuleWeights():Vector.<Number>
public function set normalRuleWeights(value:Vector.<Number>):void
擲回值
ArgumentError — If the weights are not valid,
by breaking at least one of the above criteria
|
DefaultHTTPStreamingSwitchManager | () | 建構函式 |
public function DefaultHTTPStreamingSwitchManager(notifier:EventDispatcher, switcher:NetStreamSwitcher, metricRepository:MetricRepository, emergencyRules:Vector.<RuleBase> = null, autoSwitch:Boolean = true, normalRules:Vector.<RuleBase> = null, normalRuleWeights:Vector.<Number> = null, minReliability:Number = 0.85, minReliabilityRecordSize:uint = 5, maxReliabilityRecordSize:uint = 30, climbFactor:Number = 0.9, maxUpSwitchLimit:int = 1, maxDownSwitchLimit:int = 2)
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 2.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Constructor.
參數notifier:EventDispatcher — An object that dispatches the HTTPStreamingEvent.RUN_ALGORITHM event
| |
switcher:NetStreamSwitcher — The NetStreamSwitcher to use for switching
| |
metricRepository:MetricRepository — The repository responsible with providing metrics
| |
emergencyRules:Vector.<RuleBase> (default = null ) — Array of rules to be used in the algorithm.
An emergency rule can only recommend lower bitrates than the current one.
| |
autoSwitch:Boolean (default = true ) — Flag deciding whether autoSwitch should be enabled
| |
normalRules:Vector.<RuleBase> (default = null ) — Array of normal rules to be used in the algorithm.
A normal rule can recommend both lower and higher bitrates than the current one.
| |
normalRuleWeights:Vector.<Number> (default = null ) — The weights of the normal rules (their importance in the algorithm)
| |
minReliability:Number (default = 0.85 ) — The minimum reliability for a quality level to be used
| |
minReliabilityRecordSize:uint (default = 5 ) — The maximum length of the reliability record (how many switches to remember)
| |
maxReliabilityRecordSize:uint (default = 30 ) — The minimum length of the reliability record below which reliability is not an issue
| |
climbFactor:Number (default = 0.9 ) — A factor to be applied when switching up. For example:
currently playing 300kbps; new ideal bitrate = 1000kbps
This means that: max bitrate = 300 + climbFactor x (1000 - 300)
| |
maxUpSwitchLimit:int (default = 1 ) — The maximum difference between the indices of the old and new quality level when switching up.
Set this to -1 to disable the constraint.
This works in conjunction with the reliability constraint. If no reliable stream is available inside the
maxUpSwitchLimit, no switch will be performed.
| |
maxDownSwitchLimit:int (default = 2 ) — The maximum difference between the indices of the old and new quality level when switching down.
Set this to -1 value to disable the constraint.
This works in conjunction with the reliability constraint. If no reliable stream is available inside the
maxDownSwitchLimit, no switch will be performed. The maxDownSwitchLimit constraint does not apply to
emergency switches.
|
getCurrentReliability | () | 方法 |
getMaxIndex | () | 方法 |
protected function getMaxIndex(maxBitrate:Number, emergencyFlag:Boolean = false):uint
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 2.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Determines maximum available index whose declared bitrate is smaller than maxBitrate.
Only reliable indices (indices that pass the isReliable()
function) are taken into consideration.
參數
maxBitrate:Number — The maximum bitrate to which the index must comply
| |
emergencyFlag:Boolean (default = false )
|
uint — The index satisfying the aforementioned condition
|
相關 API 元素
getNewEmergencyIndex | () | 方法 |
getNewIndex | () | 方法 |
isReliable | () | 方法 |
setNormalRules | () | 方法 |
Tue Jun 12 2018, 03:47 PM Z