ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
org.osmf.net 

RuleSwitchManagerBase  - AS3 OSMF

Packageorg.osmf.net
Classpublic class RuleSwitchManagerBase
InheritanceRuleSwitchManagerBase Inheritance NetStreamSwitchManagerBase Inheritance EventDispatcher Inheritance Object
Subclasses DefaultHTTPStreamingSwitchManager

Language Version: ActionScript 3.0
Product Version: OSMF 2.0
Runtime Versions: Flash Player 10, AIR 1.5

SwitchManger manages the Adaptive Bitrate experience. It is responsible with putting all the required components together.

Related API Elements

org.osmf.net.abr.MetricBase
org.osmf.net.abr.RuleBase


Public Properties
 PropertyDefined By
  actualIndex : int
[read-only] The index of the currently downloading quality level
RuleSwitchManagerBase
  autoSwitch : Boolean
[override]
RuleSwitchManagerBase
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  currentIndex : uint
[override] [read-only]
RuleSwitchManagerBase
  emergencyRules : Vector.<RuleBase>
[read-only] Array of normal rules to be used in the algorithm.
RuleSwitchManagerBase
 InheritedmaxAllowedIndex : int
The highest stream index that the switching manager is allowed to switch to.
NetStreamSwitchManagerBase
  metricRepository : MetricRepository
[read-only] The metric repository responsible with providing the metrics
RuleSwitchManagerBase
Public Methods
 MethodDefined By
  
RuleSwitchManagerBase(notifier:EventDispatcher, switcher:NetStreamSwitcher, metricRepository:MetricRepository, emergencyRules:Vector.<RuleBase> = null, autoSwitch:Boolean = true)
Constructor.
RuleSwitchManagerBase
 Inherited
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
 Inherited
Dispatches an event into the event flow.
EventDispatcher
  
Returns an index that satisfies the maxBitrate constraint
RuleSwitchManagerBase
  
Computes the necessary rules and metrics and determines the index to switch to.
RuleSwitchManagerBase
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
[override]
RuleSwitchManagerBase
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
Property Detail

actualIndex

property
actualIndex:int  [read-only]

Language Version: ActionScript 3.0
Product Version: OSMF 2.0
Runtime Versions: Flash Player 10, AIR 1.5

The index of the currently downloading quality level



Implementation
    public function get actualIndex():int

autoSwitch

property 
autoSwitch:Boolean[override]



Implementation
    override public function get autoSwitch():Boolean
    override public function set autoSwitch(value:Boolean):void

currentIndex

property 
currentIndex:uint  [read-only] [override]



Implementation
    override public function get currentIndex():uint

emergencyRules

property 
emergencyRules:Vector.<RuleBase>  [read-only]

Language Version: ActionScript 3.0
Product Version: OSMF 2.0
Runtime Versions: Flash Player 10, AIR 1.5

Array of normal rules to be used in the algorithm. An emergency rule can only recommend lower bitrates than the current one.



Implementation
    public function get emergencyRules():Vector.<RuleBase>

metricRepository

property 
metricRepository:MetricRepository  [read-only]

Language Version: ActionScript 3.0
Product Version: OSMF 2.0
Runtime Versions: Flash Player 10, AIR 1.5

The metric repository responsible with providing the metrics



Implementation
    public function get metricRepository():MetricRepository
Constructor Detail

RuleSwitchManagerBase

()Constructor
public function RuleSwitchManagerBase(notifier:EventDispatcher, switcher:NetStreamSwitcher, metricRepository:MetricRepository, emergencyRules:Vector.<RuleBase> = null, autoSwitch:Boolean = true)

Language Version: ActionScript 3.0
Product Version: OSMF 2.0
Runtime Versions: Flash Player 10, AIR 1.5

Constructor.

Parameters
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
Method Detail

getNewEmergencyIndex

()method
public function getNewEmergencyIndex(maxBitrate:Number):uint

Language Version: ActionScript 3.0
Product Version: OSMF 2.0
Runtime Versions: Flash Player 10, AIR 1.5

Returns an index that satisfies the maxBitrate constraint

Parameters

maxBitrate:Number

Returns
uint

getNewIndex

()method 
public function getNewIndex():uint

Language Version: ActionScript 3.0
Product Version: OSMF 2.0
Runtime Versions: Flash Player 10, AIR 1.5

Computes the necessary rules and metrics and determines the index to switch to. The index must be a valid one (it can be higher than maxAllowedIndex, but it should be a real index that is available)

Returns
uint

switchTo

()method 
override public function switchTo(index:int):void

Parameters

index:int