Package | org.osmf.net |
Class | public class NetStreamSwitchManager |
Inheritance | NetStreamSwitchManager NetStreamSwitchManagerBase EventDispatcher Object |
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Property | Defined By | ||
---|---|---|---|
_autoSwitch : Boolean | NetStreamSwitchManagerBase | ||
bandwidthLimit : Number
The multiplier to apply to the maximum bandwidth for the client. | NetStreamSwitchManager | ||
_maxAllowedIndex : int | NetStreamSwitchManagerBase |
Method | Defined By | ||
---|---|---|---|
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
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event. | EventDispatcher | ||
Dispatches an event into the event flow. | EventDispatcher | ||
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event. | EventDispatcher | ||
Indicates whether an object has a specified property defined. | Object | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
Indicates whether the specified property exists and is enumerable. | Object | ||
Removes a listener from the EventDispatcher object. | EventDispatcher | ||
Sets the availability of a dynamic property for loop operations. | Object | ||
Initiate a switch to the stream with the given index. | NetStreamSwitchManagerBase | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
Returns the string representation of the specified object. | Object | ||
Returns the primitive value of the specified object. | Object | ||
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type. | EventDispatcher |
Method | Defined By | ||
---|---|---|---|
Override this method to provide additional decisioning around
allowing automatic switches to occur. | NetStreamSwitchManager |
bandwidthLimit | property |
NetStreamSwitchManager | () | Constructor |
public function NetStreamSwitchManager(connection:NetConnection, netStream:NetStream, resource:DynamicStreamingResource, metrics:NetStreamMetricsBase, switchingRules:Vector.<SwitchingRuleBase>, autoSwitch:Boolean = true)
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Constructor.
Parametersconnection: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 | () | method |
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.
Parameters
newIndex:int — The new index to switch to.
|
Boolean |
Thu Dec 6 2018, 01:12 PM -08:00