套件 | org.osmf.net |
類別 | public class NetStreamSwitchManager |
繼承 | NetStreamSwitchManager NetStreamSwitchManagerBase EventDispatcher Object |
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
屬性 | 定義自 | ||
---|---|---|---|
_autoSwitch : Boolean | NetStreamSwitchManagerBase | ||
bandwidthLimit : Number
The multiplier to apply to the maximum bandwidth for the client. | NetStreamSwitchManager | ||
_maxAllowedIndex : int | NetStreamSwitchManagerBase |
方法 | 定義自 | ||
---|---|---|---|
NetStreamSwitchManager(connection:NetConnection, netStream:NetStream, resource:DynamicStreamingResource, metrics:NetStreamMetricsBase, switchingRules:Vector.<SwitchingRuleBase>, autoSwitch:Boolean = true)
Constructor. | NetStreamSwitchManager | ||
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 | ||
Initiate a switch to the stream with the given index. | NetStreamSwitchManagerBase | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher |
方法 | 定義自 | ||
---|---|---|---|
Override this method to provide additional decisioning around
allowing automatic switches to occur. | NetStreamSwitchManager |
bandwidthLimit | 屬性 |
NetStreamSwitchManager | () | 建構函式 |
public function NetStreamSwitchManager(connection:NetConnection, netStream:NetStream, resource:DynamicStreamingResource, metrics:NetStreamMetricsBase, switchingRules:Vector.<SwitchingRuleBase>, autoSwitch:Boolean = true)
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Constructor.
參數connection:NetConnection — The NetConnection for the NetStream that will be managed.
| |
netStream:NetStream — The NetStream to manage.
| |
resource:DynamicStreamingResource — The DynamicStreamingResource that is playing in the NetStream.
| |
metrics:NetStreamMetricsBase — The provider of runtime metrics.
| |
switchingRules:Vector.<SwitchingRuleBase> — The switching rules that this manager will use.
| |
autoSwitch:Boolean (default = true )
|
canAutoSwitchNow | () | 方法 |
protected function canAutoSwitchNow(newIndex:int):Boolean
Override this method to provide additional decisioning around allowing automatic switches to occur. This method will be invoked just prior to a switch request. If false is returned, that switch request will not take place.
By default, the implementation does the following:
1) When a switch down occurs, the stream being switched from has its failed count incremented. If, when the switching rules are evaluated again, a rule suggests switching up, since the stream previously failed, it won't be tried again until a duration (30s) elapses. This provides a better user experience by preventing a situation where the switch up is attempted but then fails almost immediately.
2) Once a stream item has 3 failures, there will be no more attempts to switch to it until an interval (5m) has expired. At the end of this interval, all failed counts are reset to zero.
參數
newIndex:int — The new index to switch to.
|
Boolean |
Tue Jun 12 2018, 03:47 PM Z