STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
216092
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2364 · P4728

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/82998340?noj=FRM82998340-9DC" width="1" height="1"></div>

m_1324254207500.taurinfox_fox-in-the-stable.swf

This is the info page for
Flash #102314

(Click the ID number above for more basic data on this flash file.)


Text
This video has taken longer
than expected to load.
Possible causes:
- www.taurinfox.com is not available
- a firewall is preventing communication
- your internet connection has
insufficient bandwidth to allow
buffering

Loading Video

Connecting to

www.taurinfox.com

ActionScript [AS3]

Section 1
//AutoLayoutEvent (fl.video.AutoLayoutEvent) package fl.video { import flash.events.*; import flash.geom.*; public class AutoLayoutEvent extends LayoutEvent implements IVPEvent { private var _vp:uint; public static const AUTO_LAYOUT:String = "autoLayout"; public function AutoLayoutEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Rectangle=null, _arg5:Rectangle=null, _arg6:uint=0){ super(_arg1, _arg2, _arg3, _arg4, _arg5); this._vp = _arg6; } public function get vp():uint{ return (this._vp); } public function set vp(_arg1:uint):void{ this._vp = _arg1; } override public function clone():Event{ return (new AutoLayoutEvent(type, bubbles, cancelable, Rectangle(oldBounds.clone()), Rectangle(oldRegistrationBounds.clone()), this.vp)); } } }//package fl.video
Section 2
//ConnectClient (fl.video.ConnectClient) package fl.video { import flash.net.*; public class ConnectClient { public var owner:NCManager; public var nc:NetConnection; public var connIndex:uint; public var pending:Boolean; public function ConnectClient(_arg1:NCManager, _arg2:NetConnection, _arg3:uint=0){ this.owner = _arg1; this.nc = _arg2; this.connIndex = _arg3; this.pending = false; } public function close():void{ } public function onBWDone(... _args):void{ var _local2:Number; if (_args.length > 0){ _local2 = _args[0]; }; this.owner.onConnected(this.nc, _local2); } public function onBWCheck(... _args):Number{ return (++this.owner._payload); } } }//package fl.video
Section 3
//ControlData (fl.video.ControlData) package fl.video { import flash.display.*; public class ControlData { public var uiMgr:UIManager; public var index:int; public var ctrl:DisplayObject; public var owner:DisplayObject; public var enabled:Boolean; public var avatar:DisplayObject; public var state:uint; public var state_mc:Array; public var disabled_mc:DisplayObject; public var currentState_mc:DisplayObject; public var origX:Number; public var origY:Number; public var origScaleX:Number; public var origScaleY:Number; public var origWidth:Number; public var origHeight:Number; public var leftMargin:Number; public var rightMargin:Number; public var topMargin:Number; public var bottomMargin:Number; public var handle_mc:Sprite; public var percentage:Number; public var isDragging:Boolean; public var hit_mc:Sprite; public var progress_mc:DisplayObject; public var fullness_mc:DisplayObject; public var fill_mc:DisplayObject; public var mask_mc:DisplayObject; public var cachedFocusRect:Boolean; public var captureFocus:Boolean; public function ControlData(_arg1:UIManager, _arg2:DisplayObject, _arg3:DisplayObject, _arg4:int){ var uiMgr = _arg1; var ctrl = _arg2; var owner = _arg3; var index = _arg4; super(); this.uiMgr = uiMgr; this.index = index; this.ctrl = ctrl; this.owner = owner; try { ctrl["uiMgr"] = uiMgr; } catch(re:ReferenceError) { }; } } }//package fl.video
Section 4
//CuePointManager (fl.video.CuePointManager) package fl.video { public class CuePointManager { private var _owner:FLVPlayback; flvplayback_internal var _metadataLoaded:Boolean; flvplayback_internal var _disabledCuePoints:Array; flvplayback_internal var _disabledCuePointsByNameOnly:Object; flvplayback_internal var _asCuePointIndex:int; flvplayback_internal var _asCuePointTolerance:Number; flvplayback_internal var _linearSearchTolerance:Number; flvplayback_internal var _id:uint; flvplayback_internal var allCuePoints:Array; flvplayback_internal var asCuePoints:Array; flvplayback_internal var flvCuePoints:Array; flvplayback_internal var navCuePoints:Array; flvplayback_internal var eventCuePoints:Array; public static const VERSION:String = "2.1.0.23"; public static const SHORT_VERSION:String = "2.1"; flvplayback_internal static const DEFAULT_LINEAR_SEARCH_TOLERANCE:Number = 50; flvplayback_internal static var cuePointsReplace:Array = ["&quot;", "\"", "&#39;", "'", "&#44;", ",", "&amp;", "&"]; public function CuePointManager(_arg1:FLVPlayback, _arg2:uint){ this._owner = _arg1; this._id = _arg2; this.reset(); this._asCuePointTolerance = (this._owner.getVideoPlayer(this._id).playheadUpdateInterval / 2000); this._linearSearchTolerance = DEFAULT_LINEAR_SEARCH_TOLERANCE; } public function reset():void{ this._metadataLoaded = false; this.allCuePoints = null; this.asCuePoints = null; this._disabledCuePoints = new Array(); this._disabledCuePointsByNameOnly = new Object(); this.flvCuePoints = null; this.navCuePoints = null; this.eventCuePoints = null; this._asCuePointIndex = 0; } public function get metadataLoaded():Boolean{ return (this._metadataLoaded); } public function set playheadUpdateInterval(_arg1:Number):void{ this._asCuePointTolerance = (_arg1 / 2000); } public function get id():uint{ return (this._id); } public function addASCuePoint(_arg1, _arg2:String=null, _arg3:Object=null):Object{ var _local4:Object; var _local7:int; var _local10:int; if (typeof(_arg1) == "object"){ _local4 = deepCopyObject(_arg1); } else { _local4 = {time:_arg1, name:_arg2, parameters:deepCopyObject(_arg3)}; }; if (_local4.parameters == null){ delete _local4.parameters; }; var _local5:Boolean = ((isNaN(_local4.time)) || ((_local4.time < 0))); if (_local5){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number")); }; var _local6 = (_local4.name == null); if (_local6){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "name cannot be undefined or null")); }; _local4.type = CuePointType.ACTIONSCRIPT; if ((((this.asCuePoints == null)) || ((this.asCuePoints.length < 1)))){ _local7 = 0; this.asCuePoints = new Array(); this.asCuePoints.push(_local4); } else { _local7 = this.getCuePointIndex(this.asCuePoints, true, _local4.time); _local7 = ((this.asCuePoints[_local7].time)>_local4.time) ? 0 : (_local7 + 1); this.asCuePoints.splice(_local7, 0, _local4); }; if ((((this.allCuePoints == null)) || ((this.allCuePoints.length < 1)))){ this.allCuePoints = new Array(); this.allCuePoints.push(_local4); } else { _local10 = this.getCuePointIndex(this.allCuePoints, true, _local4.time); _local10 = ((this.allCuePoints[_local10].time)>_local4.time) ? 0 : (_local10 + 1); this.allCuePoints.splice(_local10, 0, _local4); }; var _local8:Number = this._owner.getVideoPlayer(this._id).playheadTime; if (_local8 > 0){ if (this._asCuePointIndex == _local7){ if (_local8 > this.asCuePoints[_local7].time){ this._asCuePointIndex++; }; } else { if (this._asCuePointIndex > _local7){ this._asCuePointIndex++; }; }; } else { this._asCuePointIndex = 0; }; var _local9:Object = deepCopyObject(this.asCuePoints[_local7]); _local9.array = this.asCuePoints; _local9.index = _local7; return (_local9); } public function removeASCuePoint(_arg1):Object{ var _local2:Object; if ((((this.asCuePoints == null)) || ((this.asCuePoints.length < 1)))){ return (null); }; switch (typeof(_arg1)){ case "string": _local2 = {name:_arg1}; break; case "number": _local2 = {time:_arg1}; break; case "object": _local2 = _arg1; break; }; var _local3:int = this.getCuePointIndex(this.asCuePoints, false, _local2.time, _local2.name); if (_local3 < 0){ return (null); }; _local2 = this.asCuePoints[_local3]; this.asCuePoints.splice(_local3, 1); _local3 = this.getCuePointIndex(this.allCuePoints, false, _local2.time, _local2.name); if (_local3 > 0){ this.allCuePoints.splice(_local3, 1); }; if (this._owner.getVideoPlayer(this._id).playheadTime > 0){ if (this._asCuePointIndex > _local3){ this._asCuePointIndex--; }; } else { this._asCuePointIndex = 0; }; return (_local2); } public function setFLVCuePointEnabled(_arg1:Boolean, _arg2):int{ var _local3:Object; var _local7:int; var _local8:int; var _local9:Object; switch (typeof(_arg2)){ case "string": _local3 = {name:_arg2}; break; case "number": _local3 = {time:_arg2}; break; case "object": _local3 = _arg2; break; }; var _local4:Boolean = ((isNaN(_local3.time)) || ((_local3.time < 0))); var _local5 = (_local3.name == null); if (((_local4) && (_local5))){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number and/or name must not be undefined or null")); }; var _local6:uint; if (_local4){ if (!this._metadataLoaded){ if (this._disabledCuePointsByNameOnly[_local3.name] == undefined){ if (!_arg1){ this._disabledCuePointsByNameOnly[_local3.name] = new Array(); }; } else { if (_arg1){ delete this._disabledCuePointsByNameOnly[_local3.name]; }; return (-1); }; this.removeCuePoints(this._disabledCuePoints, _local3); return (-1); }; if (_arg1){ _local6 = this.removeCuePoints(this._disabledCuePoints, _local3); } else { _local7 = this.getCuePointIndex(this.flvCuePoints, true, -1, _local3.name); while (_local7 >= 0) { _local9 = this.flvCuePoints[_local7]; _local8 = this.getCuePointIndex(this._disabledCuePoints, true, _local9.time); if ((((_local8 < 0)) || (!((this._disabledCuePoints[_local8].time == _local9.time))))){ this._disabledCuePoints = this.insertCuePoint(_local8, this._disabledCuePoints, {name:_local9.name, time:_local9.time}); _local6 = (_local6 + 1); }; _local7 = this.getNextCuePointIndexWithName(_local9.name, this.flvCuePoints, _local7); }; }; return (_local6); }; _local7 = this.getCuePointIndex(this._disabledCuePoints, false, _local3.time, _local3.name); if (_local7 < 0){ if (_arg1){ if (!this._metadataLoaded){ _local7 = this.getCuePointIndex(this._disabledCuePoints, false, _local3.time); if (_local7 < 0){ _local8 = this.getCuePointIndex(this._disabledCuePointsByNameOnly[_local3.name], true, _local3.time); if (cuePointCompare(_local3.time, null, this._disabledCuePointsByNameOnly[_local3.name]) != 0){ this._disabledCuePointsByNameOnly[_local3.name] = this.insertCuePoint(_local8, this._disabledCuePointsByNameOnly[_local3.name], _local3); }; } else { this._disabledCuePoints.splice(_local7, 1); }; }; return ((this._metadataLoaded) ? 0 : -1); }; } else { if (_arg1){ this._disabledCuePoints.splice(_local7, 1); _local6 = 1; } else { _local6 = 0; }; return ((this._metadataLoaded) ? _local6 : -1); }; if (this._metadataLoaded){ _local7 = this.getCuePointIndex(this.flvCuePoints, false, _local3.time, _local3.name); if (_local7 < 0){ return (0); }; if (_local5){ _local3.name = this.flvCuePoints[_local7].name; }; }; _local8 = this.getCuePointIndex(this._disabledCuePoints, true, _local3.time); this._disabledCuePoints = this.insertCuePoint(_local8, this._disabledCuePoints, _local3); _local6 = 1; return ((this._metadataLoaded) ? _local6 : -1); } public function removeCuePoints(_arg1:Array, _arg2:Object):Number{ var _local3:int; var _local4:Object; var _local5:int; _local3 = this.getCuePointIndex(_arg1, true, -1, _arg2.name); while (_local3 >= 0) { _local4 = _arg1[_local3]; _arg1.splice(_local3, 1); _local3--; _local5++; _local3 = this.getNextCuePointIndexWithName(_local4.name, _arg1, _local3); }; return (_local5); } public function insertCuePoint(_arg1:int, _arg2:Array, _arg3:Object):Array{ if (_arg1 < 0){ _arg2 = new Array(); _arg2.push(_arg3); } else { if (_arg2[_arg1].time > _arg3.time){ _arg1 = 0; } else { _arg1++; }; _arg2.splice(_arg1, 0, _arg3); }; return (_arg2); } public function isFLVCuePointEnabled(_arg1):Boolean{ var _local2:Object; var _local5:int; if (!this._metadataLoaded){ return (true); }; switch (typeof(_arg1)){ case "string": _local2 = {name:_arg1}; break; case "number": _local2 = {time:_arg1}; break; case "object": _local2 = _arg1; break; }; var _local3:Boolean = ((isNaN(_local2.time)) || ((_local2.time < 0))); var _local4 = (_local2.name == null); if (((_local3) && (_local4))){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number and/or name must not be undefined or null")); }; if (_local3){ _local5 = this.getCuePointIndex(this.flvCuePoints, true, -1, _local2.name); if (_local5 < 0){ return (true); }; while (_local5 >= 0) { if (this.getCuePointIndex(this._disabledCuePoints, false, this.flvCuePoints[_local5].time, this.flvCuePoints[_local5].name) < 0){ return (true); }; _local5 = this.getNextCuePointIndexWithName(_local2.name, this.flvCuePoints, _local5); }; return (false); }; return ((this.getCuePointIndex(this._disabledCuePoints, false, _local2.time, _local2.name) < 0)); } public function dispatchASCuePoints():void{ var _local1:Number = this._owner.getVideoPlayer(this._id).playheadTime; if (((this._owner.getVideoPlayer(this._id).stateResponsive) && (!((this.asCuePoints == null))))){ while ((((this._asCuePointIndex < this.asCuePoints.length)) && ((this.asCuePoints[this._asCuePointIndex].time <= (_local1 + this._asCuePointTolerance))))) { this._owner.dispatchEvent(new MetadataEvent(MetadataEvent.CUE_POINT, false, false, deepCopyObject(this.asCuePoints[this._asCuePointIndex++]), this._id)); }; }; } public function resetASCuePointIndex(_arg1:Number):void{ if ((((_arg1 <= 0)) || ((this.asCuePoints == null)))){ this._asCuePointIndex = 0; return; }; var _local2:int = this.getCuePointIndex(this.asCuePoints, true, _arg1); this._asCuePointIndex = ((this.asCuePoints[_local2].time)<_arg1) ? (_local2 + 1) : _local2; } public function processFLVCuePoints(_arg1:Array):void{ var _local2:int; var _local4:Object; this._metadataLoaded = true; if ((((_arg1 == null)) || ((_arg1.length < 1)))){ this.flvCuePoints = null; this.navCuePoints = null; this.eventCuePoints = null; return; }; this.flvCuePoints = _arg1; this.navCuePoints = new Array(); this.eventCuePoints = new Array(); var _local3:Number = -1; var _local5:Array = this._disabledCuePoints; var _local6:Number = 0; this._disabledCuePoints = new Array(); var _local7:int; while ((_local4 = this.flvCuePoints[_local7++]) != undefined) { if ((((_local3 > 0)) && ((_local3 >= _local4.time)))){ this.flvCuePoints = null; this.navCuePoints = null; this.eventCuePoints = null; this._disabledCuePoints = new Array(); this._disabledCuePointsByNameOnly = new Object(); throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, ("Unsorted cuePoint found after time: " + _local3))); }; _local3 = _local4.time; while ((((_local6 < _local5.length)) && ((cuePointCompare(_local5[_local6].time, null, _local4) < 0)))) { _local6++; }; if (((!((this._disabledCuePointsByNameOnly[_local4.name] == undefined))) || ((((_local6 < _local5.length)) && ((cuePointCompare(_local5[_local6].time, _local5[_local6].name, _local4) == 0)))))){ this._disabledCuePoints.push({time:_local4.time, name:_local4.name}); }; if (_local4.type == CuePointType.NAVIGATION){ this.navCuePoints.push(_local4); } else { if (_local4.type == CuePointType.EVENT){ this.eventCuePoints.push(_local4); }; }; if ((((this.allCuePoints == null)) || ((this.allCuePoints.length < 1)))){ this.allCuePoints = new Array(); this.allCuePoints.push(_local4); } else { _local2 = this.getCuePointIndex(this.allCuePoints, true, _local4.time); _local2 = ((this.allCuePoints[_local2].time)>_local4.time) ? 0 : (_local2 + 1); this.allCuePoints.splice(_local2, 0, _local4); }; }; this._disabledCuePointsByNameOnly = new Object(); } public function processCuePointsProperty(_arg1:Array):void{ var _local3:uint; var _local4:String; var _local5:String; var _local6:Object; var _local7:Boolean; if ((((_arg1 == null)) || ((_arg1.length == 0)))){ return; }; var _local2:uint; var _local8:int; while (_local8 < (_arg1.length - 1)) { switch (_local2){ case 6: this.addOrDisable(_local7, _local6); _local2 = 0; case 0: var _temp1 = _local8; _local8 = (_local8 + 1); if (_arg1[_temp1] != "t"){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected cuePoint parameter format")); }; if (isNaN(_arg1[_local8])){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number")); }; _local6 = new Object(); _local6.time = (_arg1[_local8] / 1000); _local2++; break; case 1: var _temp2 = _local8; _local8 = (_local8 + 1); if (_arg1[_temp2] != "n"){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected cuePoint parameter format")); }; if (_arg1[_local8] == undefined){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "name cannot be null or undefined")); }; _local6.name = unescape(_arg1[_local8]); _local2++; break; case 2: var _temp3 = _local8; _local8 = (_local8 + 1); if (_arg1[_temp3] != "t"){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected cuePoint parameter format")); }; if (isNaN(_arg1[_local8])){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "type must be number")); }; switch (_arg1[_local8]){ case 0: _local6.type = CuePointType.EVENT; break; case 1: _local6.type = CuePointType.NAVIGATION; break; case 2: _local6.type = CuePointType.ACTIONSCRIPT; break; default: throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "type must be 0, 1 or 2")); }; _local2++; break; case 3: var _temp4 = _local8; _local8 = (_local8 + 1); if (_arg1[_temp4] != "d"){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected cuePoint parameter format")); }; if (isNaN(_arg1[_local8])){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "disabled must be number")); }; _local7 = !((_arg1[_local8] == 0)); _local2++; break; case 4: var _temp5 = _local8; _local8 = (_local8 + 1); if (_arg1[_temp5] != "p"){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected cuePoint parameter format")); }; if (isNaN(_arg1[_local8])){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "num params must be number")); }; _local3 = _arg1[_local8]; _local2++; if (_local3 == 0){ _local2++; } else { _local6.parameters = new Object(); }; break; case 5: var _temp6 = _local8; _local8 = (_local8 + 1); _local4 = _arg1[_temp6]; _local5 = _arg1[_local8]; if ((_local4 is String)){ _local4 = unescape(_local4); }; if ((_local5 is String)){ _local5 = unescape(_local5); }; _local6.parameters[_local4] = _local5; _local3--; if (_local3 == 0){ _local2++; }; break; }; _local8++; }; if (_local2 == 6){ this.addOrDisable(_local7, _local6); } else { throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected end of cuePoint param string")); }; } flvplayback_internal function addOrDisable(_arg1:Boolean, _arg2:Object):void{ if (_arg1){ if (_arg2.type == CuePointType.ACTIONSCRIPT){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "Cannot disable actionscript cue points")); }; this.setFLVCuePointEnabled(false, _arg2); } else { if (_arg2.type == CuePointType.ACTIONSCRIPT){ this.addASCuePoint(_arg2); }; }; } flvplayback_internal function unescape(_arg1:String):String{ var _local2:String = _arg1; var _local3:int; while (_local3 < cuePointsReplace.length) { var _temp1 = _local3; _local3 = (_local3 + 1); var _temp2 = _local3; _local3 = (_local3 + 1); _local2 = _local2.replace(cuePointsReplace[_temp1], cuePointsReplace[_temp2]); }; return (_local2); } flvplayback_internal function getCuePointIndex(_arg1:Array, _arg2:Boolean, _arg3:Number=NaN, _arg4:String=null, _arg5:int=-1, _arg6:int=-1):int{ var _local9:int; var _local12:int; var _local13:int; var _local14:int; var _local15:int; if ((((_arg1 == null)) || ((_arg1.length < 1)))){ return (-1); }; var _local7:Boolean = ((isNaN(_arg3)) || ((_arg3 < 0))); var _local8 = (_arg4 == null); if (((_local7) && (_local8))){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number and/or name must not be undefined or null")); }; if (_arg5 < 0){ _arg5 = 0; }; if (_arg6 < 0){ _arg6 = _arg1.length; }; if (((!(_local8)) && (((_arg2) || (_local7))))){ if (_local7){ _local12 = _arg5; } else { _local12 = this.getCuePointIndex(_arg1, _arg2, _arg3); }; _local13 = _local12; while (_local13 >= _arg5) { if (_arg1[_local13].name == _arg4){ break; }; _local13--; }; if (_local13 >= _arg5){ return (_local13); }; _local13 = (_local12 + 1); while (_local13 < _arg6) { if (_arg1[_local13].name == _arg4){ break; }; _local13++; }; if (_local13 < _arg6){ return (_local13); }; return (-1); }; if (_arg6 <= this._linearSearchTolerance){ _local14 = (_arg5 + _arg6); _local15 = _arg5; while (_local15 < _local14) { _local9 = cuePointCompare(_arg3, _arg4, _arg1[_local15]); if (_local9 == 0){ return (_local15); }; if (_local9 < 0){ break; }; _local15++; }; if (_arg2){ if (_local15 > 0){ return ((_local15 - 1)); }; return (0); }; return (-1); }; var _local10:int = int((_arg6 / 2)); var _local11:int = (_arg5 + _local10); _local9 = cuePointCompare(_arg3, _arg4, _arg1[_local11]); if (_local9 < 0){ return (this.getCuePointIndex(_arg1, _arg2, _arg3, _arg4, _arg5, _local10)); }; if (_local9 > 0){ return (this.getCuePointIndex(_arg1, _arg2, _arg3, _arg4, (_local11 + 1), ((_local10 - 1) + (_arg6 % 2)))); }; return (_local11); } flvplayback_internal function getNextCuePointIndexWithName(_arg1:String, _arg2:Array, _arg3:int):int{ var _local4:int; if (_arg1 == null){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "name cannot be undefined or null")); }; if (_arg2 == null){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "cuePoint.array undefined")); }; if (((((isNaN(_arg3)) || ((_arg3 < -1)))) || ((_arg3 >= _arg2.length)))){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "cuePoint.index must be number between -1 and cuePoint.array.length")); }; _local4 = (_arg3 + 1); while (_local4 < _arg2.length) { if (_arg2[_local4].name == _arg1){ break; }; _local4++; }; if (_local4 < _arg2.length){ return (_local4); }; return (-1); } flvplayback_internal function getCuePoint(_arg1:Array, _arg2:Boolean, _arg3):Object{ var _local4:Object; switch (typeof(_arg3)){ case "string": _local4 = {name:_arg3}; break; case "number": _local4 = {time:_arg3}; break; case "object": _local4 = _arg3; break; }; var _local5:int = this.getCuePointIndex(_arg1, _arg2, _local4.time, _local4.name); if (_local5 < 0){ return (null); }; _local4 = deepCopyObject(_arg1[_local5]); _local4.array = _arg1; _local4.index = _local5; return (_local4); } flvplayback_internal function getNextCuePointWithName(_arg1:Object):Object{ if (_arg1 == null){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "cuePoint parameter undefined")); }; if (((isNaN(_arg1.time)) || ((_arg1.time < 0)))){ throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number")); }; var _local2:int = this.getNextCuePointIndexWithName(_arg1.name, _arg1.array, _arg1.index); if (_local2 < 0){ return (null); }; var _local3:Object = deepCopyObject(_arg1.array[_local2]); _local3.array = _arg1.array; _local3.index = _local2; return (_local3); } flvplayback_internal static function cuePointCompare(_arg1:Number, _arg2:String, _arg3:Object):int{ var _local4:Number = Math.round((_arg1 * 1000)); var _local5:Number = Math.round((_arg3.time * 1000)); if (_local4 < _local5){ return (-1); }; if (_local4 > _local5){ return (1); }; if (_arg2 != null){ if (_arg2 == _arg3.name){ return (0); }; if (_arg2 < _arg3.name){ return (-1); }; return (1); }; return (0); } flvplayback_internal static function deepCopyObject(_arg1:Object, _arg2:uint=0):Object{ var _local4:*; if (_arg1 == null){ return (_arg1); }; var _local3:Object = new Object(); for (_local4 in _arg1) { if ((((_arg2 == 0)) && ((((_local4 == "array")) || ((_local4 == "index")))))){ } else { if (typeof(_arg1[_local4]) == "object"){ _local3[_local4] = deepCopyObject(_arg1[_local4], (_arg2 + 1)); } else { _local3[_local4] = _arg1[_local4]; }; }; }; return (_local3); } } }//package fl.video
Section 5
//CuePointType (fl.video.CuePointType) package fl.video { public final class CuePointType { public static const ALL:String = "all"; public static const EVENT:String = "event"; public static const NAVIGATION:String = "navigation"; public static const FLV:String = "flv"; public static const ACTIONSCRIPT:String = "actionscript"; } }//package fl.video
Section 6
//FLVPlayback (fl.video.FLVPlayback) package fl.video { import flash.display.*; import flash.events.*; import flash.geom.*; import flash.net.*; import flash.media.*; import flash.utils.*; public class FLVPlayback extends Sprite { public var boundingBox_mc:DisplayObject; protected var isLivePreview:Boolean; private var preview_mc:MovieClip; private var previewImage_mc:Loader; private var previewImageUrl:String; private var livePreviewWidth:Number; private var livePreviewHeight:Number; private var _componentInspectorSetting:Boolean; flvplayback_internal var videoPlayers:Array; flvplayback_internal var videoPlayerStates:Array; flvplayback_internal var videoPlayerStateDict:Dictionary; private var _activeVP:uint; private var _visibleVP:uint; private var _topVP:uint; flvplayback_internal var uiMgr:UIManager; flvplayback_internal var cuePointMgrs:Array; flvplayback_internal var _firstStreamReady:Boolean; flvplayback_internal var _firstStreamShown:Boolean; flvplayback_internal var resizingNow:Boolean; flvplayback_internal var skinShowTimer:Timer; private var _align:String; private var _autoRewind:Boolean; private var _bufferTime:Number; private var _idleTimeout:Number; private var _aspectRatio:Boolean; private var _playheadUpdateInterval:Number; private var _progressInterval:Number; private var _origWidth:Number; private var _origHeight:Number; private var _scaleMode:String; private var _seekToPrevOffset:Number; private var _soundTransform:SoundTransform; private var _volume:Number; private var __forceNCMgr:NCManager; public static const VERSION:String = "2.1.0.23"; public static const SHORT_VERSION:String = "2.1"; flvplayback_internal static const DEFAULT_SKIN_SHOW_TIMER_INTERVAL:Number = 2000; flvplayback_internal static const skinShowTimerInterval:Number = 2000; public static const SEEK_TO_PREV_OFFSET_DEFAULT:Number = 1; public function FLVPlayback(){ mouseEnabled = false; this.isLivePreview = ((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent"))); this.isLivePreview = false; this._componentInspectorSetting = false; var _local1:Number = rotation; rotation = 0; this._origWidth = super.width; this._origHeight = super.height; super.scaleX = 1; super.scaleY = 1; rotation = _local1; var _local2:VideoPlayer = new VideoPlayer(0, 0); _local2.setSize(this._origWidth, this._origHeight); this.videoPlayers = new Array(); this.videoPlayers[0] = _local2; this._align = _local2.align; this._autoRewind = _local2.autoRewind; this._scaleMode = _local2.scaleMode; this._bufferTime = _local2.bufferTime; this._idleTimeout = _local2.idleTimeout; this._playheadUpdateInterval = _local2.playheadUpdateInterval; this._progressInterval = _local2.progressInterval; this._soundTransform = _local2.soundTransform; this._volume = _local2.volume; this._seekToPrevOffset = SEEK_TO_PREV_OFFSET_DEFAULT; this._firstStreamReady = false; this._firstStreamShown = false; this.resizingNow = false; if (this.uiMgr == null){ this.uiMgr = new UIManager(this); }; if (this.isLivePreview){ this.uiMgr.visible = true; }; this._activeVP = 0; this._visibleVP = 0; this._topVP = 0; this.videoPlayerStates = new Array(); this.videoPlayerStateDict = new Dictionary(true); this.cuePointMgrs = new Array(); this.createVideoPlayer(0); if (this.boundingBox_mc){ this.boundingBox_mc.visible = false; removeChild(this.boundingBox_mc); this.boundingBox_mc = null; }; if (this.isLivePreview){ this.previewImageUrl = ""; this.setSize(this._origWidth, this._origHeight); }; } public function setSize(_arg1:Number, _arg2:Number):void{ var _local6:VideoPlayer; var _local3:Rectangle = new Rectangle(this.x, this.y, this.width, this.height); var _local4:Rectangle = new Rectangle(this.registrationX, this.registrationY, this.registrationWidth, this.registrationHeight); if (this.isLivePreview){ this.livePreviewWidth = _arg1; this.livePreviewHeight = _arg2; if (this.previewImage_mc != null){ this.previewImage_mc.width = _arg1; this.previewImage_mc.height = _arg2; }; dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local3, _local4)); return; }; this.resizingNow = true; var _local5:int; while (_local5 < this.videoPlayers.length) { _local6 = this.videoPlayers[_local5]; if (_local6 != null){ _local6.setSize(_arg1, _arg2); }; _local5++; }; this.resizingNow = false; dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local3, _local4)); } public function setScale(_arg1:Number, _arg2:Number):void{ var _local6:VideoPlayer; var _local3:Rectangle = new Rectangle(this.x, this.y, this.width, this.height); var _local4:Rectangle = new Rectangle(this.registrationX, this.registrationY, this.registrationWidth, this.registrationHeight); this.resizingNow = true; var _local5:int; while (_local5 < this.videoPlayers.length) { _local6 = this.videoPlayers[_local5]; if (_local6 !== null){ _local6.setSize((this._origWidth * _arg1), (this._origWidth * _arg2)); }; _local5++; }; this.resizingNow = false; dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local3, _local4)); } flvplayback_internal function handleAutoLayoutEvent(_arg1:AutoLayoutEvent):void{ var _local4:Rectangle; var _local5:Rectangle; var _local2:VideoPlayerState = this.videoPlayerStateDict[_arg1.currentTarget]; var _local3:AutoLayoutEvent = AutoLayoutEvent(_arg1.clone()); _local3.oldBounds.x = (_local3.oldBounds.x + super.x); _local3.oldBounds.y = (_local3.oldBounds.y + super.y); _local3.oldRegistrationBounds.x = (_local3.oldRegistrationBounds.x + super.y); _local3.oldRegistrationBounds.y = (_local3.oldRegistrationBounds.y + super.y); _local3.vp = _local2.index; dispatchEvent(_local3); if (((!(this.resizingNow)) && ((_local2.index == this._visibleVP)))){ _local4 = Rectangle(_arg1.oldBounds.clone()); _local5 = Rectangle(_arg1.oldRegistrationBounds.clone()); _local4.x = (_local4.x + super.x); _local4.y = (_local4.y + super.y); _local5.x = (_local5.x + super.y); _local5.y = (_local5.y + super.y); dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local4, _local5)); }; } flvplayback_internal function handleMetadataEvent(_arg1:MetadataEvent):void{ var _local2:VideoPlayerState = this.videoPlayerStateDict[_arg1.currentTarget]; var _local3:CuePointManager = this.cuePointMgrs[_local2.index]; switch (_arg1.type){ case MetadataEvent.METADATA_RECEIVED: _local3.processFLVCuePoints(_arg1.info.cuePoints); break; case MetadataEvent.CUE_POINT: if (!_local3.isFLVCuePointEnabled(_arg1.info)){ return; }; break; }; var _local4:MetadataEvent = MetadataEvent(_arg1.clone()); _local4.vp = _local2.index; dispatchEvent(_local4); } flvplayback_internal function handleVideoProgressEvent(_arg1:VideoProgressEvent):void{ var _local2:VideoPlayerState = this.videoPlayerStateDict[_arg1.currentTarget]; var _local3:VideoProgressEvent = VideoProgressEvent(_arg1.clone()); _local3.vp = _local2.index; dispatchEvent(_local3); } flvplayback_internal function handleVideoEvent(_arg1:VideoEvent):void{ var _local6:Number; var _local2:VideoPlayerState = this.videoPlayerStateDict[_arg1.currentTarget]; var _local3:CuePointManager = this.cuePointMgrs[_local2.index]; var _local4:VideoEvent = VideoEvent(_arg1.clone()); _local4.vp = _local2.index; var _local5:String = ((((_local2.index == this._visibleVP)) && (this.scrubbing))) ? VideoState.SEEKING : _arg1.state; switch (_arg1.type){ case VideoEvent.AUTO_REWOUND: dispatchEvent(_local4); dispatchEvent(new VideoEvent(VideoEvent.REWIND, false, false, _local5, _arg1.playheadTime, _local2.index)); _local3.resetASCuePointIndex(_arg1.playheadTime); break; case VideoEvent.PLAYHEAD_UPDATE: _local4.state = _local5; dispatchEvent(_local4); if (((!(isNaN(_local2.preSeekTime))) && (!((_arg1.state == VideoState.SEEKING))))){ _local6 = _local2.preSeekTime; _local2.preSeekTime = NaN; _local3.resetASCuePointIndex(_arg1.playheadTime); dispatchEvent(new VideoEvent(VideoEvent.SEEKED, false, false, _arg1.state, _arg1.playheadTime, _local2.index)); if (_local6 < _arg1.playheadTime){ dispatchEvent(new VideoEvent(VideoEvent.FAST_FORWARD, false, false, _arg1.state, _arg1.playheadTime, _local2.index)); } else { if (_local6 > _arg1.playheadTime){ dispatchEvent(new VideoEvent(VideoEvent.REWIND, false, false, _arg1.state, _arg1.playheadTime, _local2.index)); }; }; }; _local3.dispatchASCuePoints(); break; case VideoEvent.STATE_CHANGE: if ((((_local2.index == this._visibleVP)) && (this.scrubbing))){ break; }; if (_arg1.state == VideoState.RESIZING){ break; }; if ((((((_local2.prevState == VideoState.LOADING)) && (_local2.autoPlay))) && ((_arg1.state == VideoState.STOPPED)))){ return; }; if ((((((((_arg1.state == VideoState.CONNECTION_ERROR)) && ((_arg1.vp == this._visibleVP)))) && (!(this._firstStreamShown)))) && (this.uiMgr.skinReady))){ this.showFirstStream(); this.uiMgr.visible = true; if (this.uiMgr.skin == ""){ this.uiMgr.hookUpCustomComponents(); }; if (this.skinShowTimer != null){ this.skinShowTimer.reset(); this.skinShowTimer = null; }; }; _local2.prevState = _arg1.state; _local4.state = _local5; dispatchEvent(_local4); if (_local2.owner.state != _arg1.state){ return; }; switch (_arg1.state){ case VideoState.BUFFERING: dispatchEvent(new VideoEvent(VideoEvent.BUFFERING_STATE_ENTERED, false, false, _local5, _arg1.playheadTime, _local2.index)); break; case VideoState.PAUSED: dispatchEvent(new VideoEvent(VideoEvent.PAUSED_STATE_ENTERED, false, false, _local5, _arg1.playheadTime, _local2.index)); break; case VideoState.PLAYING: dispatchEvent(new VideoEvent(VideoEvent.PLAYING_STATE_ENTERED, false, false, _local5, _arg1.playheadTime, _local2.index)); break; case VideoState.STOPPED: dispatchEvent(new VideoEvent(VideoEvent.STOPPED_STATE_ENTERED, false, false, _local5, _arg1.playheadTime, _local2.index)); break; }; break; case VideoEvent.READY: if (!this._firstStreamReady){ if (_local2.index == this._visibleVP){ this._firstStreamReady = true; if (((this.uiMgr.skinReady) && (!(this._firstStreamShown)))){ this.uiMgr.visible = true; if (this.uiMgr.skin == ""){ this.uiMgr.hookUpCustomComponents(); }; this.showFirstStream(); }; }; } else { if (((((this._firstStreamShown) && ((_arg1.state == VideoState.STOPPED)))) && (_local2.autoPlay))){ if (_local2.owner.isRTMP){ _local2.owner.play(); } else { _local2.prevState = VideoState.STOPPED; _local2.owner.playWhenEnoughDownloaded(); }; }; }; _local4.state = _local5; dispatchEvent(_local4); break; case VideoEvent.CLOSE: case VideoEvent.COMPLETE: _local4.state = _local5; dispatchEvent(_local4); break; }; } public function load(_arg1:String, _arg2:Number=NaN, _arg3:Boolean=false):void{ if ((((_arg1 == null)) || ((_arg1.length == 0)))){ return; }; if (_arg1 == this.source){ return; }; this.autoPlay = false; this.totalTime = _arg2; this.isLive = _arg3; this.source = _arg1; } public function play(_arg1:String=null, _arg2:Number=NaN, _arg3:Boolean=false):void{ var _local4:VideoPlayerState; var _local5:VideoPlayer; if (_arg1 == null){ if (!this._firstStreamShown){ _local4 = this.videoPlayerStates[this._activeVP]; this.queueCmd(_local4, QueuedCommand.PLAY); } else { _local5 = this.videoPlayers[this._activeVP]; _local5.play(); }; } else { if (_arg1 == this.source){ return; }; this.autoPlay = true; this.totalTime = _arg2; this.isLive = _arg3; this.source = _arg1; }; } public function playWhenEnoughDownloaded():void{ var _local1:VideoPlayerState; var _local2:VideoPlayer; if (!this._firstStreamShown){ _local1 = this.videoPlayerStates[this._activeVP]; this.queueCmd(_local1, QueuedCommand.PLAY_WHEN_ENOUGH); } else { _local2 = this.videoPlayers[this._activeVP]; _local2.playWhenEnoughDownloaded(); }; } public function pause():void{ var _local1:VideoPlayerState; var _local2:VideoPlayer; if (!this._firstStreamShown){ _local1 = this.videoPlayerStates[this._activeVP]; this.queueCmd(_local1, QueuedCommand.PAUSE); } else { _local2 = this.videoPlayers[this._activeVP]; _local2.pause(); }; } public function stop():void{ var _local1:VideoPlayerState; var _local2:VideoPlayer; if (!this._firstStreamShown){ _local1 = this.videoPlayerStates[this._activeVP]; this.queueCmd(_local1, QueuedCommand.STOP); } else { _local2 = this.videoPlayers[this._activeVP]; _local2.stop(); }; } public function seek(_arg1:Number):void{ var _local3:VideoPlayer; var _local2:VideoPlayerState = this.videoPlayerStates[this._activeVP]; if (!this._firstStreamShown){ _local2.preSeekTime = 0; this.queueCmd(_local2, QueuedCommand.SEEK, _arg1); } else { _local2.preSeekTime = this.playheadTime; _local3 = this.videoPlayers[this._activeVP]; _local3.seek(_arg1); }; } public function seekSeconds(_arg1:Number):void{ this.seek(_arg1); } public function seekPercent(_arg1:Number):void{ var _local2:VideoPlayer = this.videoPlayers[this._activeVP]; if (((((((((isNaN(_arg1)) || ((_arg1 < 0)))) || ((_arg1 > 100)))) || (isNaN(_local2.totalTime)))) || ((_local2.totalTime <= 0)))){ throw (new VideoError(VideoError.INVALID_SEEK)); }; this.seek(((_local2.totalTime * _arg1) / 100)); } public function get playheadPercentage():Number{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; if (isNaN(_local1.totalTime)){ return (NaN); }; return (((_local1.playheadTime / _local1.totalTime) * 100)); } public function set playheadPercentage(_arg1:Number):void{ this.seekPercent(_arg1); } public function set preview(_arg1:String):void{ trace("FLVPLAYBACK preview"); if (!this.isLivePreview){ return; }; } public function seekToNavCuePoint(_arg1):void{ var _local2:Object; if ((_arg1 is String)){ _local2 = {name:String(_arg1)}; } else { if ((_arg1 is Number)){ _local2 = {time:Number(_arg1)}; } else { _local2 = _arg1; }; }; if (_local2.name == undefined){ this.seekToNextNavCuePoint(_local2.time); return; }; if (isNaN(_local2.time)){ _local2.time = 0; }; var _local3:Object = this.findNearestCuePoint(_arg1, CuePointType.NAVIGATION); while (((!((_local3 == null))) && ((((_local3.time < _local2.time)) || (!(this.isFLVCuePointEnabled(_local3))))))) { _local3 = this.findNextCuePointWithName(_local3); }; if (_local3 == null){ throw (new VideoError(VideoError.INVALID_SEEK)); }; this.seek(_local3.time); } public function seekToNextNavCuePoint(_arg1:Number=NaN):void{ var _local2:VideoPlayer = this.videoPlayers[this._activeVP]; if (((isNaN(_arg1)) || ((_arg1 < 0)))){ _arg1 = (_local2.playheadTime + 0.001); }; var _local3:Object = this.findNearestCuePoint(_arg1, CuePointType.NAVIGATION); if (_local3 == null){ this.seek(_local2.totalTime); return; }; var _local4:Number = _local3.index; if (_local3.time < _arg1){ _local4++; }; while ((((_local4 < _local3.array.length)) && (!(this.isFLVCuePointEnabled(_local3.array[_local4]))))) { _local4++; }; if (_local4 >= _local3.array.length){ _arg1 = _local2.totalTime; if (_local3.array[(_local3.array.length - 1)].time > _arg1){ _arg1 = _local3.array[(_local3.array.length - 1)]; }; this.seek(_arg1); } else { this.seek(_local3.array[_local4].time); }; } public function seekToPrevNavCuePoint(_arg1:Number=NaN):void{ var _local4:VideoPlayer; if (((isNaN(_arg1)) || ((_arg1 < 0)))){ _local4 = this.videoPlayers[this._activeVP]; _arg1 = _local4.playheadTime; }; var _local2:Object = this.findNearestCuePoint(_arg1, CuePointType.NAVIGATION); if (_local2 == null){ this.seek(0); return; }; var _local3:Number = _local2.index; while ((((_local3 >= 0)) && (((!(this.isFLVCuePointEnabled(_local2.array[_local3]))) || ((_local2.array[_local3].time >= (_arg1 - this._seekToPrevOffset))))))) { _local3--; }; if (_local3 < 0){ this.seek(0); } else { this.seek(_local2.array[_local3].time); }; } public function addASCuePoint(_arg1, _arg2:String=null, _arg3:Object=null):Object{ var _local4:CuePointManager = this.cuePointMgrs[this._activeVP]; return (_local4.addASCuePoint(_arg1, _arg2, _arg3)); } public function removeASCuePoint(_arg1):Object{ var _local2:CuePointManager = this.cuePointMgrs[this._activeVP]; return (_local2.removeASCuePoint(_arg1)); } public function findCuePoint(_arg1, _arg2:String="all"):Object{ var _local3:CuePointManager = this.cuePointMgrs[this._activeVP]; switch (_arg2){ case "event": return (_local3.getCuePoint(_local3.eventCuePoints, false, _arg1)); case "navigation": return (_local3.getCuePoint(_local3.navCuePoints, false, _arg1)); case "flv": return (_local3.getCuePoint(_local3.flvCuePoints, false, _arg1)); case "actionscript": return (_local3.getCuePoint(_local3.asCuePoints, false, _arg1)); case "all": default: return (_local3.getCuePoint(_local3.allCuePoints, false, _arg1)); }; } public function findNearestCuePoint(_arg1, _arg2:String="all"):Object{ var _local3:CuePointManager = this.cuePointMgrs[this._activeVP]; switch (_arg2){ case "event": return (_local3.getCuePoint(_local3.eventCuePoints, true, _arg1)); case "navigation": return (_local3.getCuePoint(_local3.navCuePoints, true, _arg1)); case "flv": return (_local3.getCuePoint(_local3.flvCuePoints, true, _arg1)); case "actionscript": return (_local3.getCuePoint(_local3.asCuePoints, true, _arg1)); case "all": default: return (_local3.getCuePoint(_local3.allCuePoints, true, _arg1)); }; } public function findNextCuePointWithName(_arg1:Object):Object{ var _local2:CuePointManager = this.cuePointMgrs[this._activeVP]; return (_local2.getNextCuePointWithName(_arg1)); } public function setFLVCuePointEnabled(_arg1:Boolean, _arg2):Number{ var _local3:CuePointManager = this.cuePointMgrs[this._activeVP]; return (_local3.setFLVCuePointEnabled(_arg1, _arg2)); } public function isFLVCuePointEnabled(_arg1):Boolean{ var _local2:CuePointManager = this.cuePointMgrs[this._activeVP]; return (_local2.isFLVCuePointEnabled(_arg1)); } public function bringVideoPlayerToFront(_arg1:uint):void{ var skinDepth:int; var index = _arg1; if (index == this._topVP){ return; }; var vp:VideoPlayer = this.videoPlayers[index]; if (vp == null){ this.createVideoPlayer(index); vp = this.videoPlayers[index]; }; var moved:Boolean; if (this.uiMgr.skin_mc != null){ try { skinDepth = getChildIndex(this.uiMgr.skin_mc); if (skinDepth > 0){ setChildIndex(vp, (skinDepth - 1)); moved = true; }; } catch(err:Error) { }; }; if (!moved){ setChildIndex(vp, (numChildren - 1)); }; this._topVP = index; } public function getVideoPlayer(_arg1:Number):VideoPlayer{ return (this.videoPlayers[_arg1]); } public function closeVideoPlayer(_arg1:uint):void{ if (_arg1 == 0){ throw (new VideoError(VideoError.DELETE_DEFAULT_PLAYER)); }; if (this.videoPlayers[_arg1] == undefined){ return; }; var _local2:VideoPlayer = this.videoPlayers[_arg1]; if (this._visibleVP == _arg1){ this.visibleVideoPlayerIndex = 0; }; if (this._activeVP == _arg1){ this.activeVideoPlayerIndex = 0; }; removeChild(_local2); _local2.close(); delete this.videoPlayers[_arg1]; delete this.videoPlayerStates[_arg1]; delete this.videoPlayerStateDict[_local2]; } public function enterFullScreenDisplayState():void{ this.uiMgr.enterFullScreenDisplayState(); } public function set componentInspectorSetting(_arg1:Boolean):void{ this._componentInspectorSetting = _arg1; } public function get activeVideoPlayerIndex():uint{ return (this._activeVP); } public function set activeVideoPlayerIndex(_arg1:uint):void{ if (this._activeVP == _arg1){ return; }; this._activeVP = _arg1; if (this.videoPlayers[this._activeVP] == undefined){ this.createVideoPlayer(this._activeVP); }; } public function get align():String{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.align); } public function set align(_arg1:String):void{ if (this._activeVP == 0){ this._align = _arg1; }; var _local2:VideoPlayer = this.videoPlayers[this._activeVP]; _local2.align = _arg1; } public function get autoPlay():Boolean{ var _local1:VideoPlayerState = this.videoPlayerStates[this._activeVP]; return (_local1.autoPlay); } public function set autoPlay(_arg1:Boolean):void{ var _local2:VideoPlayerState = this.videoPlayerStates[this._activeVP]; _local2.autoPlay = _arg1; } public function get autoRewind():Boolean{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.autoRewind); } public function set autoRewind(_arg1:Boolean):void{ if (this._activeVP == 0){ this._autoRewind = _arg1; }; var _local2:VideoPlayer = this.videoPlayers[this._activeVP]; _local2.autoRewind = _arg1; } public function get bitrate():Number{ return (this.ncMgr.bitrate); } public function set bitrate(_arg1:Number):void{ this.ncMgr.bitrate = _arg1; } public function get buffering():Boolean{ return ((this.state == VideoState.BUFFERING)); } public function get bufferingBar():Sprite{ return (this.uiMgr.getControl(UIManager.BUFFERING_BAR)); } public function set bufferingBar(_arg1:Sprite):void{ this.uiMgr.setControl(UIManager.BUFFERING_BAR, _arg1); } public function get bufferingBarHidesAndDisablesOthers():Boolean{ return (this.uiMgr.bufferingBarHidesAndDisablesOthers); } public function set bufferingBarHidesAndDisablesOthers(_arg1:Boolean):void{ this.uiMgr.bufferingBarHidesAndDisablesOthers = _arg1; } public function get backButton():Sprite{ return (this.uiMgr.getControl(UIManager.BACK_BUTTON)); } public function set backButton(_arg1:Sprite):void{ this.uiMgr.setControl(UIManager.BACK_BUTTON, _arg1); } public function get bufferTime():Number{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.bufferTime); } public function set bufferTime(_arg1:Number):void{ var _local2:VideoPlayer = this.videoPlayers[this._activeVP]; _local2.bufferTime = _arg1; } public function get bytesLoaded():uint{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.bytesLoaded); } public function get bytesTotal():uint{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.bytesTotal); } public function get source():String{ var _local1:VideoPlayerState = this.videoPlayerStates[this._activeVP]; if (_local1.isWaiting){ return (_local1.url); }; var _local2:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local2.source); } public function set source(_arg1:String):void{ var _local2:VideoPlayerState; var _local3:CuePointManager; if (this.isLivePreview){ return; }; if (_arg1 == null){ _arg1 = ""; }; if (this._componentInspectorSetting){ _local2 = this.videoPlayerStates[this._activeVP]; _local2.url = _arg1; if (_arg1.length > 0){ _local2.isWaiting = true; addEventListener(Event.ENTER_FRAME, this.doContentPathConnect); }; } else { if (this.source == _arg1){ return; }; _local3 = this.cuePointMgrs[this._activeVP]; _local3.reset(); _local2 = this.videoPlayerStates[this._activeVP]; _local2.url = _arg1; _local2.isWaiting = true; this.doContentPathConnect(this._activeVP); }; } public function set cuePoints(_arg1:Array):void{ if (!this._componentInspectorSetting){ return; }; this.cuePointMgrs[0].processCuePointsProperty(_arg1); } public function get forwardButton():Sprite{ return (this.uiMgr.getControl(UIManager.FORWARD_BUTTON)); } public function set forwardButton(_arg1:Sprite):void{ this.uiMgr.setControl(UIManager.FORWARD_BUTTON, _arg1); } public function get fullScreenBackgroundColor():uint{ return (this.uiMgr.fullScreenBackgroundColor); } public function set fullScreenBackgroundColor(_arg1:uint):void{ this.uiMgr.fullScreenBackgroundColor = _arg1; } public function get fullScreenButton():Sprite{ return (this.uiMgr.getControl(UIManager.FULL_SCREEN_BUTTON)); } public function set fullScreenButton(_arg1:Sprite):void{ this.uiMgr.setControl(UIManager.FULL_SCREEN_BUTTON, _arg1); } public function get fullScreenSkinDelay():int{ return (this.uiMgr.fullScreenSkinDelay); } public function set fullScreenSkinDelay(_arg1:int):void{ this.uiMgr.fullScreenSkinDelay = _arg1; } public function get fullScreenTakeOver():Boolean{ return (this.uiMgr.fullScreenTakeOver); } public function set fullScreenTakeOver(_arg1:Boolean):void{ this.uiMgr.fullScreenTakeOver = _arg1; } override public function get height():Number{ if (this.isLivePreview){ return (this.livePreviewHeight); }; var _local1:VideoPlayer = this.videoPlayers[this._visibleVP]; return (_local1.height); } override public function set height(_arg1:Number):void{ var _local5:VideoPlayer; if (this.isLivePreview){ this.setSize(this.width, _arg1); return; }; var _local2:Rectangle = new Rectangle(this.x, this.y, this.width, this.height); var _local3:Rectangle = new Rectangle(this.registrationX, this.registrationY, this.registrationWidth, this.registrationHeight); this.resizingNow = true; var _local4:int; while (_local4 < this.videoPlayers.length) { _local5 = this.videoPlayers[_local4]; if (_local5 != null){ _local5.height = _arg1; }; _local4++; }; this.resizingNow = false; dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local2, _local3)); } public function get idleTimeout():Number{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.idleTimeout); } public function set idleTimeout(_arg1:Number):void{ if (this._activeVP == 0){ this._idleTimeout = _arg1; }; var _local2:VideoPlayer = this.videoPlayers[this._activeVP]; _local2.idleTimeout = _arg1; } public function get isRTMP():Boolean{ if (this.isLivePreview){ return (true); }; var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.isRTMP); } public function get isLive():Boolean{ var _local1:VideoPlayerState = this.videoPlayerStates[this._activeVP]; if (_local1.isLiveSet){ return (_local1.isLive); }; var _local2:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local2.isLive); } public function set isLive(_arg1:Boolean):void{ var _local2:VideoPlayerState = this.videoPlayerStates[this._activeVP]; _local2.isLive = _arg1; _local2.isLiveSet = true; } public function get metadata():Object{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.metadata); } public function get metadataLoaded():Boolean{ var _local1:CuePointManager = this.cuePointMgrs[this._activeVP]; return (_local1.metadataLoaded); } public function get muteButton():Sprite{ return (this.uiMgr.getControl(UIManager.MUTE_BUTTON)); } public function set muteButton(_arg1:Sprite):void{ this.uiMgr.setControl(UIManager.MUTE_BUTTON, _arg1); } public function get ncMgr():INCManager{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.ncMgr); } public function get pauseButton():Sprite{ return (this.uiMgr.getControl(UIManager.PAUSE_BUTTON)); } public function set pauseButton(_arg1:Sprite):void{ this.uiMgr.setControl(UIManager.PAUSE_BUTTON, _arg1); } public function get paused():Boolean{ return ((this.state == VideoState.PAUSED)); } public function get playButton():Sprite{ return (this.uiMgr.getControl(UIManager.PLAY_BUTTON)); } public function set playButton(_arg1:Sprite):void{ this.uiMgr.setControl(UIManager.PLAY_BUTTON, _arg1); } public function get playheadTime():Number{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.playheadTime); } public function set playheadTime(_arg1:Number):void{ this.seek(_arg1); } public function get playheadUpdateInterval():Number{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.playheadUpdateInterval); } public function set playheadUpdateInterval(_arg1:Number):void{ if (this._activeVP == 0){ this._playheadUpdateInterval = _arg1; }; var _local2:CuePointManager = this.cuePointMgrs[this._activeVP]; _local2.playheadUpdateInterval = _arg1; var _local3:VideoPlayer = this.videoPlayers[this._activeVP]; _local3.playheadUpdateInterval = _arg1; } public function get playing():Boolean{ return ((this.state == VideoState.PLAYING)); } public function get playPauseButton():Sprite{ return (this.uiMgr.getControl(UIManager.PLAY_PAUSE_BUTTON)); } public function set playPauseButton(_arg1:Sprite):void{ this.uiMgr.setControl(UIManager.PLAY_PAUSE_BUTTON, _arg1); } public function get preferredHeight():int{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.videoHeight); } public function get preferredWidth():int{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.videoWidth); } public function get progressInterval():Number{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.progressInterval); } public function set progressInterval(_arg1:Number):void{ if (this._activeVP == 0){ this._progressInterval = _arg1; }; var _local2:VideoPlayer = this.videoPlayers[this._activeVP]; _local2.progressInterval = _arg1; } public function get registrationX():Number{ return (super.x); } public function set registrationX(_arg1:Number):void{ super.x = _arg1; } public function get registrationY():Number{ return (super.y); } public function set registrationY(_arg1:Number):void{ super.y = _arg1; } public function get registrationWidth():Number{ var _local1:VideoPlayer = this.videoPlayers[this._visibleVP]; return (_local1.registrationWidth); } public function set registrationWidth(_arg1:Number):void{ this.width = _arg1; } public function get registrationHeight():Number{ var _local1:VideoPlayer = this.videoPlayers[this._visibleVP]; return (_local1.registrationHeight); } public function set registrationHeight(_arg1:Number):void{ this.height = _arg1; } public function get scaleMode():String{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.scaleMode); } public function set scaleMode(_arg1:String):void{ if (this._activeVP == 0){ this._scaleMode = _arg1; }; var _local2:VideoPlayer = this.videoPlayers[this._activeVP]; _local2.scaleMode = _arg1; } override public function get scaleX():Number{ var _local1:VideoPlayer = this.videoPlayers[this._visibleVP]; return ((_local1.width / this._origWidth)); } override public function set scaleX(_arg1:Number):void{ var _local5:VideoPlayer; var _local2:Rectangle = new Rectangle(this.x, this.y, this.width, this.height); var _local3:Rectangle = new Rectangle(this.registrationX, this.registrationY, this.registrationWidth, this.registrationHeight); this.resizingNow = true; var _local4:int; while (_local4 < this.videoPlayers.length) { _local5 = this.videoPlayers[_local4]; if (_local5 !== null){ _local5.width = (this._origWidth * _arg1); }; _local4++; }; this.resizingNow = false; dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local2, _local3)); } override public function get scaleY():Number{ var _local1:VideoPlayer = this.videoPlayers[this._visibleVP]; return ((_local1.height / this._origHeight)); } override public function set scaleY(_arg1:Number):void{ var _local5:VideoPlayer; var _local2:Rectangle = new Rectangle(this.x, this.y, this.width, this.height); var _local3:Rectangle = new Rectangle(this.registrationX, this.registrationY, this.registrationWidth, this.registrationHeight); this.resizingNow = true; var _local4:int; while (_local4 < this.videoPlayers.length) { _local5 = this.videoPlayers[_local4]; if (_local5 !== null){ _local5.height = (this._origHeight * _arg1); }; _local4++; }; this.resizingNow = false; dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local2, _local3)); } public function get scrubbing():Boolean{ var _local2:ControlData; var _local1:Sprite = this.seekBar; if (_local1 != null){ _local2 = this.uiMgr.ctrlDataDict[_local1]; return (_local2.isDragging); }; return (false); } public function get seekBar():Sprite{ return (this.uiMgr.getControl(UIManager.SEEK_BAR)); } public function set seekBar(_arg1:Sprite):void{ this.uiMgr.setControl(UIManager.SEEK_BAR, _arg1); } public function get seekBarInterval():Number{ return (this.uiMgr.seekBarInterval); } public function set seekBarInterval(_arg1:Number):void{ this.uiMgr.seekBarInterval = _arg1; } public function get seekBarScrubTolerance():Number{ return (this.uiMgr.seekBarScrubTolerance); } public function set seekBarScrubTolerance(_arg1:Number):void{ this.uiMgr.seekBarScrubTolerance = _arg1; } public function get seekToPrevOffset():Number{ return (this._seekToPrevOffset); } public function set seekToPrevOffset(_arg1:Number):void{ this._seekToPrevOffset = _arg1; } public function get skin():String{ return (this.uiMgr.skin); } public function set skin(_arg1:String):void{ this.uiMgr.skin = _arg1; } public function get skinAutoHide():Boolean{ return (this.uiMgr.skinAutoHide); } public function set skinAutoHide(_arg1:Boolean):void{ if (this.isLivePreview){ return; }; this.uiMgr.skinAutoHide = _arg1; } public function get skinBackgroundAlpha():Number{ return (this.uiMgr.skinBackgroundAlpha); } public function set skinBackgroundAlpha(_arg1:Number):void{ this.uiMgr.skinBackgroundAlpha = _arg1; } public function get skinBackgroundColor():uint{ return (this.uiMgr.skinBackgroundColor); } public function set skinBackgroundColor(_arg1:uint):void{ this.uiMgr.skinBackgroundColor = _arg1; } public function get skinFadeTime():int{ return (this.uiMgr.skinFadeTime); } public function set skinFadeTime(_arg1:int):void{ this.uiMgr.skinFadeTime = _arg1; } public function get skinScaleMaximum():Number{ return (this.uiMgr.skinScaleMaximum); } public function set skinScaleMaximum(_arg1:Number):void{ this.uiMgr.skinScaleMaximum = _arg1; } override public function get soundTransform():SoundTransform{ var _local1:VideoPlayer = this.videoPlayers[this._visibleVP]; var _local2:SoundTransform = _local1.soundTransform; if (this.scrubbing){ _local2.volume = this._volume; }; return (_local2); } override public function set soundTransform(_arg1:SoundTransform):void{ if (_arg1 == null){ return; }; this._volume = _arg1.volume; this._soundTransform.volume = (this.scrubbing) ? 0 : _arg1.volume; this._soundTransform.leftToLeft = _arg1.leftToLeft; this._soundTransform.leftToRight = _arg1.leftToRight; this._soundTransform.rightToLeft = _arg1.rightToLeft; this._soundTransform.rightToRight = _arg1.rightToRight; var _local2:VideoPlayer = this.videoPlayers[this._activeVP]; _local2.soundTransform = this._soundTransform; dispatchEvent(new SoundEvent(SoundEvent.SOUND_UPDATE, false, false, _local2.soundTransform)); } public function get state():String{ if (this.isLivePreview){ return (VideoState.STOPPED); }; var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; if ((((this._activeVP == this._visibleVP)) && (this.scrubbing))){ return (VideoState.SEEKING); }; var _local2:String = _local1.state; if (_local2 == VideoState.RESIZING){ return (VideoState.LOADING); }; var _local3:VideoPlayerState = this.videoPlayerStates[this._activeVP]; if ((((((_local3.prevState == VideoState.LOADING)) && (_local3.autoPlay))) && ((_local2 == VideoState.STOPPED)))){ return (VideoState.LOADING); }; return (_local2); } public function get stateResponsive():Boolean{ var _local1:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local1.stateResponsive); } public function get stopButton():Sprite{ return (this.uiMgr.getControl(UIManager.STOP_BUTTON)); } public function set stopButton(_arg1:Sprite):void{ this.uiMgr.setControl(UIManager.STOP_BUTTON, _arg1); } public function get stopped():Boolean{ return ((this.state == VideoState.STOPPED)); } public function get totalTime():Number{ if (this.isLivePreview){ return (1); }; var _local1:VideoPlayerState = this.videoPlayerStates[this._activeVP]; if (_local1.totalTimeSet){ return (_local1.totalTime); }; var _local2:VideoPlayer = this.videoPlayers[this._activeVP]; return (_local2.totalTime); } public function set totalTime(_arg1:Number):void{ var _local2:VideoPlayerState = this.videoPlayerStates[this._activeVP]; _local2.totalTime = _arg1; _local2.totalTimeSet = true; } public function get visibleVideoPlayerIndex():uint{ return (this._visibleVP); } public function set visibleVideoPlayerIndex(_arg1:uint):void{ var _local5:Rectangle; var _local6:Rectangle; if (this._visibleVP == _arg1){ return; }; if (this.videoPlayers[_arg1] == undefined){ this.createVideoPlayer(_arg1); }; var _local2:VideoPlayer = this.videoPlayers[_arg1]; var _local3:VideoPlayer = this.videoPlayers[this._visibleVP]; _local3.visible = false; _local3.volume = 0; this._visibleVP = _arg1; if (this._firstStreamShown){ this.uiMgr.setupSkinAutoHide(false); _local2.visible = true; this._soundTransform.volume = (this.scrubbing) ? 0 : this._volume; _local2.soundTransform = this._soundTransform; } else { if (((((((_local2.stateResponsive) || ((_local2.state == VideoState.CONNECTION_ERROR)))) || ((_local2.state == VideoState.DISCONNECTED)))) && (this.uiMgr.skinReady))){ this.uiMgr.visible = true; this.uiMgr.setupSkinAutoHide(false); this._firstStreamReady = true; if (this.uiMgr.skin == ""){ this.uiMgr.hookUpCustomComponents(); }; this.showFirstStream(); }; }; if (((!((_local2.height == _local3.height))) || (!((_local2.width == _local3.width))))){ _local5 = new Rectangle((_local3.x + super.x), (_local3.y + super.y), _local3.width, _local3.height); _local6 = new Rectangle((_local3.registrationX + super.x), (_local3.registrationY + super.y), _local3.registrationWidth, _local3.registrationHeight); dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local5, _local6)); }; var _local4:uint = this._activeVP; this._activeVP = this._visibleVP; this.uiMgr.handleIVPEvent(new VideoEvent(VideoEvent.STATE_CHANGE, false, false, this.state, this.playheadTime, this._visibleVP)); this.uiMgr.handleIVPEvent(new VideoEvent(VideoEvent.PLAYHEAD_UPDATE, false, false, this.state, this.playheadTime, this._visibleVP)); if (_local2.isRTMP){ this.uiMgr.handleIVPEvent(new VideoEvent(VideoEvent.READY, false, false, this.state, this.playheadTime, this._visibleVP)); } else { this.uiMgr.handleIVPEvent(new VideoProgressEvent(VideoProgressEvent.PROGRESS, false, false, this.bytesLoaded, this.bytesTotal, this._visibleVP)); }; this._activeVP = _local4; } public function get volume():Number{ return (this._volume); } public function set volume(_arg1:Number):void{ var _local2:VideoPlayer; if (this._volume == _arg1){ return; }; this._volume = _arg1; if (!this.scrubbing){ _local2 = this.videoPlayers[this._visibleVP]; _local2.volume = this._volume; }; dispatchEvent(new SoundEvent(SoundEvent.SOUND_UPDATE, false, false, _local2.soundTransform)); } public function get volumeBar():Sprite{ return (this.uiMgr.getControl(UIManager.VOLUME_BAR)); } public function set volumeBar(_arg1:Sprite):void{ this.uiMgr.setControl(UIManager.VOLUME_BAR, _arg1); } public function get volumeBarInterval():Number{ return (this.uiMgr.volumeBarInterval); } public function set volumeBarInterval(_arg1:Number):void{ this.uiMgr.volumeBarInterval = _arg1; } public function get volumeBarScrubTolerance():Number{ return (this.uiMgr.volumeBarScrubTolerance); } public function set volumeBarScrubTolerance(_arg1:Number):void{ this.uiMgr.volumeBarScrubTolerance = _arg1; } override public function get width():Number{ if (this.isLivePreview){ return (this.livePreviewWidth); }; var _local1:VideoPlayer = this.videoPlayers[this._visibleVP]; return (_local1.width); } override public function set width(_arg1:Number):void{ var _local5:VideoPlayer; if (this.isLivePreview){ this.setSize(_arg1, this.height); return; }; var _local2:Rectangle = new Rectangle(this.x, this.y, this.width, this.height); var _local3:Rectangle = new Rectangle(this.registrationX, this.registrationY, this.registrationWidth, this.registrationHeight); this.resizingNow = true; var _local4:int; while (_local4 < this.videoPlayers.length) { _local5 = this.videoPlayers[_local4]; if (_local5 != null){ _local5.width = _arg1; }; _local4++; }; this.resizingNow = false; dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local2, _local3)); } override public function get x():Number{ var _local1:VideoPlayer = this.videoPlayers[this._visibleVP]; return ((super.x + _local1.x)); } override public function set x(_arg1:Number):void{ var _local2:VideoPlayer = this.videoPlayers[this._visibleVP]; super.x = (_arg1 - _local2.x); } override public function get y():Number{ var _local1:VideoPlayer = this.videoPlayers[this._visibleVP]; return ((super.y + _local1.y)); } override public function set y(_arg1:Number):void{ var _local2:VideoPlayer = this.videoPlayers[this._visibleVP]; super.y = (_arg1 - _local2.y); } flvplayback_internal function createVideoPlayer(_arg1:Number):void{ var skinDepth:int; var index = _arg1; if (this.isLivePreview){ return; }; var vp:VideoPlayer = this.videoPlayers[index]; if (vp == null){ var _local3 = new VideoPlayer(0, 0); vp = _local3; this.videoPlayers[index] = _local3; vp.setSize(this.registrationWidth, this.registrationHeight); }; vp.visible = false; vp.volume = 0; vp.name = String(index); var added:Boolean; if (this.uiMgr.skin_mc != null){ try { skinDepth = getChildIndex(this.uiMgr.skin_mc); if (skinDepth > 0){ addChildAt(vp, skinDepth); added = true; }; } catch(err:Error) { }; }; if (!added){ addChild(vp); }; this._topVP = index; vp.autoRewind = this._autoRewind; vp.scaleMode = this._scaleMode; vp.bufferTime = this._bufferTime; vp.idleTimeout = this._idleTimeout; vp.playheadUpdateInterval = this._playheadUpdateInterval; vp.progressInterval = this._progressInterval; vp.soundTransform = this._soundTransform; var vpState:VideoPlayerState = new VideoPlayerState(vp, index); this.videoPlayerStates[index] = vpState; this.videoPlayerStateDict[vp] = vpState; vp.addEventListener(AutoLayoutEvent.AUTO_LAYOUT, this.handleAutoLayoutEvent); vp.addEventListener(MetadataEvent.CUE_POINT, this.handleMetadataEvent); vp.addEventListener(MetadataEvent.METADATA_RECEIVED, this.handleMetadataEvent); vp.addEventListener(VideoProgressEvent.PROGRESS, this.handleVideoProgressEvent); vp.addEventListener(VideoEvent.AUTO_REWOUND, this.handleVideoEvent); vp.addEventListener(VideoEvent.CLOSE, this.handleVideoEvent); vp.addEventListener(VideoEvent.COMPLETE, this.handleVideoEvent); vp.addEventListener(VideoEvent.PLAYHEAD_UPDATE, this.handleVideoEvent); vp.addEventListener(VideoEvent.STATE_CHANGE, this.handleVideoEvent); vp.addEventListener(VideoEvent.READY, this.handleVideoEvent); var cpMgr:CuePointManager = new CuePointManager(this, index); this.cuePointMgrs[index] = cpMgr; cpMgr.playheadUpdateInterval = this._playheadUpdateInterval; } private function createLivePreviewMovieClip():void{ } private function onCompletePreview(_arg1:Event):void{ var e = _arg1; try { this.previewImage_mc.width = this.livePreviewWidth; this.previewImage_mc.height = this.livePreviewHeight; } catch(e:Error) { }; } private function doContentPathConnect(_arg1):void{ if (this.isLivePreview){ return; }; var _local2:int; if ((_arg1 is int)){ _local2 = int(_arg1); } else { removeEventListener(Event.ENTER_FRAME, this.doContentPathConnect); }; var _local3:VideoPlayer = this.videoPlayers[_local2]; var _local4:VideoPlayerState = this.videoPlayerStates[_local2]; if (!_local4.isWaiting){ return; }; if (((_local4.autoPlay) && (this._firstStreamShown))){ _local3.play(_local4.url, _local4.totalTime, _local4.isLive); } else { _local3.load(_local4.url, _local4.totalTime, _local4.isLive); }; _local4.isLiveSet = false; _local4.totalTimeSet = false; _local4.isWaiting = false; } flvplayback_internal function showFirstStream():void{ var _local3:VideoPlayerState; var _local4:int; this._firstStreamShown = true; var _local1:VideoPlayer = this.videoPlayers[this._visibleVP]; _local1.visible = true; if (!this.scrubbing){ this._soundTransform.volume = this._volume; _local1.soundTransform = this._soundTransform; }; var _local2:int; while (_local2 < this.videoPlayers.length) { _local1 = this.videoPlayers[_local2]; if (_local1 != null){ _local3 = this.videoPlayerStates[_local2]; if ((((_local1.state == VideoState.STOPPED)) && (_local3.autoPlay))){ if (_local1.isRTMP){ _local1.play(); } else { _local3.prevState = VideoState.STOPPED; _local1.playWhenEnoughDownloaded(); }; }; if (_local3.cmdQueue != null){ _local4 = 0; while (_local4 < _local3.cmdQueue.length) { switch (_local3.cmdQueue[_local4].type){ case QueuedCommand.PLAY: _local1.play(); break; case QueuedCommand.PAUSE: _local1.pause(); break; case QueuedCommand.STOP: _local1.stop(); break; case QueuedCommand.SEEK: _local1.seek(_local3.cmdQueue[_local4].time); break; case QueuedCommand.PLAY_WHEN_ENOUGH: _local1.playWhenEnoughDownloaded(); break; }; _local4++; }; _local3.cmdQueue = null; }; }; _local2++; }; } flvplayback_internal function _scrubStart():void{ var _local1:Number = this.playheadTime; var _local2:VideoPlayer = this.videoPlayers[this._visibleVP]; this._volume = _local2.volume; _local2.volume = 0; dispatchEvent(new VideoEvent(VideoEvent.STATE_CHANGE, false, false, VideoState.SEEKING, _local1, this._visibleVP)); dispatchEvent(new VideoEvent(VideoEvent.SCRUB_START, false, false, VideoState.SEEKING, _local1, this._visibleVP)); } flvplayback_internal function _scrubFinish():void{ var _local1:Number = this.playheadTime; var _local2:String = this.state; var _local3:VideoPlayer = this.videoPlayers[this._visibleVP]; this._soundTransform.volume = this._volume; _local3.soundTransform = this._soundTransform; if (_local2 != VideoState.SEEKING){ dispatchEvent(new VideoEvent(VideoEvent.STATE_CHANGE, false, false, _local2, _local1, this._visibleVP)); }; dispatchEvent(new VideoEvent(VideoEvent.SCRUB_FINISH, false, false, _local2, _local1, this._visibleVP)); } flvplayback_internal function skinError(_arg1:String):void{ if (this.isLivePreview){ return; }; if (((this._firstStreamReady) && (!(this._firstStreamShown)))){ this.showFirstStream(); }; dispatchEvent(new SkinErrorEvent(SkinErrorEvent.SKIN_ERROR, false, false, _arg1)); } flvplayback_internal function skinLoaded():void{ if (this.isLivePreview){ return; }; var _local1:VideoPlayer = this.videoPlayers[this._visibleVP]; if (((((this._firstStreamReady) || ((_local1.state == VideoState.CONNECTION_ERROR)))) || ((_local1.state == VideoState.DISCONNECTED)))){ this.uiMgr.visible = true; if (!this._firstStreamShown){ this.showFirstStream(); }; } else { if (this.skinShowTimer != null){ this.skinShowTimer.reset(); this.skinShowTimer = null; }; this.skinShowTimer = new Timer(DEFAULT_SKIN_SHOW_TIMER_INTERVAL, 1); this.skinShowTimer.addEventListener(TimerEvent.TIMER, this.showSkinNow); this.skinShowTimer.start(); }; dispatchEvent(new VideoEvent(VideoEvent.SKIN_LOADED, false, false, this.state, this.playheadTime, this._visibleVP)); } flvplayback_internal function showSkinNow(_arg1:TimerEvent):void{ this.skinShowTimer = null; this.uiMgr.visible = true; } flvplayback_internal function queueCmd(_arg1:VideoPlayerState, _arg2:Number, _arg3:Number=NaN):void{ if (_arg1.cmdQueue == null){ _arg1.cmdQueue = new Array(); }; _arg1.cmdQueue.push(new QueuedCommand(_arg2, null, false, _arg3)); } public function assignTabIndexes(_arg1:int):int{ if (tabIndex){ tabEnabled = false; tabChildren = true; if (isNaN(_arg1)){ _arg1 = tabIndex; }; }; var _local2:int = this.uiMgr.assignTabIndexes(_arg1); return (_local2); } public function get endTabIndex():int{ return (this.uiMgr.endTabIndex); } public function get startTabIndex():int{ if (this.uiMgr.startTabIndex){ return (this.uiMgr.startTabIndex); }; if (tabIndex){ return (tabIndex); }; return (this.uiMgr.startTabIndex); } } }//package fl.video
Section 7
//flvplayback_internal (fl.video.flvplayback_internal) package fl.video { public namespace flvplayback_internal = "http://www.adobe.com/2007/flash/flvplayback/internal"; }//package fl.video
Section 8
//FPADManager (fl.video.FPADManager) package fl.video { import flash.events.*; import flash.net.*; public class FPADManager { private var _owner:INCManager; flvplayback_internal var xml:XML; flvplayback_internal var xmlLoader:URLLoader; flvplayback_internal var rtmpURL:String; flvplayback_internal var _url:String; flvplayback_internal var _uriParam:String; flvplayback_internal var _parseResults:ParseResults; public static const VERSION:String = "2.1.0.23"; public static const SHORT_VERSION:String = "2.1"; public function FPADManager(_arg1:INCManager){ this._owner = _arg1; } flvplayback_internal function connectXML(_arg1:String, _arg2:String, _arg3:String, _arg4:ParseResults):Boolean{ this._uriParam = _arg2; this._parseResults = _arg4; this._url = ((_arg1 + "uri=") + this._parseResults.protocol); if (this._parseResults.serverName != null){ this._url = (this._url + ("/" + this._parseResults.serverName)); }; if (this._parseResults.portNumber != null){ this._url = (this._url + (":" + this._parseResults.portNumber)); }; if (this._parseResults.wrappedURL != null){ this._url = (this._url + ("/?" + this._parseResults.wrappedURL)); }; this._url = (this._url + ("/" + this._parseResults.appName)); this._url = (this._url + _arg3); this.xml = new XML(); this.xmlLoader = new URLLoader(); this.xmlLoader.addEventListener(Event.COMPLETE, this.xmlLoadEventHandler); this.xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, this.xmlLoadEventHandler); this.xmlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.xmlLoadEventHandler); this.xmlLoader.load(new URLRequest(this._url)); return (false); } flvplayback_internal function xmlLoadEventHandler(_arg1:Event):void{ var proxy:String; var e = _arg1; try { if (e.type != Event.COMPLETE){ this._owner.helperDone(this, false); } else { this.xml = new XML(this.xmlLoader.data); if ((((this.xml == null)) || ((this.xml.localName() == null)))){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + this._url) + "\" No root node found; if url is for an flv it must have .flv extension and take no parameters"))); } else { if (this.xml.localName() != "fpad"){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + this._url) + "\" Root node not fpad"))); }; }; proxy = null; if ((((((this.xml.proxy.length() > 0)) && (this.xml.proxy.hasSimpleContent()))) && ((this.xml.proxy.*[0].nodeKind() == "text")))){ proxy = this.xml.proxy.*[0].toString(); }; if (proxy == null){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + this._url) + "\" fpad xml requires proxy tag."))); }; this.rtmpURL = ((((this._parseResults.protocol + "/") + proxy) + "/?") + this._uriParam); this._owner.helperDone(this, true); }; } catch(err:Error) { _owner.helperDone(this, false); throw (err); }; } } }//package fl.video
Section 9
//Icon (fl.video.Icon) package fl.video { import flash.display.*; public dynamic class Icon extends MovieClip { } }//package fl.video
Section 10
//INCManager (fl.video.INCManager) package fl.video { import flash.net.*; public interface INCManager { function connectToURL(_arg1:String):Boolean; function connectAgain():Boolean; function reconnect():void; function helperDone(_arg1:Object, _arg2:Boolean):void; function close():void; function get videoPlayer():VideoPlayer; function set videoPlayer(_arg1:VideoPlayer):void; function get timeout():uint; function set timeout(_arg1:uint):void; function get netConnection():NetConnection; function get bitrate():Number; function set bitrate(_arg1:Number):void; function get streamName():String; function get isRTMP():Boolean; function get streamLength():Number; function get streamWidth():int; function get streamHeight():int; function getProperty(_arg1:String); function setProperty(_arg1:String, _arg2):void; } }//package fl.video
Section 11
//IVPEvent (fl.video.IVPEvent) package fl.video { public interface IVPEvent { function get type():String; function get vp():uint; function set vp(_arg1:uint):void; } }//package fl.video
Section 12
//LayoutEvent (fl.video.LayoutEvent) package fl.video { import flash.events.*; import flash.geom.*; public class LayoutEvent extends Event { private var _oldBounds:Rectangle; private var _oldRegistrationBounds:Rectangle; public static const LAYOUT:String = "layout"; public function LayoutEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Rectangle=null, _arg5:Rectangle=null){ super(_arg1, _arg2, _arg3); this._oldBounds = _arg4; this._oldRegistrationBounds = _arg5; } public function get oldBounds():Rectangle{ return (this._oldBounds); } public function set oldBounds(_arg1:Rectangle):void{ this._oldBounds = _arg1; } public function get oldRegistrationBounds():Rectangle{ return (this._oldRegistrationBounds); } public function set oldRegistrationBounds(_arg1:Rectangle):void{ this._oldRegistrationBounds = _arg1; } override public function clone():Event{ return (new LayoutEvent(type, bubbles, cancelable, Rectangle(this.oldBounds.clone()), Rectangle(this.oldRegistrationBounds.clone()))); } } }//package fl.video
Section 13
//MetadataEvent (fl.video.MetadataEvent) package fl.video { import flash.events.*; public class MetadataEvent extends Event implements IVPEvent { private var _info:Object; private var _vp:uint; public static const METADATA_RECEIVED:String = "metadataReceived"; public static const CUE_POINT:String = "cuePoint"; public function MetadataEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Object=null, _arg5:uint=0){ super(_arg1, _arg2, _arg3); this._info = _arg4; this._vp = _arg5; } public function get info():Object{ return (this._info); } public function set info(_arg1:Object):void{ this._info = _arg1; } public function get vp():uint{ return (this._vp); } public function set vp(_arg1:uint):void{ this._vp = _arg1; } override public function clone():Event{ return (new MetadataEvent(type, bubbles, cancelable, this.info, this.vp)); } } }//package fl.video
Section 14
//NCManager (fl.video.NCManager) package fl.video { import flash.events.*; import flash.net.*; import flash.utils.*; public class NCManager implements INCManager { public const DEFAULT_TIMEOUT:uint = 60000; flvplayback_internal var _owner:VideoPlayer; flvplayback_internal var _contentPath:String; flvplayback_internal var _protocol:String; flvplayback_internal var _serverName:String; flvplayback_internal var _portNumber:String; flvplayback_internal var _wrappedURL:String; flvplayback_internal var _appName:String; flvplayback_internal var _streamName:String; flvplayback_internal var _streamLength:Number; flvplayback_internal var _streamWidth:int; flvplayback_internal var _streamHeight:int; flvplayback_internal var _streams:Array; flvplayback_internal var _isRTMP:Boolean; flvplayback_internal var _smilMgr:SMILManager; flvplayback_internal var _fpadMgr:FPADManager; flvplayback_internal var _fpadZone:Number; flvplayback_internal var _objectEncoding:uint; flvplayback_internal var _proxyType:String; flvplayback_internal var _bitrate:Number; public var fallbackServerName:String; flvplayback_internal var _timeoutTimer:Timer; flvplayback_internal var _payload:Number; flvplayback_internal var _autoSenseBW:Boolean; flvplayback_internal var _nc:NetConnection; flvplayback_internal var _ncUri:String; flvplayback_internal var _ncConnected:Boolean; flvplayback_internal var _tryNC:Array; flvplayback_internal var _tryNCTimer:Timer; flvplayback_internal var _connTypeCounter:uint; public static const VERSION:String = "2.1.0.23"; public static const SHORT_VERSION:String = "2.1"; public function NCManager(){ this._fpadZone = NaN; this._objectEncoding = ObjectEncoding.AMF0; this._proxyType = "best"; this._timeoutTimer = new Timer(this.DEFAULT_TIMEOUT); this._timeoutTimer.addEventListener(TimerEvent.TIMER, this._onFMSConnectTimeOut); this._tryNCTimer = new Timer(1500, 1); this._tryNCTimer.addEventListener(TimerEvent.TIMER, this.nextConnect); this.initNCInfo(); this.initOtherInfo(); this._nc = null; this._ncConnected = false; } flvplayback_internal function initNCInfo():void{ this._isRTMP = false; this._serverName = null; this._wrappedURL = null; this._portNumber = null; this._appName = null; } flvplayback_internal function initOtherInfo():void{ this._contentPath = null; this._streamName = null; this._streamWidth = -1; this._streamHeight = -1; this._streamLength = NaN; this._streams = null; this._autoSenseBW = false; this._payload = 0; this._connTypeCounter = 0; this.cleanConns(); } public function get timeout():uint{ return (this._timeoutTimer.delay); } public function set timeout(_arg1:uint):void{ this._timeoutTimer.delay = _arg1; } public function get bitrate():Number{ return (this._bitrate); } public function set bitrate(_arg1:Number):void{ if (!this._isRTMP){ this._bitrate = _arg1; }; } public function get videoPlayer():VideoPlayer{ return (this._owner); } public function set videoPlayer(_arg1:VideoPlayer):void{ this._owner = _arg1; } public function get netConnection():NetConnection{ return (this._nc); } public function get streamName():String{ return (this._streamName); } public function get isRTMP():Boolean{ return (this._isRTMP); } public function get streamLength():Number{ return (this._streamLength); } public function get streamWidth():int{ return (this._streamWidth); } public function get streamHeight():int{ return (this._streamHeight); } public function getProperty(_arg1:String){ switch (_arg1){ case "fallbackServerName": return (this.fallbackServerName); case "fpadZone": return (this._fpadZone); case "objectEncoding": return (this._objectEncoding); case "proxyType": return (this._proxyType); default: throw (new VideoError(VideoError.UNSUPPORTED_PROPERTY, _arg1)); }; } public function setProperty(_arg1:String, _arg2):void{ switch (_arg1){ case "fallbackServerName": this.fallbackServerName = String(_arg2); break; case "fpadZone": this._fpadZone = Number(_arg2); break; case "objectEncoding": this._objectEncoding = uint(_arg2); break; case "proxyType": this._proxyType = String(_arg2); break; default: throw (new VideoError(VideoError.UNSUPPORTED_PROPERTY, _arg1)); }; } public function connectToURL(_arg1:String):Boolean{ var canReuse:Boolean; var name:String; var url = _arg1; this.initOtherInfo(); this._contentPath = url; if ((((this._contentPath == null)) || ((this._contentPath == "")))){ throw (new VideoError(VideoError.INVALID_SOURCE)); }; var parseResults:ParseResults = this.parseURL(this._contentPath); if ((((parseResults.streamName == null)) || ((parseResults.streamName == "")))){ throw (new VideoError(VideoError.INVALID_SOURCE, url)); }; if (parseResults.isRTMP){ canReuse = this.canReuseOldConnection(parseResults); this._isRTMP = true; this._protocol = parseResults.protocol; this._streamName = parseResults.streamName; this._serverName = parseResults.serverName; this._wrappedURL = parseResults.wrappedURL; this._portNumber = parseResults.portNumber; this._appName = parseResults.appName; if ((((((((this._appName == null)) || ((this._appName == "")))) || ((this._streamName == null)))) || ((this._streamName == "")))){ throw (new VideoError(VideoError.INVALID_SOURCE, url)); }; this._autoSenseBW = (this._streamName.indexOf(",") >= 0); return (((canReuse) || (this.connectRTMP()))); } else { name = parseResults.streamName; if ((((((((name.indexOf("?") < 0)) && ((((name.length < 4)) || (!((name.slice(-4).toLowerCase() == ".txt"))))))) && ((((name.length < 4)) || (!((name.slice(-4).toLowerCase() == ".xml"))))))) && ((((name.length < 5)) || (!((name.slice(-5).toLowerCase() == ".smil"))))))){ canReuse = this.canReuseOldConnection(parseResults); this._isRTMP = false; this._streamName = name; return (((canReuse) || (this.connectHTTP()))); }; if (name.indexOf("/fms/fpad") >= 0){ try { return (this.connectFPAD(name)); } catch(err:Error) { }; }; this._smilMgr = new SMILManager(this); }; return (this._smilMgr.connectXML(name)); } public function connectAgain():Boolean{ var _local1:int = this._appName.indexOf("/"); if (_local1 < 0){ _local1 = this._streamName.indexOf("/"); if (_local1 >= 0){ this._appName = (this._appName + "/"); this._appName = (this._appName + this._streamName.slice(0, _local1)); this._streamName = this._streamName.slice((_local1 + 1)); }; return (false); }; var _local2:String = this._appName.slice((_local1 + 1)); _local2 = (_local2 + "/"); _local2 = (_local2 + this._streamName); this._streamName = _local2; this._appName = this._appName.slice(0, _local1); this.close(); this._payload = 0; this._connTypeCounter = 0; this.cleanConns(); this.connectRTMP(); return (true); } public function reconnect():void{ if (!this._isRTMP){ throw (new Error("Cannot call reconnect on an http connection")); }; this._nc.client = new ReconnectClient(this); this._nc.addEventListener(NetStatusEvent.NET_STATUS, this.reconnectOnStatus); this._nc.connect(this._ncUri, false); } flvplayback_internal function onReconnected():void{ this._ncConnected = true; this._owner.ncReconnected(); } public function close():void{ if (this._nc){ this._nc.close(); this._ncConnected = false; }; } public function helperDone(_arg1:Object, _arg2:Boolean):void{ var _local3:ParseResults; var _local4:String; var _local7:Number; if (!_arg2){ this._nc = null; this._ncConnected = false; this._owner.ncConnected(); this._smilMgr = null; this._fpadMgr = null; return; }; var _local5:Boolean; if (_arg1 == this._fpadMgr){ _local4 = this._fpadMgr.rtmpURL; this._fpadMgr = null; _local3 = this.parseURL(_local4); this._isRTMP = _local3.isRTMP; this._protocol = _local3.protocol; this._serverName = _local3.serverName; this._portNumber = _local3.portNumber; this._wrappedURL = _local3.wrappedURL; this._appName = _local3.appName; this._streamName = _local3.streamName; _local7 = this._fpadZone; this._fpadZone = NaN; this.connectRTMP(); this._fpadZone = _local7; return; }; if (_arg1 != this._smilMgr){ return; }; this._streamWidth = this._smilMgr.width; this._streamHeight = this._smilMgr.height; _local4 = this._smilMgr.baseURLAttr[0]; if (((!((_local4 == null))) && (!((_local4 == ""))))){ if (_local4.charAt((_local4.length - 1)) != "/"){ _local4 = (_local4 + "/"); }; _local3 = this.parseURL(_local4); this._isRTMP = _local3.isRTMP; _local5 = true; this._streamName = _local3.streamName; if (this._isRTMP){ this._protocol = _local3.protocol; this._serverName = _local3.serverName; this._portNumber = _local3.portNumber; this._wrappedURL = _local3.wrappedURL; this._appName = _local3.appName; if ((((this._appName == null)) || ((this._appName == "")))){ this._smilMgr = null; throw (new VideoError(VideoError.INVALID_XML, ("Base RTMP URL must include application name: " + _local4))); }; if (this._smilMgr.baseURLAttr.length > 1){ _local3 = this.parseURL(this._smilMgr.baseURLAttr[1]); if (_local3.serverName != null){ this.fallbackServerName = _local3.serverName; }; }; }; }; this._streams = this._smilMgr.videoTags; this._smilMgr = null; var _local6:uint; while (_local6 < this._streams.length) { _local4 = this._streams[_local6].src; _local3 = this.parseURL(_local4); if (!_local5){ this._isRTMP = _local3.isRTMP; _local5 = true; if (this._isRTMP){ this._protocol = _local3.protocol; if (this._streams.length > 1){ throw (new VideoError(VideoError.INVALID_XML, "Cannot switch between multiple absolute RTMP URLs, must use meta tag base attribute.")); }; this._serverName = _local3.serverName; this._portNumber = _local3.portNumber; this._wrappedURL = _local3.wrappedURL; this._appName = _local3.appName; if ((((this._appName == null)) || ((this._appName == "")))){ throw (new VideoError(VideoError.INVALID_XML, ("Base RTMP URL must include application name: " + _local4))); }; } else { if ((((_local3.streamName.indexOf("/fms/fpad") >= 0)) && ((this._streams.length > 1)))){ throw (new VideoError(VideoError.INVALID_XML, "Cannot switch between multiple absolute fpad URLs, must use meta tag base attribute.")); }; }; } else { if (((((((!((this._streamName == null))) && (!((this._streamName == ""))))) && (!(_local3.isRelative)))) && ((this._streams.length > 1)))){ throw (new VideoError(VideoError.INVALID_XML, "When using meta tag base attribute, cannot use absolute URLs for video or ref tag src attributes.")); }; }; this._streams[_local6].parseResults = _local3; _local6++; }; this._autoSenseBW = (this._streams.length > 1); if (!this._autoSenseBW){ if (this._streamName != null){ this._streamName = (this._streamName + this._streams[0].parseResults.streamName); } else { this._streamName = this._streams[0].parseResults.streamName; }; if (((this._isRTMP) && ((this._streamName.substr(-4).toLowerCase() == ".flv")))){ this._streamName = this._streamName.substr(0, (this._streamName.length - 4)); }; this._streamLength = this._streams[0].dur; }; if (this._isRTMP){ this.connectRTMP(); } else { if (((!((this._streamName == null))) && ((this._streamName.indexOf("/fms/fpad") >= 0)))){ this.connectFPAD(this._streamName); } else { if (this._autoSenseBW){ this.bitrateMatch(); }; this.connectHTTP(); this._owner.ncConnected(); }; }; } flvplayback_internal function bitrateMatch():void{ var _local1:Number = this._bitrate; if (isNaN(_local1)){ _local1 = 0; }; var _local2:uint = this._streams.length; var _local3:uint; while (_local3 < this._streams.length) { if (((isNaN(this._streams[_local3].bitrate)) || ((_local1 >= this._streams[_local3].bitrate)))){ _local2 = _local3; break; }; _local3++; }; if (_local2 == this._streams.length){ throw (new VideoError(VideoError.NO_BITRATE_MATCH)); }; if (this._streamName != null){ this._streamName = (this._streamName + this._streams[_local2].src); } else { this._streamName = this._streams[_local2].src; }; if (((this._isRTMP) && ((this._streamName.substr(-4).toLowerCase() == ".flv")))){ this._streamName = this._streamName.substr(0, (this._streamName.length - 4)); }; this._streamLength = this._streams[_local2].dur; } flvplayback_internal function parseURL(_arg1:String):ParseResults{ var _local5:int; var _local6:int; var _local7:String; var _local8:ParseResults; var _local2:ParseResults = new ParseResults(); var _local3:int; var _local4:int = _arg1.indexOf(":/", _local3); if (_local4 >= 0){ _local4 = (_local4 + 2); _local2.protocol = _arg1.slice(_local3, _local4).toLowerCase(); _local2.isRelative = false; } else { _local2.isRelative = true; }; if (((!((_local2.protocol == null))) && ((((((((((_local2.protocol == "rtmp:/")) || ((_local2.protocol == "rtmpt:/")))) || ((_local2.protocol == "rtmps:/")))) || ((_local2.protocol == "rtmpe:/")))) || ((_local2.protocol == "rtmpte:/")))))){ _local2.isRTMP = true; _local3 = _local4; if (_arg1.charAt(_local3) == "/"){ _local3++; _local5 = _arg1.indexOf(":", _local3); _local6 = _arg1.indexOf("/", _local3); if (_local6 < 0){ if (_local5 < 0){ _local2.serverName = _arg1.slice(_local3); } else { _local4 = _local5; _local2.portNumber = _arg1.slice(_local3, _local4); _local3 = (_local4 + 1); _local2.serverName = _arg1.slice(_local3); }; return (_local2); }; if ((((_local5 >= 0)) && ((_local5 < _local6)))){ _local4 = _local5; _local2.serverName = _arg1.slice(_local3, _local4); _local3 = (_local4 + 1); _local4 = _local6; _local2.portNumber = _arg1.slice(_local3, _local4); } else { _local4 = _local6; _local2.serverName = _arg1.slice(_local3, _local4); }; _local3 = (_local4 + 1); }; if (_arg1.charAt(_local3) == "?"){ _local7 = _arg1.slice((_local3 + 1)); _local8 = this.parseURL(_local7); if ((((_local8.protocol == null)) || (!(_local8.isRTMP)))){ throw (new VideoError(VideoError.INVALID_SOURCE, _arg1)); }; _local2.wrappedURL = "?"; _local2.wrappedURL = (_local2.wrappedURL + _local8.protocol); if (_local8.serverName != null){ _local2.wrappedURL = (_local2.wrappedURL + "/"); _local2.wrappedURL = (_local2.wrappedURL + _local8.serverName); }; if (_local8.portNumber != null){ _local2.wrappedURL = (_local2.wrappedURL + (":" + _local8.portNumber)); }; if (_local8.wrappedURL != null){ _local2.wrappedURL = (_local2.wrappedURL + "/"); _local2.wrappedURL = (_local2.wrappedURL + _local8.wrappedURL); }; _local2.appName = _local8.appName; _local2.streamName = _local8.streamName; return (_local2); }; _local4 = _arg1.indexOf("/", _local3); if (_local4 < 0){ _local2.appName = _arg1.slice(_local3); return (_local2); }; _local2.appName = _arg1.slice(_local3, _local4); _local3 = (_local4 + 1); _local4 = _arg1.indexOf("/", _local3); if (_local4 < 0){ _local2.streamName = _arg1.slice(_local3); if (_local2.streamName.slice(-4).toLowerCase() == ".flv"){ _local2.streamName = _local2.streamName.slice(0, -4); }; return (_local2); }; _local2.appName = (_local2.appName + "/"); _local2.appName = (_local2.appName + _arg1.slice(_local3, _local4)); _local3 = (_local4 + 1); _local2.streamName = _arg1.slice(_local3); if (_local2.streamName.slice(-4).toLowerCase() == ".flv"){ _local2.streamName = _local2.streamName.slice(0, -4); }; } else { _local2.isRTMP = false; _local2.streamName = _arg1; }; return (_local2); } flvplayback_internal function canReuseOldConnection(_arg1:ParseResults):Boolean{ if ((((this._nc == null)) || (!(this._ncConnected)))){ return (false); }; if (!_arg1.isRTMP){ if (!this._isRTMP){ return (true); }; this._owner.close(); this._nc = null; this._ncConnected = false; this.initNCInfo(); return (false); }; if (this._isRTMP){ if ((((((((((_arg1.serverName == this._serverName)) && ((_arg1.appName == this._appName)))) && ((_arg1.protocol == this._protocol)))) && ((_arg1.portNumber == this._portNumber)))) && ((_arg1.wrappedURL == this._wrappedURL)))){ return (true); }; this._owner.close(); this._nc = null; this._ncConnected = false; }; this.initNCInfo(); return (false); } flvplayback_internal function connectHTTP():Boolean{ this._nc = new NetConnection(); this._nc.connect(null); this._ncConnected = true; return (true); } flvplayback_internal function connectRTMP():Boolean{ this._timeoutTimer.stop(); this._timeoutTimer.start(); this._tryNC = new Array(); var _local1:int = ((((this._protocol == "rtmp:/")) || ((this._protocol == "rtmpe:/")))) ? 2 : 1; var _local2:uint; while (_local2 < _local1) { this._tryNC[_local2] = new NetConnection(); this._tryNC[_local2].objectEncoding = this._objectEncoding; this._tryNC[_local2].proxyType = this._proxyType; if (!isNaN(this._fpadZone)){ this._tryNC[_local2].fpadZone = this._fpadZone; }; this._tryNC[_local2].client = new ConnectClient(this, this._tryNC[_local2], _local2); this._tryNC[_local2].addEventListener(NetStatusEvent.NET_STATUS, this.connectOnStatus); _local2++; }; this.nextConnect(); return (false); } flvplayback_internal function connectFPAD(_arg1:String):Boolean{ var _local2:Object = /^(.+)(\?|\&)(uri=)([^&]+)(\&.*)?$/.exec(_arg1); if (_local2 == null){ throw (new VideoError(VideoError.INVALID_SOURCE, ("fpad url must include uri parameter: " + _arg1))); }; var _local3:String = (_local2[1] + _local2[2]); var _local4:String = _local2[4]; var _local5:String = ((_local2[5])==undefined) ? "" : _local2[5]; var _local6:ParseResults = this.parseURL(_local4); if (!_local6.isRTMP){ throw (new VideoError(VideoError.INVALID_SOURCE, ("fpad url uri parameter must be rtmp url: " + _arg1))); }; this._fpadMgr = new FPADManager(this); return (this._fpadMgr.connectXML(_local3, _local4, _local5, _local6)); } flvplayback_internal function nextConnect(_arg1:TimerEvent=null):void{ var _local2:String; var _local3:String; if (this._connTypeCounter == 0){ _local2 = this._protocol; _local3 = this._portNumber; } else { _local3 = null; if (this._protocol == "rtmp:/"){ _local2 = "rtmpt:/"; } else { if (this._protocol == "rtmpe:/"){ _local2 = "rtmpte:/"; } else { this._tryNC.pop(); return; }; }; }; var _local4:String = (((_local2 + ((this._serverName)==null) ? "" : ((("/" + this._serverName) + ((_local3)==null) ? "" : (":" + _local3)) + "/")) + ((this._wrappedURL)==null) ? "" : (this._wrappedURL + "/")) + this._appName); this._tryNC[this._connTypeCounter].client.pending = true; this._tryNC[this._connTypeCounter].connect(_local4, this._autoSenseBW); if (this._connTypeCounter < (this._tryNC.length - 1)){ this._connTypeCounter++; this._tryNCTimer.reset(); this._tryNCTimer.start(); }; } flvplayback_internal function cleanConns():void{ var _local1:uint; this._tryNCTimer.reset(); if (this._tryNC != null){ _local1 = 0; while (_local1 < this._tryNC.length) { if (this._tryNC[_local1] != null){ this._tryNC[_local1].removeEventListener(NetStatusEvent.NET_STATUS, this.connectOnStatus); if (this._tryNC[_local1].client.pending){ this._tryNC[_local1].addEventListener(NetStatusEvent.NET_STATUS, this.disconnectOnStatus); } else { this._tryNC[_local1].close(); }; }; this._tryNC[_local1] = null; _local1++; }; this._tryNC = null; }; } flvplayback_internal function tryFallBack():void{ if ((((this._serverName == this.fallbackServerName)) || ((this.fallbackServerName == null)))){ this._nc = null; this._ncConnected = false; this._owner.ncConnected(); } else { this._connTypeCounter = 0; this.cleanConns(); this._serverName = this.fallbackServerName; this.connectRTMP(); }; } flvplayback_internal function onConnected(_arg1:NetConnection, _arg2:Number):void{ var _local3:Array; var _local4:uint; var _local5:String; this._timeoutTimer.stop(); _arg1.removeEventListener(NetStatusEvent.NET_STATUS, this.connectOnStatus); this._nc = _arg1; this._ncUri = this._nc.uri; this._ncConnected = true; if (this._autoSenseBW){ this._bitrate = (_arg2 * 0x0400); if (this._streams != null){ this.bitrateMatch(); } else { _local3 = this._streamName.split(","); _local4 = 0; while (_local4 < _local3.length) { _local5 = stripFrontAndBackWhiteSpace(_local3[_local4]); if ((_local4 + 1) < _local3.length){ if (_arg2 <= Number(_local3[(_local4 + 1)])){ this._streamName = _local5; break; }; } else { this._streamName = _local5; break; }; _local4 = (_local4 + 2); }; if (this._streamName.slice(-4).toLowerCase() == ".flv"){ this._streamName = this._streamName.slice(0, -4); }; }; }; if (((!(this._owner.isLive)) && (isNaN(this._streamLength)))){ this._nc.call("getStreamLength", new Responder(this.getStreamLengthResult), this._streamName); } else { this._owner.ncConnected(); }; } flvplayback_internal function connectOnStatus(_arg1:NetStatusEvent):void{ var _local2:ParseResults; _arg1.target.client.pending = false; if (_arg1.info.code == "NetConnection.Connect.Success"){ this._nc = this._tryNC[_arg1.target.client.connIndex]; this.cleanConns(); } else { if ((((((_arg1.info.code == "NetConnection.Connect.Rejected")) && (!((_arg1.info.ex == null))))) && ((_arg1.info.ex.code == 302)))){ this._connTypeCounter = 0; this.cleanConns(); _local2 = this.parseURL(_arg1.info.ex.redirect); if (_local2.isRTMP){ this._protocol = _local2.protocol; this._serverName = _local2.serverName; this._wrappedURL = _local2.wrappedURL; this._portNumber = _local2.portNumber; this._appName = _local2.appName; if (_local2.streamName != null){ this._appName = (this._appName + ("/" + _local2.streamName)); }; this.connectRTMP(); } else { this.tryFallBack(); }; } else { if ((((((_arg1.info.code == "NetConnection.Connect.Failed")) || ((_arg1.info.code == "NetConnection.Connect.Rejected")))) && ((_arg1.target.client.connIndex == (this._tryNC.length - 1))))){ if (!this.connectAgain()){ this.tryFallBack(); }; }; }; }; } flvplayback_internal function reconnectOnStatus(_arg1:NetStatusEvent):void{ if ((((_arg1.info.code == "NetConnection.Connect.Failed")) || ((_arg1.info.code == "NetConnection.Connect.Rejected")))){ this._nc = null; this._ncConnected = false; this._owner.ncReconnected(); }; } flvplayback_internal function disconnectOnStatus(_arg1:NetStatusEvent):void{ if (_arg1.info.code == "NetConnection.Connect.Success"){ _arg1.target.removeEventListener(NetStatusEvent.NET_STATUS, this.disconnectOnStatus); _arg1.target.close(); }; } flvplayback_internal function getStreamLengthResult(_arg1:Number):void{ if (_arg1 > 0){ this._streamLength = _arg1; }; this._owner.ncConnected(); } flvplayback_internal function _onFMSConnectTimeOut(_arg1:TimerEvent=null):void{ this.cleanConns(); this._nc = null; this._ncConnected = false; if (!this.connectAgain()){ this._owner.ncConnected(); }; } flvplayback_internal static function stripFrontAndBackWhiteSpace(_arg1:String):String{ var _local2:uint; var _local3:uint = _arg1.length; var _local4:int; var _local5:int = _local3; _local2 = 0; for (;_local2 < _local3;_local2++) { switch (_arg1.charCodeAt(_local2)){ case 9: case 10: case 13: case 32: continue; }; _local4 = _local2; break; }; _local2 = _local3; for (;_local2 >= 0;_local2--) { switch (_arg1.charCodeAt(_local2)){ case 9: case 10: case 13: case 32: continue; }; _local5 = (_local2 + 1); break; }; if (_local5 <= _local4){ return (""); }; return (_arg1.slice(_local4, _local5)); } } }//package fl.video
Section 15
//ParseResults (fl.video.ParseResults) package fl.video { public class ParseResults { public var isRelative:Boolean; public var isRTMP:Boolean; public var protocol:String; public var serverName:String; public var portNumber:String; public var appName:String; public var streamName:String; public var wrappedURL:String; } }//package fl.video
Section 16
//QueuedCommand (fl.video.QueuedCommand) package fl.video { public class QueuedCommand { public var type:uint; public var url:String; public var isLive:Boolean; public var time:Number; public static const PLAY:uint = 0; public static const LOAD:uint = 1; public static const PAUSE:uint = 2; public static const STOP:uint = 3; public static const SEEK:uint = 4; public static const PLAY_WHEN_ENOUGH:uint = 5; public function QueuedCommand(_arg1:uint, _arg2:String, _arg3:Boolean, _arg4:Number){ this.type = _arg1; this.url = _arg2; this.isLive = _arg3; this.time = _arg4; } } }//package fl.video
Section 17
//ReconnectClient (fl.video.ReconnectClient) package fl.video { public class ReconnectClient { public var owner:NCManager; public function ReconnectClient(_arg1:NCManager){ this.owner = _arg1; } public function close():void{ } public function onBWDone(... _args):void{ this.owner.onReconnected(); } } }//package fl.video
Section 18
//SeekBarAccImpl (fl.video.SeekBarAccImpl) package fl.video { import flash.display.*; import flash.events.*; import flash.utils.*; import flash.accessibility.*; public class SeekBarAccImpl extends AccessibilityImplementation { protected var master:Sprite; protected var role:uint; private var _vc:FLVPlayback; private var _cachedPercentage:Number; private var _timer:Timer; private static const STATE_SYSTEM_NORMAL:uint = 0; private static const STATE_SYSTEM_FOCUSABLE:uint = 0x100000; private static const STATE_SYSTEM_FOCUSED:uint = 4; private static const STATE_SYSTEM_SELECTABLE:uint = 0x200000; private static const STATE_SYSTEM_SELECTED:uint = 2; private static const STATE_SYSTEM_UNAVAILABLE:uint = 1; private static const EVENT_OBJECT_FOCUS:uint = 32773; private static const EVENT_OBJECT_VALUECHANGE:uint = 32782; private static const EVENT_OBJECT_SELECTION:uint = 32774; private static const EVENT_OBJECT_LOCATIONCHANGE:uint = 32779; private static const ROLE_SLIDER:uint = 51; private static const ROLE_SYSTEM_INDICATOR:uint = 39; private static const ROLE_SYSTEM_PUSHBUTTON:uint = 43; public function SeekBarAccImpl(_arg1:Sprite){ var n:int; var i:int; var sprite = _arg1; super(); stub = false; this.master = sprite; if (!this.master.accessibilityProperties){ this.master.accessibilityProperties = new AccessibilityProperties(); }; this.master.accessibilityProperties.forceSimple = true; var events:Array = this.eventsToHandle; if (events){ n = events.length; i = 0; while (i < n) { this.master.addEventListener(events[i], this.eventHandler); i = (i + 1); }; }; this.master.addEventListener(FocusEvent.FOCUS_IN, this.focusInHandler); try { this._vc = Object(this.master).uiMgr._vc; this._vc.addEventListener(VideoEvent.PLAYHEAD_UPDATE, this.eventHandler); } catch(e:Error) { }; this.role = SeekBarAccImpl.ROLE_SLIDER; } protected function get eventsToHandle():Array{ return ([]); } override public function get_accRole(_arg1:uint):uint{ if (_arg1 == 0){ return (this.role); }; if (_arg1 == 2){ return (ROLE_SYSTEM_INDICATOR); }; return (ROLE_SYSTEM_PUSHBUTTON); } override public function get_accValue(_arg1:uint):String{ if (_arg1 == 0){ return ((Math.round(this._vc.playheadPercentage).toString() + "%")); }; return (null); } override public function get_accName(_arg1:uint):String{ var _local2 = ""; if ((((((((_arg1 == 0)) && (this.master.accessibilityProperties))) && (this.master.accessibilityProperties.name))) && (!((this.master.accessibilityProperties.name == ""))))){ _local2 = (_local2 + (this.master.accessibilityProperties.name + " ")); }; _local2 = (_local2 + (this.getName(_arg1) + this.getStatusName())); return ((((!((_local2 == null))) && (!((_local2 == ""))))) ? _local2 : null); } protected function getName(_arg1:uint):String{ var _local2 = ""; switch (_arg1){ case 1: _local2 = "Page Left"; break; case 2: _local2 = "Position"; break; case 3: _local2 = "Page Right"; break; case 0: _local2 = ""; break; }; return (_local2); } override public function getChildIDArray():Array{ var _local1:Array = []; var _local2:uint; while (_local2 < 3) { _local1[_local2] = (_local2 + 1); _local2++; }; return (_local1); } override public function accLocation(_arg1:uint){ var _local2:Object = this.master; var _local3:UIManager = (this._vc.uiMgr as UIManager); var _local4:DisplayObject = (_local3.controls[UIManager.SEEK_BAR] as DisplayObject); var _local5:Dictionary = (UIManager(_local3).ctrlDataDict as Dictionary); var _local6:ControlData = _local5[_local4]; switch (_arg1){ case 0: if (_local6.hit_mc){ _local2 = _local6.hit_mc; }; break; case 1: case 3: if (_local6.progress_mc){ _local2 = _local6.progress_mc; }; break; default: break; }; return (_local2); } override public function get_accState(_arg1:uint):uint{ var _local2:uint = this.getState(_arg1); return (_local2); } protected function getState(_arg1:uint):uint{ var _local2:uint = STATE_SYSTEM_NORMAL; if (_arg1 == 0){ if (((!(this.master.mouseEnabled)) || (!(this.master.tabEnabled)))){ _local2 = (_local2 | STATE_SYSTEM_UNAVAILABLE); } else { _local2 = (_local2 | STATE_SYSTEM_FOCUSABLE); }; if (Sprite(this.master).stage.focus == this.master){ _local2 = (_local2 | STATE_SYSTEM_FOCUSED); }; }; return (_local2); } override public function get_accDefaultAction(_arg1:uint):String{ if ((((_arg1 == 1)) || ((_arg1 == 3)))){ return ("Press"); }; return (null); } override public function accDoDefaultAction(_arg1:uint):void{ var nearestCuePoint:Object; var nextCuePoint:Object; var childID = _arg1; var percent:Number = this._vc.playheadPercentage; nearestCuePoint = this._vc.findNearestCuePoint(this._vc.playheadTime); if (childID == 1){ percent = (percent - (this._vc.seekBarScrubTolerance * 2)); this._vc.playheadPercentage = Math.max(percent, 0); } else { if (childID == 3){ if (this._vc.playheadPercentage >= 99){ return; }; if (((!((nearestCuePoint == null))) && ((nearestCuePoint.index < ((nearestCuePoint.array as Array).length - 1))))){ try { nextCuePoint = this._vc.findCuePoint(nearestCuePoint.array[(nearestCuePoint.index + 1)]); if (((nextCuePoint) && (this._vc.isFLVCuePointEnabled(nextCuePoint)))){ if (isNaN(Number(this._vc.metadata.videocodecid))){ this._vc.playheadPercentage = Math.max(((nextCuePoint.time / this._vc.totalTime) * 100), Math.min(99, (this._vc.playheadPercentage + (this._vc.seekBarScrubTolerance * 2)))); } else { this._vc.playheadTime = nextCuePoint.time; }; }; } catch(err:Error) { }; }; }; }; } private function getStatusName():String{ return (""); } protected function eventHandler(_arg1:Event):void{ var _local2:SeekBarAccImpl; if (Accessibility.active){ switch (_arg1.type){ case VideoEvent.PLAYHEAD_UPDATE: this._cachedPercentage = this._vc.playheadPercentage; _local2 = this; if (Accessibility.active){ Accessibility.sendEvent(this.master, 0, EVENT_OBJECT_SELECTION); Accessibility.sendEvent(this.master, 0, EVENT_OBJECT_VALUECHANGE, true); }; if (!this._timer){ this._timer = new Timer(10); this._timer.removeEventListener(TimerEvent.TIMER, this.sendAccessibilityEvent); this._timer.addEventListener(TimerEvent.TIMER, this.sendAccessibilityEvent); this._timer.start(); }; break; }; }; } private function focusInHandler(_arg1:Event):void{ if (Accessibility.active){ Accessibility.sendEvent(this.master, 0, EVENT_OBJECT_FOCUS); Accessibility.sendEvent(this.master, 0, EVENT_OBJECT_VALUECHANGE, true); }; } private function secondsToTime(_arg1:Number):String{ var _local2:String; var _local3:String; var _local4:String; var _local5:int; var _local6:int; var _local7:Number; _local5 = ((_arg1)>=3600) ? (_arg1 / 3600) : 0; _local6 = ((_arg1)>=60) ? ((_arg1 / 60) - (_local5 * 60)) : 0; _local7 = (_arg1 - ((_local5 * 3600) + (_local6 * 60))); _local2 = String(_local5); _local3 = ((((String(_local6).length == 1)) && ((_local5 > 0)))) ? ("0" + String(_local6)) : String(_local6); _local4 = ((String(Math.floor(_local7)).length)==1) ? ("0" + String(_local7)) : String(_local7); var _local8:String = ((_local3 + ":") + _local4); if (_local5 > 0){ _local8 = ((((_local2 + ":") + _local3) + ":") + _local4); }; return (_local8); } private function sendAccessibilityEvent(_arg1:TimerEvent):void{ if (this._cachedPercentage != this._vc.playheadPercentage){ _arg1.target.stop(); _arg1.target.removeEventListener(TimerEvent.TIMER, this.sendAccessibilityEvent); this._timer = undefined; if (Accessibility.active){ Accessibility.sendEvent(this.master, 0, EVENT_OBJECT_SELECTION); Accessibility.sendEvent(this.master, 0, EVENT_OBJECT_VALUECHANGE, true); }; }; } public static function createAccessibilityImplementation(_arg1:Sprite):void{ _arg1.accessibilityImplementation = new SeekBarAccImpl(_arg1); } public static function enableAccessibility():void{ } } }//package fl.video
Section 19
//SkinErrorEvent (fl.video.SkinErrorEvent) package fl.video { import flash.events.*; public class SkinErrorEvent extends ErrorEvent { public static const SKIN_ERROR:String = "skinError"; public function SkinErrorEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:String=""){ super(_arg1, _arg2, _arg3, _arg4); } override public function clone():Event{ return (new SkinErrorEvent(type, bubbles, cancelable, text)); } } }//package fl.video
Section 20
//SMILManager (fl.video.SMILManager) package fl.video { import flash.events.*; import flash.net.*; public class SMILManager { private var _owner:INCManager; flvplayback_internal var xml:XML; flvplayback_internal var xmlLoader:URLLoader; flvplayback_internal var baseURLAttr:Array; flvplayback_internal var width:int; flvplayback_internal var height:int; flvplayback_internal var videoTags:Array; private var _url:String; public static const VERSION:String = "2.1.0.23"; public static const SHORT_VERSION:String = "2.1"; public function SMILManager(_arg1:INCManager){ this._owner = _arg1; this.width = -1; this.height = -1; } flvplayback_internal function connectXML(_arg1:String):Boolean{ this._url = this.fixURL(_arg1); this.xmlLoader = new URLLoader(); this.xmlLoader.addEventListener(Event.COMPLETE, this.xmlLoadEventHandler); this.xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, this.xmlLoadEventHandler); this.xmlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.xmlLoadEventHandler); this.xmlLoader.load(new URLRequest(this._url)); return (false); } flvplayback_internal function fixURL(_arg1:String):String{ var _local2:String; if (/^(http:|https:)/i.test(_arg1)){ _local2 = ((_arg1.indexOf("?"))>=0) ? "&" : "?"; return ((((_arg1 + _local2) + "FLVPlaybackVersion=") + SHORT_VERSION)); }; return (_arg1); } flvplayback_internal function xmlLoadEventHandler(_arg1:Event):void{ var e = _arg1; try { if (e.type != Event.COMPLETE){ this._owner.helperDone(this, false); } else { this.baseURLAttr = new Array(); this.videoTags = new Array(); this.xml = new XML(this.xmlLoader.data); if ((((this.xml == null)) || ((this.xml.localName() == null)))){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + this._url) + "\" No root node found; if url is for an flv it must have .flv extension and take no parameters"))); } else { if (this.xml.localName() != "smil"){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + this._url) + "\" Root node not smil"))); }; }; this.checkForIllegalNodes(this.xml, "element", ["head", "body"]); if (this.xml.head.length() > 0){ this.parseHead(this.xml.head[0]); }; if (this.xml.body.length() < 1){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + this._url) + "\" Tag body is required."))); } else { this.parseBody(this.xml.body[0]); }; this._owner.helperDone(this, true); }; } catch(err:Error) { _owner.helperDone(this, false); throw (err); } finally { this.xmlLoader.removeEventListener(Event.COMPLETE, this.xmlLoadEventHandler); this.xmlLoader.removeEventListener(IOErrorEvent.IO_ERROR, this.xmlLoadEventHandler); this.xmlLoader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, this.xmlLoadEventHandler); this.xmlLoader = null; }; } flvplayback_internal function parseHead(_arg1:XML):void{ this.checkForIllegalNodes(_arg1, "element", ["meta", "layout"]); if (_arg1.meta.length() > 0){ this.checkForIllegalNodes(_arg1.meta[0], "element", []); this.checkForIllegalNodes(_arg1.meta[0], "attribute", ["base"]); if (_arg1.meta.@base.length() > 0){ this.baseURLAttr.push(_arg1.meta.@base.toString()); }; }; if (_arg1.layout.length() > 0){ this.parseLayout(_arg1.layout[0]); }; } flvplayback_internal function parseLayout(_arg1:XML):void{ var _local2:XML; var _local3:Number; var _local4:Number; this.checkForIllegalNodes(_arg1, "element", ["root-layout"]); if (_arg1["root-layout"].length() > 1){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + this._url) + "\" Only one base attribute supported in meta tag."))); }; if (_arg1["root-layout"].length() > 0){ _local2 = _arg1["root-layout"][0]; if (_local2.@width.length() > 0){ _local3 = Number(_local2.@width[0]); }; if (_local2.@height.length() > 0){ _local4 = Number(_local2.@height[0]); }; if (((((((isNaN(_local3)) || ((_local3 < 0)))) || (isNaN(_local4)))) || ((_local4 < 0)))){ throw (new VideoError(VideoError.INVALID_XML, (((("URL: \"" + this._url) + "\" Tag ") + _arg1.localName()) + " requires attributes width and height. Width and height must be numbers greater than or equal to 0."))); }; this.width = Math.round(_local3); this.height = Math.round(_local4); }; } flvplayback_internal function parseBody(_arg1:XML):void{ var _local2:XML; var _local4:Object; if (((!((_arg1.*.length() == 1))) || (!((_arg1.*[0].nodeKind() == "element"))))){ throw (new VideoError(VideoError.INVALID_XML, (((("URL: \"" + this._url) + "\" Tag ") + _arg1.localName()) + " is required to contain exactly one tag."))); }; _local2 = _arg1.*[0]; var _local3:String = _local2.localName(); switch (_local3){ case "switch": this.parseSwitch(_local2); break; case "video": case "ref": _local4 = this.parseVideo(_local2); this.videoTags.push(_local4); break; default: throw (new VideoError(VideoError.INVALID_XML, (((((("URL: \"" + this._url) + "\" Tag ") + _local3) + " not supported in ") + _arg1.localName()) + " tag."))); }; if (this.videoTags.length < 1){ throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + this._url) + "\" At least one video of ref tag is required."))); }; } flvplayback_internal function parseSwitch(_arg1:XML):void{ var _local2:String; var _local3:XML; for (_local2 in _arg1.*) { _local3 = _arg1.*[_local2]; if (_local3.nodeKind() != "element"){ } else { switch (_local3.localName()){ case "video": case "ref": this.videoTags.push(this.parseVideo(_local3)); break; default: break; }; }; }; } flvplayback_internal function parseVideo(_arg1:XML):Object{ var _local2:Object = new Object(); if (_arg1.@src.length() > 0){ _local2.src = _arg1.@src.toString(); }; if (_arg1.@["system-bitrate"].length() > 0){ _local2.bitrate = int(_arg1.@["system-bitrate"].toString()); }; if (_arg1.@dur.length() > 0){ _local2.dur = this.parseTime(_arg1.@dur.toString()); }; return (_local2); } flvplayback_internal function parseTime(_arg1:String):Number{ var _local3:Number; var _local4:Number; var _local2:Object = /^((\d+):)?(\d+):((\d+)(.\d+)?)$/.exec(_arg1); if (_local2 == null){ _local3 = Number(_arg1); if (((isNaN(_local3)) || ((_local3 < 0)))){ throw (new VideoError(VideoError.INVALID_XML, ("Invalid dur value: " + _arg1))); }; return (_local3); //unresolved jump }; _local4 = 0; _local4 = (_local4 + ((uint(_local2[2]) * 60) * 60)); _local4 = (_local4 + (uint(_local2[3]) * 60)); _local4 = (_local4 + Number(_local2[4])); return (_local4); } flvplayback_internal function checkForIllegalNodes(_arg1:XML, _arg2:String, _arg3:Array):void{ var _local4:String; var _local5:Boolean; var _local6:XML; var _local7:String; var _local8:String; for (_local4 in _arg1.*) { _local5 = false; _local6 = _arg1.*[_local4]; if (_local6.nodeKind() != _arg2){ } else { _local7 = _local6.localName(); for (_local8 in _arg3) { if (_arg3[_local8] == _local7){ _local5 = true; break; }; }; if (!_local5){ throw (new VideoError(VideoError.INVALID_XML, (((((((("URL: \"" + this._url) + "\" ") + _arg2) + " ") + _local7) + " not supported in ") + _arg1.localName()) + " tag."))); }; }; }; } } }//package fl.video
Section 21
//SoundEvent (fl.video.SoundEvent) package fl.video { import flash.events.*; import flash.media.*; public class SoundEvent extends Event { private var _soundTransform:SoundTransform; public static const SOUND_UPDATE:String = "soundUpdate"; public function SoundEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:SoundTransform=null){ super(_arg1, _arg2, _arg3); this._soundTransform = _arg4; } public function get soundTransform():SoundTransform{ return (this._soundTransform); } override public function clone():Event{ return (new SoundEvent(type, bubbles, cancelable, this.soundTransform)); } } }//package fl.video
Section 22
//UIManager (fl.video.UIManager) package fl.video { import flash.display.*; import flash.events.*; import flash.geom.*; import flash.net.*; import flash.utils.*; import flash.accessibility.*; import flash.system.*; import flash.ui.*; public class UIManager { flvplayback_internal var controls:Array; flvplayback_internal var delayedControls:Array; public var customClips:Array; public var ctrlDataDict:Dictionary; flvplayback_internal var skin_mc:Sprite; flvplayback_internal var skinLoader:Loader; flvplayback_internal var skinTemplate:Sprite; flvplayback_internal var layout_mc:Sprite; flvplayback_internal var border_mc:DisplayObject; flvplayback_internal var borderCopy:Sprite; flvplayback_internal var borderPrevRect:Rectangle; flvplayback_internal var borderScale9Rects:Array; flvplayback_internal var borderAlpha:Number; flvplayback_internal var borderColor:uint; flvplayback_internal var borderColorTransform:ColorTransform; flvplayback_internal var skinLoadDelayCount:uint; flvplayback_internal var placeholderLeft:Number; flvplayback_internal var placeholderRight:Number; flvplayback_internal var placeholderTop:Number; flvplayback_internal var placeholderBottom:Number; flvplayback_internal var videoLeft:Number; flvplayback_internal var videoRight:Number; flvplayback_internal var videoTop:Number; flvplayback_internal var videoBottom:Number; flvplayback_internal var _bufferingBarHides:Boolean; flvplayback_internal var _controlsEnabled:Boolean; flvplayback_internal var _skin:String; flvplayback_internal var _skinAutoHide:Boolean; flvplayback_internal var _skinFadingMaxTime:int; flvplayback_internal var _skinReady:Boolean; flvplayback_internal var __visible:Boolean; flvplayback_internal var _seekBarScrubTolerance:Number; flvplayback_internal var _skinScaleMaximum:Number; flvplayback_internal var _progressPercent:Number; flvplayback_internal var cachedSoundLevel:Number; flvplayback_internal var _lastVolumePos:Number; flvplayback_internal var _isMuted:Boolean; flvplayback_internal var _volumeBarTimer:Timer; flvplayback_internal var _volumeBarScrubTolerance:Number; flvplayback_internal var _vc:FLVPlayback; flvplayback_internal var _bufferingDelayTimer:Timer; flvplayback_internal var _bufferingOn:Boolean; flvplayback_internal var _seekBarTimer:Timer; flvplayback_internal var _lastScrubPos:Number; flvplayback_internal var _playAfterScrub:Boolean; flvplayback_internal var _skinAutoHideTimer:Timer; flvplayback_internal var _skinFadingTimer:Timer; flvplayback_internal var _skinFadingIn:Boolean; flvplayback_internal var _skinFadeStartTime:int; flvplayback_internal var _skinAutoHideMotionTimeout:int; flvplayback_internal var _skinAutoHideMouseX:Number; flvplayback_internal var _skinAutoHideMouseY:Number; flvplayback_internal var _skinAutoHideLastMotionTime:int; flvplayback_internal var mouseCaptureCtrl:int; flvplayback_internal var fullScreenSourceRectMinWidth:uint; flvplayback_internal var fullScreenSourceRectMinHeight:uint; flvplayback_internal var fullScreenSourceRectMinAspectRatio:Number; flvplayback_internal var _fullScreen:Boolean; flvplayback_internal var _fullScreenTakeOver:Boolean; flvplayback_internal var _fullScreenBgColor:uint; flvplayback_internal var _fullScreenAccel:Boolean; flvplayback_internal var _fullScreenVideoWidth:Number; flvplayback_internal var _fullScreenVideoHeight:Number; flvplayback_internal var cacheStageAlign:String; flvplayback_internal var cacheStageScaleMode:String; flvplayback_internal var cacheStageBGColor:uint; flvplayback_internal var cacheFLVPlaybackParent:DisplayObjectContainer; flvplayback_internal var cacheFLVPlaybackIndex:int; flvplayback_internal var cacheFLVPlaybackLocation:Rectangle; flvplayback_internal var cacheFLVPlaybackScaleMode:Array; flvplayback_internal var cacheFLVPlaybackAlign:Array; flvplayback_internal var cacheSkinAutoHide:Boolean; flvplayback_internal var hitTarget_mc:Sprite; flvplayback_internal var accessibilityPropertyNames:Array; flvplayback_internal var startTabIndex:int; flvplayback_internal var endTabIndex:int; flvplayback_internal var focusRect:Boolean;// = true public static const VERSION:String = "2.1.0.23"; public static const SHORT_VERSION:String = "2.1"; public static const PAUSE_BUTTON:int = 0; public static const PLAY_BUTTON:int = 1; public static const STOP_BUTTON:int = 2; public static const SEEK_BAR_HANDLE:int = 3; public static const SEEK_BAR_HIT:int = 4; public static const BACK_BUTTON:int = 5; public static const FORWARD_BUTTON:int = 6; public static const FULL_SCREEN_ON_BUTTON:int = 7; public static const FULL_SCREEN_OFF_BUTTON:int = 8; public static const MUTE_ON_BUTTON:int = 9; public static const MUTE_OFF_BUTTON:int = 10; public static const VOLUME_BAR_HANDLE:int = 11; public static const VOLUME_BAR_HIT:int = 12; public static const NUM_BUTTONS:int = 13; public static const PLAY_PAUSE_BUTTON:int = 13; public static const FULL_SCREEN_BUTTON:int = 14; public static const MUTE_BUTTON:int = 15; public static const BUFFERING_BAR:int = 16; public static const SEEK_BAR:int = 17; public static const VOLUME_BAR:int = 18; public static const NUM_CONTROLS:int = 19; public static const NORMAL_STATE:uint = 0; public static const OVER_STATE:uint = 1; public static const DOWN_STATE:uint = 2; public static const FULL_SCREEN_SOURCE_RECT_MIN_WIDTH:uint = 320; public static const FULL_SCREEN_SOURCE_RECT_MIN_HEIGHT:uint = 240; flvplayback_internal static const SKIN_AUTO_HIDE_INTERVAL:Number = 200; flvplayback_internal static const SKIN_FADING_INTERVAL:Number = 100; flvplayback_internal static const SKIN_FADING_MAX_TIME_DEFAULT:Number = 500; flvplayback_internal static const SKIN_AUTO_HIDE_MOTION_TIMEOUT_DEFAULT:Number = 3000; public static const VOLUME_BAR_INTERVAL_DEFAULT:Number = 250; public static const VOLUME_BAR_SCRUB_TOLERANCE_DEFAULT:Number = 0; public static const SEEK_BAR_INTERVAL_DEFAULT:Number = 250; public static const SEEK_BAR_SCRUB_TOLERANCE_DEFAULT:Number = 5; public static const BUFFERING_DELAY_INTERVAL_DEFAULT:Number = 1000; public static const CAPTIONS_ON_BUTTON:Number = 28; public static const CAPTIONS_OFF_BUTTON:Number = 29; public static const SHOW_CONTROLS_BUTTON:Number = 30; public static const HIDE_CONTROLS_BUTTON:Number = 31; flvplayback_internal static var layoutNameToIndexMappings:Object = null; flvplayback_internal static var layoutNameArray:Array = ["pause_mc", "play_mc", "stop_mc", null, null, "back_mc", "forward_mc", null, null, null, null, null, null, "playpause_mc", "fullScreenToggle_mc", "volumeMute_mc", "bufferingBar_mc", "seekBar_mc", "volumeBar_mc", "seekBarHandle_mc", "seekBarHit_mc", "seekBarProgress_mc", "seekBarFullness_mc", "volumeBarHandle_mc", "volumeBarHit_mc", "volumeBarProgress_mc", "volumeBarFullness_mc", "progressFill_mc"]; flvplayback_internal static var skinClassPrefixes:Array = ["pauseButton", "playButton", "stopButton", null, null, "backButton", "forwardButton", "fullScreenButtonOn", "fullScreenButtonOff", "muteButtonOn", "muteButtonOff", null, null, null, null, null, "bufferingBar", "seekBar", "volumeBar"]; flvplayback_internal static var customComponentClassNames:Array = ["PauseButton", "PlayButton", "StopButton", null, null, "BackButton", "ForwardButton", null, null, null, null, null, null, "PlayPauseButton", "FullScreenButton", "MuteButton", "BufferingBar", "SeekBar", "VolumeBar"]; flvplayback_internal static var buttonSkinLinkageIDs:Array = ["upLinkageID", "overLinkageID", "downLinkageID"]; public function UIManager(_arg1:FLVPlayback){ var vc = _arg1; this.accessibilityPropertyNames = ["Pause", "Play", "Stop", "Seek Bar", null, "Back", "Forward", "Go Full Screen", "Exit Full Screen", "Volume Mute On", "Volume Mute Off", "Volume", null, null, null, null, "Buffering", null, null, null, null, null, null, null, null, null, null, null, "Captions Off", "Captions On", "Show Video Player Controls", "Hide Video Player Controls"]; super(); this._vc = vc; this._skin = null; this._skinAutoHide = false; this.cacheSkinAutoHide = this._skinAutoHide; this._skinFadingMaxTime = SKIN_FADING_MAX_TIME_DEFAULT; this._skinAutoHideMotionTimeout = SKIN_AUTO_HIDE_MOTION_TIMEOUT_DEFAULT; this._skinReady = true; this.__visible = false; this._bufferingBarHides = false; this._controlsEnabled = true; this._lastScrubPos = 0; this._lastVolumePos = 0; this.cachedSoundLevel = this._vc.volume; this._isMuted = false; this.controls = new Array(); this.customClips = null; this.ctrlDataDict = new Dictionary(true); this.skin_mc = null; this.skinLoader = null; this.skinTemplate = null; this.layout_mc = null; this.border_mc = null; this.borderCopy = null; this.borderPrevRect = null; this.borderScale9Rects = null; this.borderAlpha = 0.85; this.borderColor = 4697035; this.borderColorTransform = new ColorTransform(0, 0, 0, 0, 71, 171, 203, (0xFF * this.borderAlpha)); this._seekBarScrubTolerance = SEEK_BAR_SCRUB_TOLERANCE_DEFAULT; this._volumeBarScrubTolerance = VOLUME_BAR_SCRUB_TOLERANCE_DEFAULT; this._bufferingOn = false; this.mouseCaptureCtrl = -1; this._seekBarTimer = new Timer(SEEK_BAR_INTERVAL_DEFAULT); this._seekBarTimer.addEventListener(TimerEvent.TIMER, this.seekBarListener); this._volumeBarTimer = new Timer(VOLUME_BAR_INTERVAL_DEFAULT); this._volumeBarTimer.addEventListener(TimerEvent.TIMER, this.volumeBarListener); this._bufferingDelayTimer = new Timer(BUFFERING_DELAY_INTERVAL_DEFAULT, 1); this._bufferingDelayTimer.addEventListener(TimerEvent.TIMER, this.doBufferingDelay); this._skinAutoHideTimer = new Timer(SKIN_AUTO_HIDE_INTERVAL); this._skinAutoHideTimer.addEventListener(TimerEvent.TIMER, this.skinAutoHideHitTest); this._skinFadingTimer = new Timer(SKIN_FADING_INTERVAL); this._skinFadingTimer.addEventListener(TimerEvent.TIMER, this.skinFadeMore); this._vc.addEventListener(MetadataEvent.METADATA_RECEIVED, this.handleIVPEvent); this._vc.addEventListener(VideoEvent.PLAYHEAD_UPDATE, this.handleIVPEvent); this._vc.addEventListener(VideoProgressEvent.PROGRESS, this.handleIVPEvent); this._vc.addEventListener(VideoEvent.STATE_CHANGE, this.handleIVPEvent); this._vc.addEventListener(VideoEvent.READY, this.handleIVPEvent); this._vc.addEventListener(LayoutEvent.LAYOUT, this.handleLayoutEvent); this._vc.addEventListener(AutoLayoutEvent.AUTO_LAYOUT, this.handleLayoutEvent); this._vc.addEventListener(SoundEvent.SOUND_UPDATE, this.handleSoundEvent); this._vc.addEventListener(Event.ADDED_TO_STAGE, this.handleEvent); this._vc.addEventListener(Event.REMOVED_FROM_STAGE, this.handleEvent); this.fullScreenSourceRectMinWidth = FULL_SCREEN_SOURCE_RECT_MIN_WIDTH; this.fullScreenSourceRectMinHeight = FULL_SCREEN_SOURCE_RECT_MIN_HEIGHT; this.fullScreenSourceRectMinAspectRatio = (FULL_SCREEN_SOURCE_RECT_MIN_WIDTH / FULL_SCREEN_SOURCE_RECT_MIN_HEIGHT); this._fullScreen = false; this._fullScreenTakeOver = (Capabilities.os.indexOf("iPhone") < 0); this._fullScreenBgColor = 0; this._fullScreenAccel = false; if (this._vc.stage != null){ this._vc.stage.addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, this.handleMouseFocusChangeEvent, false, 0, true); try { this._fullScreen = (this._vc.stage.displayState == StageDisplayState.FULL_SCREEN); this._vc.stage.addEventListener(FullScreenEvent.FULL_SCREEN, this.handleFullScreenEvent, false, 0, true); } catch(se:SecurityError) { }; }; if (layoutNameToIndexMappings == null){ initLayoutNameToIndexMappings(); }; } flvplayback_internal function handleFullScreenEvent(_arg1:FullScreenEvent):void{ this._fullScreen = _arg1.fullScreen; this.setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[FULL_SCREEN_OFF_BUTTON]); this.setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[FULL_SCREEN_ON_BUTTON]); if (((this._fullScreen) && (this._fullScreenTakeOver))){ this.enterFullScreenTakeOver(); } else { if (!this._fullScreen){ this.exitFullScreenTakeOver(); }; }; } flvplayback_internal function handleEvent(_arg1:Event):void{ var e = _arg1; switch (e.type){ case Event.ADDED_TO_STAGE: this._fullScreen = false; if (this._vc.stage != null){ try { this._fullScreen = (this._vc.stage.displayState == StageDisplayState.FULL_SCREEN); this._vc.stage.addEventListener(FullScreenEvent.FULL_SCREEN, this.handleFullScreenEvent, false, 0, true); } catch(se:SecurityError) { }; }; if (!this._fullScreen){ this._fullScreenAccel = false; }; this.setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[FULL_SCREEN_OFF_BUTTON]); this.setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[FULL_SCREEN_ON_BUTTON]); if (((this._fullScreen) && (this._fullScreenTakeOver))){ this.enterFullScreenTakeOver(); } else { if (!this._fullScreen){ this.exitFullScreenTakeOver(); }; }; this.layoutSkin(); this.setupSkinAutoHide(false); break; case Event.REMOVED_FROM_STAGE: this._vc.stage.removeEventListener(FullScreenEvent.FULL_SCREEN, this.handleFullScreenEvent); break; }; } flvplayback_internal function handleSoundEvent(_arg1:SoundEvent):void{ var _local3:ControlData; if (((this._isMuted) && ((_arg1.soundTransform.volume > 0)))){ this._isMuted = false; this.setEnabledAndVisibleForState(MUTE_OFF_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[MUTE_OFF_BUTTON]); this.setEnabledAndVisibleForState(MUTE_ON_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[MUTE_ON_BUTTON]); }; var _local2:Sprite = this.controls[VOLUME_BAR]; if (_local2 != null){ _local3 = this.ctrlDataDict[_local2]; _local3.percentage = ((this._isMuted) ? this.cachedSoundLevel : _arg1.soundTransform.volume * 100); if (_local3.percentage < 0){ _local3.percentage = 0; } else { if (_local3.percentage > 100){ _local3.percentage = 100; }; }; this.positionHandle(_local2); }; } flvplayback_internal function handleLayoutEvent(_arg1:LayoutEvent):void{ var _local2:int; if (((((((this._fullScreen) && (this._fullScreenTakeOver))) && (this._fullScreenAccel))) && (!((this._vc.stage == null))))){ if (((((((((!((this._vc.registrationX == 0))) || (!((this._vc.registrationY == 0))))) || (!((this._vc.parent == this._vc.stage))))) || (((this._fullScreenAccel) && (((!((this._vc.registrationWidth == this._vc.stage.fullScreenSourceRect.width))) || (!((this._vc.registrationHeight == this._vc.stage.fullScreenSourceRect.height))))))))) || (((!(this._fullScreenAccel)) && (((!((this._vc.registrationWidth == this._vc.stage.stageWidth))) || (!((this._vc.registrationHeight == this._vc.stage.stageHeight))))))))){ this._vc.stage.displayState = StageDisplayState.NORMAL; return; }; _local2 = this._vc.activeVideoPlayerIndex; this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex; if (this._vc.align != VideoAlign.CENTER){ this.cacheFLVPlaybackAlign[this._vc.visibleVideoPlayerIndex] = this._vc.align; this._vc.align = VideoAlign.CENTER; }; if (this._vc.scaleMode != VideoScaleMode.MAINTAIN_ASPECT_RATIO){ this.cacheFLVPlaybackScaleMode[this._vc.visibleVideoPlayerIndex] = this._vc.scaleMode; this._vc.scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO; this._vc.activeVideoPlayerIndex = _local2; return; }; this._vc.activeVideoPlayerIndex = _local2; }; this.layoutSkin(); this.setupSkinAutoHide(false); } flvplayback_internal function handleIVPEvent(_arg1:IVPEvent):void{ var _local3:int; var _local4:VideoEvent; var _local5:Sprite; var _local6:ControlData; var _local7:VideoProgressEvent; var _local8:VideoPlayerState; var _local9:Number; var _local10:Number; var _local11:Number; if (_arg1.vp != this._vc.visibleVideoPlayerIndex){ return; }; var _local2:uint = this._vc.activeVideoPlayerIndex; this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex; switch (_arg1.type){ case VideoEvent.STATE_CHANGE: _local4 = VideoEvent(_arg1); if (_local4.state == VideoState.BUFFERING){ if (!this._bufferingOn){ this._bufferingDelayTimer.reset(); this._bufferingDelayTimer.start(); }; } else { this._bufferingDelayTimer.reset(); this._bufferingOn = false; }; if (_local4.state == VideoState.LOADING){ this._progressPercent = (this._vc.getVideoPlayer(_arg1.vp).isRTMP) ? 100 : 0; _local3 = SEEK_BAR; while (_local3 <= VOLUME_BAR) { _local5 = this.controls[_local3]; if (this.controls[_local3] == null){ } else { _local6 = this.ctrlDataDict[_local5]; if (_local6.progress_mc != null){ this.positionBar(_local5, "progress", this._progressPercent); }; }; _local3++; }; }; _local3 = 0; while (_local3 < NUM_CONTROLS) { if (this.controls[_local3] == undefined){ } else { this.setEnabledAndVisibleForState(_local3, _local4.state); if (_local3 < NUM_BUTTONS){ this.skinButtonControl(this.controls[_local3]); }; }; _local3++; }; break; case VideoEvent.READY: case MetadataEvent.METADATA_RECEIVED: _local3 = 0; while (_local3 < NUM_CONTROLS) { if (this.controls[_local3] == undefined){ } else { this.setEnabledAndVisibleForState(_local3, this._vc.state); if (_local3 < NUM_BUTTONS){ this.skinButtonControl(this.controls[_local3]); }; }; _local3++; }; if (this._vc.getVideoPlayer(_arg1.vp).isRTMP){ this._progressPercent = 100; _local3 = SEEK_BAR; while (_local3 <= VOLUME_BAR) { _local5 = this.controls[_local3]; if (_local5 == null){ } else { _local6 = this.ctrlDataDict[_local5]; if (_local6.progress_mc != null){ this.positionBar(_local5, "progress", this._progressPercent); }; }; _local3++; }; }; break; case VideoEvent.PLAYHEAD_UPDATE: if (((((((!((this.controls[SEEK_BAR] == undefined))) && (!(this._vc.isLive)))) && (!(isNaN(this._vc.totalTime))))) && (!((this._vc.getVideoPlayer(this._vc.visibleVideoPlayerIndex).state == VideoState.SEEKING))))){ _local4 = VideoEvent(_arg1); _local10 = ((_local4.playheadTime / this._vc.totalTime) * 100); if (_local10 < 0){ _local10 = 0; } else { if (_local10 > 100){ _local10 = 100; }; }; _local5 = this.controls[SEEK_BAR]; _local6 = this.ctrlDataDict[_local5]; _local6.percentage = _local10; this.positionHandle(_local5); }; break; case VideoProgressEvent.PROGRESS: _local7 = VideoProgressEvent(_arg1); this._progressPercent = ((_local7.bytesTotal)<=0) ? 100 : ((_local7.bytesLoaded / _local7.bytesTotal) * 100); _local8 = this._vc.videoPlayerStates[_arg1.vp]; _local9 = _local8.minProgressPercent; if (((!(isNaN(_local9))) && ((_local9 > this._progressPercent)))){ this._progressPercent = _local9; }; if (!isNaN(this._vc.totalTime)){ _local11 = ((this._vc.playheadTime / this._vc.totalTime) * 100); if (_local11 > this._progressPercent){ this._progressPercent = _local11; _local8.minProgressPercent = this._progressPercent; }; }; _local3 = SEEK_BAR; while (_local3 <= VOLUME_BAR) { _local5 = this.controls[_local3]; if (_local5 == null){ } else { _local6 = this.ctrlDataDict[_local5]; if (_local6.progress_mc != null){ this.positionBar(_local5, "progress", this._progressPercent); }; }; _local3++; }; break; }; this._vc.activeVideoPlayerIndex = _local2; } public function get bufferingBarHidesAndDisablesOthers():Boolean{ return (this._bufferingBarHides); } public function set bufferingBarHidesAndDisablesOthers(_arg1:Boolean):void{ this._bufferingBarHides = _arg1; } public function get controlsEnabled():Boolean{ return (this._controlsEnabled); } public function set controlsEnabled(_arg1:Boolean):void{ if (this._controlsEnabled == _arg1){ return; }; this._controlsEnabled = _arg1; var _local2:int; while (_local2 < NUM_BUTTONS) { this.skinButtonControl(this.controls[_local2]); _local2++; }; } public function get fullScreenBackgroundColor():uint{ return (this._fullScreenBgColor); } public function set fullScreenBackgroundColor(_arg1:uint):void{ if (this._fullScreenBgColor != _arg1){ this._fullScreenBgColor = _arg1; if (this._vc){ }; }; } public function get fullScreenSkinDelay():int{ return (this._skinAutoHideMotionTimeout); } public function set fullScreenSkinDelay(_arg1:int):void{ this._skinAutoHideMotionTimeout = _arg1; } public function get fullScreenTakeOver():Boolean{ return (this._fullScreenTakeOver); } public function set fullScreenTakeOver(_arg1:Boolean):void{ var v = _arg1; if (this._fullScreenTakeOver != v){ this._fullScreenTakeOver = v; if (this._fullScreenTakeOver){ this.enterFullScreenTakeOver(); } else { if (((((!((this._vc.stage == null))) && (this._fullScreen))) && (this._fullScreenAccel))){ try { this._vc.stage.displayState = StageDisplayState.NORMAL; } catch(se:SecurityError) { }; }; this.exitFullScreenTakeOver(); }; }; } public function get skin():String{ return (this._skin); } public function set skin(_arg1:String):void{ var _local2:String; if (_arg1 == null){ this.removeSkin(); this._skin = null; this._skinReady = true; } else { _local2 = String(_arg1); if (_arg1 == this._skin){ return; }; this.removeSkin(); this._skin = String(_arg1); this._skinReady = (this._skin == ""); if (!this._skinReady){ this.downloadSkin(); }; }; } public function get skinAutoHide():Boolean{ return (this._skinAutoHide); } public function set skinAutoHide(_arg1:Boolean):void{ if (_arg1 == this._skinAutoHide){ return; }; this._skinAutoHide = _arg1; this.cacheSkinAutoHide = _arg1; this.setupSkinAutoHide(true); } public function get skinBackgroundAlpha():Number{ return (this.borderAlpha); } public function set skinBackgroundAlpha(_arg1:Number):void{ if (this.borderAlpha != _arg1){ this.borderAlpha = _arg1; this.borderColorTransform.alphaOffset = (0xFF * _arg1); this.borderPrevRect = null; this.layoutSkin(); }; } public function get skinBackgroundColor():uint{ return (this.borderColor); } public function set skinBackgroundColor(_arg1:uint):void{ if (this.borderColor != _arg1){ this.borderColor = _arg1; this.borderColorTransform.redOffset = ((this.borderColor >> 16) & 0xFF); this.borderColorTransform.greenOffset = ((this.borderColor >> 8) & 0xFF); this.borderColorTransform.blueOffset = (this.borderColor & 0xFF); this.borderPrevRect = null; this.layoutSkin(); }; } public function get skinFadeTime():int{ return (this._skinFadingMaxTime); } public function set skinFadeTime(_arg1:int):void{ this._skinFadingMaxTime = _arg1; } public function get skinReady():Boolean{ return (this._skinReady); } public function get seekBarInterval():Number{ return (this._seekBarTimer.delay); } public function set seekBarInterval(_arg1:Number):void{ if (this._seekBarTimer.delay == _arg1){ return; }; this._seekBarTimer.delay = _arg1; } public function get volumeBarInterval():Number{ return (this._volumeBarTimer.delay); } public function set volumeBarInterval(_arg1:Number):void{ if (this._volumeBarTimer.delay == _arg1){ return; }; this._volumeBarTimer.delay = _arg1; } public function get bufferingDelayInterval():Number{ return (this._bufferingDelayTimer.delay); } public function set bufferingDelayInterval(_arg1:Number):void{ if (this._bufferingDelayTimer.delay == _arg1){ return; }; this._bufferingDelayTimer.delay = _arg1; } public function get volumeBarScrubTolerance():Number{ return (this._volumeBarScrubTolerance); } public function set volumeBarScrubTolerance(_arg1:Number):void{ this._volumeBarScrubTolerance = _arg1; } public function get seekBarScrubTolerance():Number{ return (this._seekBarScrubTolerance); } public function set seekBarScrubTolerance(_arg1:Number):void{ this._seekBarScrubTolerance = _arg1; } public function get skinScaleMaximum():Number{ return (this._skinScaleMaximum); } public function set skinScaleMaximum(_arg1:Number):void{ this._skinScaleMaximum = _arg1; } public function get visible():Boolean{ return (this.__visible); } public function set visible(_arg1:Boolean):void{ if (this.__visible == _arg1){ return; }; this.__visible = _arg1; if (!this.__visible){ this.skin_mc.visible = false; } else { this.setupSkinAutoHide(false); }; } public function getControl(_arg1:int):Sprite{ return (this.controls[_arg1]); } public function setControl(_arg1:int, _arg2:Sprite):void{ var index = _arg1; var ctrl = _arg2; if (ctrl == this.controls[index]){ return; }; if (ctrl){ ctrl.tabEnabled = false; }; switch (index){ case PAUSE_BUTTON: case PLAY_BUTTON: this.resetPlayPause(); break; case PLAY_PAUSE_BUTTON: if ((((ctrl == null)) || (!((ctrl.parent == this.skin_mc))))){ this.resetPlayPause(); }; if (ctrl != null){ this.setControl(PAUSE_BUTTON, Sprite(ctrl.getChildByName("pause_mc"))); this.setControl(PLAY_BUTTON, Sprite(ctrl.getChildByName("play_mc"))); }; break; case FULL_SCREEN_BUTTON: if (ctrl != null){ this.setControl(FULL_SCREEN_ON_BUTTON, Sprite(ctrl.getChildByName("on_mc"))); this.setControl(FULL_SCREEN_OFF_BUTTON, Sprite(ctrl.getChildByName("off_mc"))); }; break; case MUTE_BUTTON: if (ctrl != null){ this.setControl(MUTE_ON_BUTTON, Sprite(ctrl.getChildByName("on_mc"))); this.setControl(MUTE_OFF_BUTTON, Sprite(ctrl.getChildByName("off_mc"))); }; break; }; if (this.controls[index] != null){ try { delete this.controls[index]["uiMgr"]; } catch(re:ReferenceError) { }; if (index < NUM_BUTTONS){ this.removeButtonListeners(this.controls[index]); }; delete this.ctrlDataDict[this.controls[index]]; delete this.controls[index]; }; if (ctrl == null){ return; }; var ctrlData:ControlData = this.ctrlDataDict[ctrl]; if (ctrlData == null){ ctrlData = new ControlData(this, ctrl, null, index); this.ctrlDataDict[ctrl] = ctrlData; } else { ctrlData.index = index; }; if (index >= NUM_BUTTONS){ this.controls[index] = ctrl; switch (index){ case SEEK_BAR: this.addBarControl(ctrl); break; case VOLUME_BAR: this.addBarControl(ctrl); ctrlData.percentage = (this._vc.volume * 100); break; case BUFFERING_BAR: if (ctrl.parent == this.skin_mc){ this.finishAddBufferingBar(); } else { ctrl.addEventListener(Event.ENTER_FRAME, this.finishAddBufferingBar); }; break; }; this.setEnabledAndVisibleForState(index, this._vc.state); } else { this.controls[index] = ctrl; this.addButtonControl(ctrl); }; } flvplayback_internal function resetPlayPause():void{ if (this.controls[PLAY_PAUSE_BUTTON] == undefined){ return; }; var _local1:int = PAUSE_BUTTON; while (_local1 <= PLAY_BUTTON) { this.removeButtonListeners(this.controls[_local1]); delete this.ctrlDataDict[this.controls[_local1]]; delete this.controls[_local1]; _local1++; }; delete this.ctrlDataDict[this.controls[PLAY_PAUSE_BUTTON]]; delete this.controls[PLAY_PAUSE_BUTTON]; } flvplayback_internal function addButtonControl(_arg1:Sprite):void{ if (_arg1 == null){ return; }; var _local2:ControlData = this.ctrlDataDict[_arg1]; _arg1.buttonMode = true; _arg1.tabEnabled = true; _arg1.tabChildren = true; _arg1.focusRect = this.focusRect; _arg1.accessibilityProperties = new AccessibilityProperties(); _arg1.accessibilityProperties.forceSimple = true; _arg1.accessibilityProperties.silent = true; if (this.accessibilityPropertyNames[_local2.index] != null){ _arg1.accessibilityProperties.name = this.accessibilityPropertyNames[_local2.index]; _arg1.accessibilityProperties.silent = false; }; if ((((_local2.index == VOLUME_BAR_HIT)) || ((_local2.index == SEEK_BAR_HIT)))){ _arg1.buttonMode = false; _arg1.tabEnabled = false; _arg1.tabChildren = false; _arg1.focusRect = false; _arg1.accessibilityProperties.silent = true; }; if ((((_local2.index == VOLUME_BAR_HANDLE)) || ((_local2.index == SEEK_BAR_HANDLE)))){ _arg1.graphics.moveTo(0, -18); _arg1.graphics.lineStyle(0, 0, 0); _arg1.graphics.lineTo(0, -18); _arg1.buttonMode = false; _arg1.focusRect = true; _arg1.accessibilityProperties.silent = false; this.configureBarAccessibility(_local2.index); }; _arg1.mouseChildren = false; var _local3:int = this._vc.activeVideoPlayerIndex; this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex; _local2.state = NORMAL_STATE; this.setEnabledAndVisibleForState(_local2.index, this._vc.state); _arg1.addEventListener(MouseEvent.ROLL_OVER, this.handleButtonEvent); _arg1.addEventListener(MouseEvent.ROLL_OUT, this.handleButtonEvent); _arg1.addEventListener(MouseEvent.MOUSE_DOWN, this.handleButtonEvent); _arg1.addEventListener(MouseEvent.CLICK, this.handleButtonEvent); _arg1.addEventListener(KeyboardEvent.KEY_DOWN, this.handleKeyEvent); _arg1.addEventListener(KeyboardEvent.KEY_UP, this.handleKeyEvent); _arg1.addEventListener(FocusEvent.FOCUS_IN, this.handleFocusEvent); _arg1.addEventListener(FocusEvent.FOCUS_OUT, this.handleFocusEvent); if (_arg1.parent == this.skin_mc){ this.skinButtonControl(_arg1); } else { _arg1.addEventListener(Event.ENTER_FRAME, this.skinButtonControl); }; this._vc.activeVideoPlayerIndex = _local3; } flvplayback_internal function handleButtonEvent(_arg1:MouseEvent):void{ var topLevel:DisplayObject; var e = _arg1; var ctrlData:ControlData = this.ctrlDataDict[e.currentTarget]; switch (e.type){ case MouseEvent.ROLL_OVER: ctrlData.state = OVER_STATE; break; case MouseEvent.ROLL_OUT: ctrlData.state = NORMAL_STATE; break; case MouseEvent.MOUSE_DOWN: ctrlData.state = DOWN_STATE; this.mouseCaptureCtrl = ctrlData.index; switch (this.mouseCaptureCtrl){ case SEEK_BAR_HANDLE: case SEEK_BAR_HIT: case VOLUME_BAR_HANDLE: case VOLUME_BAR_HIT: this.dispatchMessage(ctrlData.index); break; }; topLevel = this._vc.stage; try { topLevel.addEventListener(MouseEvent.MOUSE_DOWN, this.captureMouseEvent, true, 0, true); } catch(se:SecurityError) { topLevel = _vc.root; topLevel.addEventListener(MouseEvent.MOUSE_DOWN, captureMouseEvent, true, 0, true); }; topLevel.addEventListener(MouseEvent.MOUSE_OUT, this.captureMouseEvent, true, 0, true); topLevel.addEventListener(MouseEvent.MOUSE_OVER, this.captureMouseEvent, true, 0, true); topLevel.addEventListener(MouseEvent.MOUSE_UP, this.handleMouseUp, false, 0, true); topLevel.addEventListener(MouseEvent.ROLL_OUT, this.captureMouseEvent, true, 0, true); topLevel.addEventListener(MouseEvent.ROLL_OVER, this.captureMouseEvent, true, 0, true); break; case MouseEvent.CLICK: switch (this.mouseCaptureCtrl){ case SEEK_BAR_HANDLE: case SEEK_BAR_HIT: case VOLUME_BAR_HANDLE: case VOLUME_BAR_HIT: case FULL_SCREEN_OFF_BUTTON: case FULL_SCREEN_ON_BUTTON: break; default: this.dispatchMessage(ctrlData.index); break; }; return; }; this.skinButtonControl(e.currentTarget); } flvplayback_internal function captureMouseEvent(_arg1:MouseEvent):void{ _arg1.stopPropagation(); } flvplayback_internal function handleMouseUp(_arg1:MouseEvent):void{ var _local3:ControlData; var _local2:Sprite = this.controls[this.mouseCaptureCtrl]; if (_local2 != null){ _local3 = this.ctrlDataDict[_local2]; _local3.state = (_local2.hitTestPoint(_arg1.stageX, _arg1.stageY, true)) ? OVER_STATE : NORMAL_STATE; this.skinButtonControl(_local2); switch (this.mouseCaptureCtrl){ case SEEK_BAR_HANDLE: case SEEK_BAR_HIT: this.handleRelease(SEEK_BAR); break; case VOLUME_BAR_HANDLE: case VOLUME_BAR_HIT: this.handleRelease(VOLUME_BAR); break; case FULL_SCREEN_OFF_BUTTON: case FULL_SCREEN_ON_BUTTON: this.dispatchMessage(_local3.index); break; }; }; _arg1.currentTarget.removeEventListener(MouseEvent.MOUSE_DOWN, this.captureMouseEvent, true); _arg1.currentTarget.removeEventListener(MouseEvent.MOUSE_OUT, this.captureMouseEvent, true); _arg1.currentTarget.removeEventListener(MouseEvent.MOUSE_OVER, this.captureMouseEvent, true); _arg1.currentTarget.removeEventListener(MouseEvent.MOUSE_UP, this.handleMouseUp); _arg1.currentTarget.removeEventListener(MouseEvent.ROLL_OUT, this.captureMouseEvent, true); _arg1.currentTarget.removeEventListener(MouseEvent.ROLL_OVER, this.captureMouseEvent, true); } flvplayback_internal function removeButtonListeners(_arg1:Sprite):void{ if (_arg1 == null){ return; }; _arg1.removeEventListener(MouseEvent.ROLL_OVER, this.handleButtonEvent); _arg1.removeEventListener(MouseEvent.ROLL_OUT, this.handleButtonEvent); _arg1.removeEventListener(MouseEvent.MOUSE_DOWN, this.handleButtonEvent); _arg1.removeEventListener(MouseEvent.CLICK, this.handleButtonEvent); _arg1.removeEventListener(Event.ENTER_FRAME, this.skinButtonControl); } flvplayback_internal function downloadSkin():void{ if (this.skinLoader == null){ this.skinLoader = new Loader(); this.skinLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.handleLoad); this.skinLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, this.handleLoadErrorEvent); this.skinLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.handleLoadErrorEvent); }; this.skinLoader.load(new URLRequest(this._skin)); } flvplayback_internal function handleLoadErrorEvent(_arg1:ErrorEvent):void{ this._skinReady = true; this._vc.skinError(_arg1.toString()); } flvplayback_internal function handleLoad(_arg1:Event):void{ var i:int; var dispObj:DisplayObject; var index:Number; var e = _arg1; try { this.skin_mc = new Sprite(); if (e != null){ this.skinTemplate = Sprite(this.skinLoader.content); }; this.layout_mc = this.skinTemplate; this.customClips = new Array(); this.delayedControls = new Array(); i = 0; while (i < this.layout_mc.numChildren) { dispObj = this.layout_mc.getChildAt(i); index = layoutNameToIndexMappings[dispObj.name]; if (!isNaN(index)){ this.setSkin(int(index), dispObj); } else { if (dispObj.name != "video_mc"){ this.setCustomClip(dispObj); }; }; i = (i + 1); }; this.skinLoadDelayCount = 0; this._vc.addEventListener(Event.ENTER_FRAME, this.finishLoad); } catch(err:Error) { _vc.skinError(err.message); removeSkin(); }; } flvplayback_internal function finishLoad(_arg1:Event):void{ var i:int; var cachedActivePlayerIndex:int; var state:String; var j:int; var e = _arg1; try { this.skinLoadDelayCount++; if (this.skinLoadDelayCount < 2){ return; } else { this._vc.removeEventListener(Event.ENTER_FRAME, this.finishLoad); }; this.focusRect = this.isFocusRectActive(); i = 0; while (i < NUM_CONTROLS) { if (this.delayedControls[i] != undefined){ this.setControl(i, this.delayedControls[i]); }; i = (i + 1); }; if (this._fullScreenTakeOver){ this.enterFullScreenTakeOver(); } else { this.exitFullScreenTakeOver(); }; this.layoutSkin(); this.setupSkinAutoHide(false); this.skin_mc.visible = this.__visible; this._vc.addChild(this.skin_mc); this._skinReady = true; this._vc.skinLoaded(); cachedActivePlayerIndex = this._vc.activeVideoPlayerIndex; this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex; state = this._vc.state; j = 0; while (j < NUM_CONTROLS) { if (this.controls[j] == undefined){ } else { this.setEnabledAndVisibleForState(j, state); if (j < NUM_BUTTONS){ this.skinButtonControl(this.controls[j]); }; }; j = (j + 1); }; this._vc.activeVideoPlayerIndex = cachedActivePlayerIndex; } catch(err:Error) { _vc.skinError(err.message); removeSkin(); }; } flvplayback_internal function layoutSkin():void{ var i:int; var borderRect:Rectangle; var forceSkinAutoHide:Boolean; var minWidth:Number; var vidWidth:Number; var minHeight:Number; var vidHeight:Number; if (this.layout_mc == null){ return; }; if (this.skinLoadDelayCount < 2){ return; }; var video_mc:DisplayObject = this.layout_mc["video_mc"]; if (video_mc == null){ throw (new Error("No layout_mc.video_mc")); }; this.placeholderLeft = video_mc.x; this.placeholderRight = (video_mc.x + video_mc.width); this.placeholderTop = video_mc.y; this.placeholderBottom = (video_mc.y + video_mc.height); this.videoLeft = (this._vc.x - this._vc.registrationX); this.videoRight = (this.videoLeft + this._vc.width); this.videoTop = (this._vc.y - this._vc.registrationY); this.videoBottom = (this.videoTop + this._vc.height); if (((((this._fullScreen) && (this._fullScreenTakeOver))) && (!((this.border_mc == null))))){ borderRect = this.calcLayoutControl(this.border_mc); forceSkinAutoHide = false; if ((((borderRect.width > 0)) && ((borderRect.height > 0)))){ if (borderRect.x < 0){ this.placeholderLeft = (this.placeholderLeft + (this.videoLeft - borderRect.x)); forceSkinAutoHide = true; }; if ((borderRect.x + borderRect.width) > this._vc.registrationWidth){ this.placeholderRight = (this.placeholderRight + ((borderRect.x + borderRect.width) - this.videoRight)); forceSkinAutoHide = true; }; if (borderRect.y < 0){ this.placeholderTop = (this.placeholderTop + (this.videoTop - borderRect.y)); forceSkinAutoHide = true; }; if ((borderRect.y + borderRect.height) > this._vc.registrationHeight){ this.placeholderBottom = (this.placeholderBottom + ((borderRect.y + borderRect.height) - this.videoBottom)); forceSkinAutoHide = true; }; if (forceSkinAutoHide){ this._skinAutoHide = true; this.setupSkinAutoHide(true); }; }; }; try { if (!isNaN(this.layout_mc["minWidth"])){ minWidth = this.layout_mc["minWidth"]; vidWidth = (this.videoRight - this.videoLeft); if ((((minWidth > 0)) && ((minWidth > vidWidth)))){ this.videoLeft = (this.videoLeft - ((minWidth - vidWidth) / 2)); this.videoRight = (minWidth + this.videoLeft); }; }; } catch(re1:ReferenceError) { }; try { if (!isNaN(this.layout_mc["minHeight"])){ minHeight = this.layout_mc["minHeight"]; vidHeight = (this.videoBottom - this.videoTop); if ((((minHeight > 0)) && ((minHeight > vidHeight)))){ this.videoTop = (this.videoTop - ((minHeight - vidHeight) / 2)); this.videoBottom = (minHeight + this.videoTop); }; }; } catch(re2:ReferenceError) { }; i = 0; while (i < this.customClips.length) { this.layoutControl(this.customClips[i]); if (this.customClips[i] == this.border_mc){ this.bitmapCopyBorder(); }; i = (i + 1); }; i = 0; while (i < NUM_CONTROLS) { this.layoutControl(this.controls[i]); i = (i + 1); }; } flvplayback_internal function bitmapCopyBorder():void{ var _local2:BitmapData; var _local3:Matrix; var _local4:Number; var _local5:Number; var _local6:Rectangle; var _local7:int; var _local8:Number; var _local9:Number; var _local10:int; var _local11:Bitmap; var _local12:Number; var _local13:Number; if ((((this.border_mc == null)) || ((this.borderCopy == null)))){ return; }; var _local1:Rectangle = this.border_mc.getBounds(this.skin_mc); if ((((this.borderPrevRect == null)) || (!(this.borderPrevRect.equals(_local1))))){ this.borderCopy.x = _local1.x; this.borderCopy.y = _local1.y; _local3 = new Matrix(this.border_mc.scaleX, 0, 0, this.border_mc.scaleY, 0, 0); if (this.borderScale9Rects == null){ _local2 = new BitmapData(_local1.width, _local1.height, true, 0); _local2.draw(this.border_mc, _local3, this.borderColorTransform); Bitmap(this.borderCopy.getChildAt(0)).bitmapData = _local2; } else { _local4 = 0; _local5 = 0; _local6 = new Rectangle(0, 0, 0, 0); _local7 = 0; _local8 = 0; if (this.borderScale9Rects[3] != null){ _local8 = (_local8 + this.borderScale9Rects[3].width); }; if (this.borderScale9Rects[5] != null){ _local8 = (_local8 + this.borderScale9Rects[5].width); }; _local9 = 0; if (this.borderScale9Rects[1] != null){ _local9 = (_local9 + this.borderScale9Rects[1].height); }; if (this.borderScale9Rects[7] != null){ _local9 = (_local9 + this.borderScale9Rects[7].height); }; _local10 = 0; while (_local10 < this.borderScale9Rects.length) { if ((_local10 % 3) == 0){ _local4 = 0; _local5 = (_local5 + _local6.height); }; if (this.borderScale9Rects[_local10] == null){ } else { _local6 = Rectangle(this.borderScale9Rects[_local10]).clone(); _local3.a = 1; if ((((((_local10 == 1)) || ((_local10 == 4)))) || ((_local10 == 7)))){ _local12 = ((_local1.width - _local8) / _local6.width); _local6.x = (_local6.x * _local12); _local6.width = (_local6.width * _local12); _local6.width = Math.round(_local6.width); _local3.a = (_local3.a * _local12); }; _local3.tx = -(_local6.x); _local6.x = 0; _local3.d = 1; if ((((_local10 >= 3)) && ((_local10 <= 5)))){ _local13 = ((_local1.height - _local9) / _local6.height); _local6.y = (_local6.y * _local13); _local6.height = (_local6.height * _local13); _local6.height = Math.round(_local6.height); _local3.d = (_local3.d * _local13); }; _local3.ty = -(_local6.y); _local6.y = 0; _local2 = new BitmapData(_local6.width, _local6.height, true, 0); _local2.draw(this.border_mc, _local3, this.borderColorTransform, null, _local6, false); _local11 = Bitmap(this.borderCopy.getChildAt(_local7)); _local7++; _local11.bitmapData = _local2; _local11.x = _local4; _local11.y = _local5; _local4 = (_local4 + _local6.width); }; _local10++; }; }; this.borderPrevRect = _local1; }; } flvplayback_internal function layoutControl(_arg1:DisplayObject):void{ var _local4:Sprite; var _local5:Rectangle; if (_arg1 == null){ return; }; var _local2:ControlData = this.ctrlDataDict[_arg1]; if (_local2 == null){ return; }; if (_local2.avatar == null){ return; }; var _local3:Rectangle = this.calcLayoutControl(_arg1); _arg1.x = _local3.x; _arg1.y = _local3.y; _arg1.width = _local3.width; _arg1.height = _local3.height; switch (_local2.index){ case SEEK_BAR: case VOLUME_BAR: if (((!((_local2.hit_mc == null))) && ((_local2.hit_mc.parent == this.skin_mc)))){ _local4 = _local2.hit_mc; _local5 = this.calcLayoutControl(_local4); _local4.x = _local5.x; _local4.y = _local5.y; _local4.width = _local5.width; _local4.height = _local5.height; }; if (_local2.progress_mc != null){ if (isNaN(this._progressPercent)){ this._progressPercent = (this._vc.isRTMP) ? 100 : 0; }; this.positionBar(Sprite(_arg1), "progress", this._progressPercent); }; this.positionHandle(Sprite(_arg1)); break; case BUFFERING_BAR: this.positionMaskedFill(_arg1, 100); break; }; } flvplayback_internal function calcLayoutControl(_arg1:DisplayObject):Rectangle{ var ctrl = _arg1; var rect:Rectangle = new Rectangle(); if (ctrl == null){ return (rect); }; var ctrlData:ControlData = this.ctrlDataDict[ctrl]; if (ctrlData == null){ return (rect); }; if (ctrlData.avatar == null){ return (rect); }; var anchorRight:Boolean; var anchorLeft:Boolean; var anchorTop:Boolean; var anchorBottom:Boolean; try { anchorRight = ctrlData.avatar["anchorRight"]; } catch(re1:ReferenceError) { anchorRight = false; }; try { anchorLeft = ctrlData.avatar["anchorLeft"]; } catch(re1:ReferenceError) { anchorLeft = true; }; try { anchorTop = ctrlData.avatar["anchorTop"]; } catch(re1:ReferenceError) { anchorTop = false; }; try { anchorBottom = ctrlData.avatar["anchorBottom"]; } catch(re1:ReferenceError) { anchorBottom = true; }; if (anchorRight){ if (anchorLeft){ rect.x = ((ctrlData.avatar.x - this.placeholderLeft) + this.videoLeft); rect.width = ((((ctrlData.avatar.x + ctrlData.avatar.width) - this.placeholderRight) + this.videoRight) - rect.x); ctrlData.origWidth = NaN; } else { rect.x = ((ctrlData.avatar.x - this.placeholderRight) + this.videoRight); rect.width = ctrl.width; }; } else { rect.x = ((ctrlData.avatar.x - this.placeholderLeft) + this.videoLeft); rect.width = ctrl.width; }; if (anchorTop){ if (anchorBottom){ rect.y = ((ctrlData.avatar.y - this.placeholderTop) + this.videoTop); rect.height = ((((ctrlData.avatar.y + ctrlData.avatar.height) - this.placeholderBottom) + this.videoBottom) - rect.y); ctrlData.origHeight = NaN; } else { rect.y = ((ctrlData.avatar.y - this.placeholderTop) + this.videoTop); rect.height = ctrl.height; }; } else { rect.y = ((ctrlData.avatar.y - this.placeholderBottom) + this.videoBottom); rect.height = ctrl.height; }; try { if ((ctrl["layoutSelf"] is Function)){ rect = ctrl["layoutSelf"](rect); }; } catch(re3:ReferenceError) { }; return (rect); } flvplayback_internal function removeSkin():void{ var i:int; if (this.skinLoader != null){ try { this.skinLoader.close(); } catch(e1:Error) { }; this.skinLoader = null; }; if (this.skin_mc != null){ i = 0; while (i < NUM_CONTROLS) { if (this.controls[i] == undefined){ } else { if (i < NUM_BUTTONS){ this.removeButtonListeners(this.controls[i]); }; delete this.ctrlDataDict[this.controls[i]]; delete this.controls[i]; }; i = (i + 1); }; try { this.skin_mc.parent.removeChild(this.skin_mc); } catch(e2:Error) { }; this.skin_mc = null; }; this.skinTemplate = null; this.layout_mc = null; this.border_mc = null; this.borderCopy = null; this.borderPrevRect = null; this.borderScale9Rects = null; } flvplayback_internal function setCustomClip(_arg1:DisplayObject):void{ var scale9Grid:Rectangle; var diff:Number; var numBorderBitmaps:int; var i:int; var lastXDim:Number; var floorLastXDim:Number; var lastYDim:Number; var floorLastYDim:Number; var newRect:Rectangle; var dispObj = _arg1; var dCopy:DisplayObject = new (dispObj["constructor"]); this.skin_mc.addChild(dCopy); var ctrlData:ControlData = new ControlData(this, dCopy, null, -1); this.ctrlDataDict[dCopy] = ctrlData; ctrlData.avatar = dispObj; this.customClips.push(dCopy); dCopy.accessibilityProperties = new AccessibilityProperties(); dCopy.accessibilityProperties.silent = true; if (dispObj.name == "border_mc"){ this.border_mc = dCopy; try { this.borderCopy = (ctrlData.avatar["colorMe"]) ? new Sprite() : null; } catch(re:ReferenceError) { borderCopy = null; }; if (this.borderCopy != null){ this.border_mc.visible = false; scale9Grid = this.border_mc.scale9Grid; scale9Grid.x = Math.round(scale9Grid.x); scale9Grid.y = Math.round(scale9Grid.y); scale9Grid.width = Math.round(scale9Grid.width); diff = ((scale9Grid.x + scale9Grid.width) - this.border_mc.scale9Grid.right); if (diff > 0.5){ scale9Grid.width--; } else { if (diff < -0.5){ scale9Grid.width++; }; }; scale9Grid.height = Math.round(scale9Grid.height); diff = ((scale9Grid.y + scale9Grid.height) - this.border_mc.scale9Grid.bottom); if (diff > 0.5){ scale9Grid.height--; } else { if (diff < -0.5){ scale9Grid.height++; }; }; if (scale9Grid != null){ this.borderScale9Rects = new Array(); lastXDim = (this.border_mc.width - (scale9Grid.x + scale9Grid.width)); floorLastXDim = Math.floor(lastXDim); if ((lastXDim - floorLastXDim) < 0.05){ lastXDim = floorLastXDim; } else { lastXDim = (floorLastXDim + 1); }; lastYDim = (this.border_mc.height - (scale9Grid.y + scale9Grid.height)); floorLastYDim = Math.floor(lastYDim); if ((lastYDim - floorLastYDim) < 0.05){ lastYDim = floorLastYDim; } else { lastYDim = (floorLastYDim + 1); }; newRect = new Rectangle(0, 0, scale9Grid.x, scale9Grid.y); this.borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle(scale9Grid.x, 0, scale9Grid.width, scale9Grid.y); this.borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle((scale9Grid.x + scale9Grid.width), 0, lastXDim, scale9Grid.y); this.borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle(0, scale9Grid.y, scale9Grid.x, scale9Grid.height); this.borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle(scale9Grid.x, scale9Grid.y, scale9Grid.width, scale9Grid.height); this.borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle((scale9Grid.x + scale9Grid.width), scale9Grid.y, lastXDim, scale9Grid.height); this.borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle(0, (scale9Grid.y + scale9Grid.height), scale9Grid.x, lastYDim); this.borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle(scale9Grid.x, (scale9Grid.y + scale9Grid.height), scale9Grid.width, lastYDim); this.borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); newRect = new Rectangle((scale9Grid.x + scale9Grid.width), (scale9Grid.y + scale9Grid.height), lastXDim, lastYDim); this.borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect); i = 0; while (i < this.borderScale9Rects.length) { if (this.borderScale9Rects[i] != null){ break; }; i = (i + 1); }; if (i >= this.borderScale9Rects.length){ this.borderScale9Rects = null; }; }; numBorderBitmaps = ((this.borderScale9Rects)==null) ? 1 : 9; i = 0; while (i < numBorderBitmaps) { if ((((this.borderScale9Rects == null)) || (!((this.borderScale9Rects[i] == null))))){ this.borderCopy.addChild(new Bitmap()); }; i = (i + 1); }; this.borderCopy.accessibilityProperties = new AccessibilityProperties(); this.borderCopy.accessibilityProperties.silent = true; this.skin_mc.addChild(this.borderCopy); this.borderPrevRect = null; }; }; } flvplayback_internal function setSkin(_arg1:int, _arg2:DisplayObject):void{ var _local3:Sprite; var _local4:ControlData; var _local5:String; if (_arg1 >= NUM_CONTROLS){ return; }; if (_arg1 < NUM_BUTTONS){ _local3 = this.setupButtonSkin(_arg1, _arg2); this.skin_mc.addChild(_local3); _local4 = this.ctrlDataDict[_local3]; } else { switch (_arg1){ case PLAY_PAUSE_BUTTON: _local3 = this.setTwoButtonHolderSkin(_arg1, PLAY_BUTTON, "play_mc", PAUSE_BUTTON, "pause_mc", _arg2); _local4 = this.ctrlDataDict[_local3]; break; case FULL_SCREEN_BUTTON: _local3 = this.setTwoButtonHolderSkin(_arg1, FULL_SCREEN_ON_BUTTON, "on_mc", FULL_SCREEN_OFF_BUTTON, "off_mc", _arg2); _local4 = this.ctrlDataDict[_local3]; break; case MUTE_BUTTON: _local3 = this.setTwoButtonHolderSkin(_arg1, MUTE_ON_BUTTON, "on_mc", MUTE_OFF_BUTTON, "off_mc", _arg2); _local4 = this.ctrlDataDict[_local3]; break; case SEEK_BAR: case VOLUME_BAR: _local5 = skinClassPrefixes[_arg1]; _local3 = Sprite(this.createSkin(this.skinTemplate, _local5)); if (_local3 != null){ this.skin_mc.addChild(_local3); _local4 = new ControlData(this, _local3, null, _arg1); this.ctrlDataDict[_local3] = _local4; _local4.progress_mc = this.setupBarSkinPart(_local3, _arg2, this.skinTemplate, (_local5 + "Progress"), "progress_mc"); _local4.fullness_mc = this.setupBarSkinPart(_local3, _arg2, this.skinTemplate, (_local5 + "Fullness"), "fullness_mc"); _local4.hit_mc = Sprite(this.setupBarSkinPart(_local3, _arg2, this.skinTemplate, (_local5 + "Hit"), "hit_mc")); _local4.handle_mc = Sprite(this.setupBarSkinPart(_local3, _arg2, this.skinTemplate, (_local5 + "Handle"), "handle_mc", true)); _local3.width = _arg2.width; _local3.height = _arg2.height; _local3.accessibilityProperties = new AccessibilityProperties(); _local3.accessibilityProperties.silent = true; }; break; case BUFFERING_BAR: _local5 = skinClassPrefixes[_arg1]; _local3 = Sprite(this.createSkin(this.skinTemplate, _local5)); if (_local3 != null){ this.skin_mc.addChild(_local3); _local4 = new ControlData(this, _local3, null, _arg1); this.ctrlDataDict[_local3] = _local4; _local4.fill_mc = this.setupBarSkinPart(_local3, _arg2, this.skinTemplate, (_local5 + "Fill"), "fill_mc"); _local3.width = _arg2.width; _local3.height = _arg2.height; _local4.fill_mc.accessibilityProperties = new AccessibilityProperties(); _local4.fill_mc.accessibilityProperties.silent = true; _local3.accessibilityProperties = new AccessibilityProperties(); _local3.accessibilityProperties.silent = true; }; break; }; }; _local4.avatar = _arg2; this.ctrlDataDict[_local3] = _local4; this.delayedControls[_arg1] = _local3; } flvplayback_internal function setTwoButtonHolderSkin(_arg1:int, _arg2:int, _arg3:String, _arg4:int, _arg5:String, _arg6:DisplayObject):Sprite{ var _local7:Sprite; var _local8:Sprite; var _local9:ControlData; _local8 = new Sprite(); _local9 = new ControlData(this, _local8, null, _arg1); this.ctrlDataDict[_local8] = _local9; this.skin_mc.addChild(_local8); _local7 = this.setupButtonSkin(_arg2, _arg6); _local7.name = _arg3; _local7.visible = true; _local8.addChild(_local7); _local7 = this.setupButtonSkin(_arg4, _arg6); _local7.name = _arg5; _local7.visible = false; _local8.addChild(_local7); return (_local8); } flvplayback_internal function setupButtonSkin(_arg1:int, _arg2:DisplayObject):Sprite{ var _local3:String = skinClassPrefixes[_arg1]; if (_local3 == null){ return (null); }; var _local4:Sprite = new Sprite(); var _local5:ControlData = new ControlData(this, _local4, null, _arg1); this.ctrlDataDict[_local4] = _local5; _local5.state_mc = new Array(); _local5.state_mc[NORMAL_STATE] = this.setupButtonSkinState(_local4, this.skinTemplate, (_local3 + "NormalState")); _local5.state_mc[NORMAL_STATE].visible = true; _local5.state_mc[OVER_STATE] = this.setupButtonSkinState(_local4, this.skinTemplate, (_local3 + "OverState"), _local5.state_mc[NORMAL_STATE]); _local5.state_mc[DOWN_STATE] = this.setupButtonSkinState(_local4, this.skinTemplate, (_local3 + "DownState"), _local5.state_mc[NORMAL_STATE]); _local5.disabled_mc = this.setupButtonSkinState(_local4, this.skinTemplate, (_local3 + "DisabledState"), _local5.state_mc[NORMAL_STATE]); if ((_arg2 is InteractiveObject)){ _local4.tabIndex = InteractiveObject(_arg2).tabIndex; }; return (_local4); } flvplayback_internal function setupButtonSkinState(_arg1:Sprite, _arg2:Sprite, _arg3:String, _arg4:DisplayObject=null):DisplayObject{ var stateSkin:DisplayObject; var ctrl = _arg1; var definitionHolder = _arg2; var skinName = _arg3; var defaultSkin = _arg4; try { stateSkin = this.createSkin(definitionHolder, skinName); } catch(ve:VideoError) { if (defaultSkin != null){ stateSkin = null; } else { throw (ve); }; }; if (stateSkin != null){ stateSkin.visible = false; ctrl.addChild(stateSkin); } else { if (defaultSkin != null){ stateSkin = defaultSkin; }; }; return (stateSkin); } flvplayback_internal function setupBarSkinPart(_arg1:Sprite, _arg2:DisplayObject, _arg3:Sprite, _arg4:String, _arg5:String, _arg6:Boolean=false):DisplayObject{ var part:DisplayObject; var partAvatar:DisplayObject; var ctrlData:ControlData; var partData:ControlData; var ctrl = _arg1; var avatar = _arg2; var definitionHolder = _arg3; var skinName = _arg4; var partName = _arg5; var required = _arg6; try { part = ctrl[partName]; } catch(re:ReferenceError) { part = null; }; if (part == null){ try { part = this.createSkin(definitionHolder, skinName); } catch(ve:VideoError) { if (required){ throw (ve); }; }; if (part != null){ this.skin_mc.addChild(part); part.x = ctrl.x; part.y = ctrl.y; partAvatar = this.layout_mc.getChildByName((skinName + "_mc")); if (partAvatar != null){ if (partName == "hit_mc"){ ctrlData = this.ctrlDataDict[ctrl]; partData = new ControlData(this, part, this.controls[ctrlData.index], -1); partData.avatar = partAvatar; this.ctrlDataDict[part] = partData; } else { part.x = (part.x + (partAvatar.x - avatar.x)); part.y = (part.y + (partAvatar.y - avatar.y)); part.width = partAvatar.width; part.height = partAvatar.height; }; if ((((part is InteractiveObject)) && ((partAvatar is InteractiveObject)))){ InteractiveObject(part).tabIndex = InteractiveObject(partAvatar).tabIndex; }; }; }; }; if (((required) && ((part == null)))){ throw (new VideoError(VideoError.MISSING_SKIN_STYLE, skinName)); }; if (part != null){ part.accessibilityProperties = new AccessibilityProperties(); part.accessibilityProperties.silent = true; }; return (part); } flvplayback_internal function createSkin(_arg1:DisplayObject, _arg2:String):DisplayObject{ var stateSkinDesc:*; var theClass:Class; var definitionHolder = _arg1; var skinName = _arg2; try { stateSkinDesc = definitionHolder[skinName]; if ((stateSkinDesc is String)){ try { theClass = Class(definitionHolder.loaderInfo.applicationDomain.getDefinition(stateSkinDesc)); } catch(err1:Error) { theClass = Class(getDefinitionByName(stateSkinDesc)); }; return (DisplayObject(new (theClass))); } else { if ((stateSkinDesc is Class)){ return (new (stateSkinDesc)); } else { if ((stateSkinDesc is DisplayObject)){ return (stateSkinDesc); }; }; }; } catch(err2:Error) { throw (new VideoError(VideoError.MISSING_SKIN_STYLE, skinName)); }; return (null); } flvplayback_internal function skinButtonControl(_arg1:Object):void{ var ctrl:Sprite; var e:Event; var ctrlOrEvent = _arg1; if (ctrlOrEvent == null){ return; }; if ((ctrlOrEvent is Event)){ e = Event(ctrlOrEvent); ctrl = Sprite(e.currentTarget); ctrl.removeEventListener(Event.ENTER_FRAME, this.skinButtonControl); } else { ctrl = Sprite(ctrlOrEvent); }; var ctrlData:ControlData = this.ctrlDataDict[ctrl]; if (ctrlData == null){ return; }; try { if (ctrl["placeholder_mc"] != undefined){ ctrl.removeChild(ctrl["placeholder_mc"]); ctrl["placeholder_mc"] = null; }; } catch(re:ReferenceError) { }; if (ctrlData.state_mc == null){ ctrlData.state_mc = new Array(); }; if (ctrlData.state_mc[NORMAL_STATE] == undefined){ ctrlData.state_mc[NORMAL_STATE] = this.setupButtonSkinState(ctrl, ctrl, buttonSkinLinkageIDs[NORMAL_STATE], null); }; if (((ctrlData.enabled) && (this._controlsEnabled))){ if (ctrlData.state_mc[ctrlData.state] == undefined){ ctrlData.state_mc[ctrlData.state] = this.setupButtonSkinState(ctrl, ctrl, buttonSkinLinkageIDs[ctrlData.state], ctrlData.state_mc[NORMAL_STATE]); }; if (ctrlData.state_mc[ctrlData.state] != ctrlData.currentState_mc){ if (ctrlData.currentState_mc != null){ ctrlData.currentState_mc.visible = false; }; ctrlData.currentState_mc = ctrlData.state_mc[ctrlData.state]; ctrlData.currentState_mc.visible = true; }; this.applySkinState(ctrlData, ctrlData.state_mc[ctrlData.state]); } else { ctrlData.state = NORMAL_STATE; if (ctrlData.disabled_mc == null){ ctrlData.disabled_mc = this.setupButtonSkinState(ctrl, ctrl, "disabledLinkageID", ctrlData.state_mc[NORMAL_STATE]); }; this.applySkinState(ctrlData, ctrlData.disabled_mc); }; } flvplayback_internal function applySkinState(_arg1:ControlData, _arg2:DisplayObject):void{ if (_arg2 != _arg1.currentState_mc){ if (_arg1.currentState_mc != null){ _arg1.currentState_mc.visible = false; }; _arg1.currentState_mc = _arg2; _arg1.currentState_mc.visible = true; }; } flvplayback_internal function addBarControl(_arg1:Sprite):void{ var _local2:ControlData = this.ctrlDataDict[_arg1]; _local2.isDragging = false; _local2.percentage = 0; if ((((_arg1.parent == this.skin_mc)) && (!((this.skin_mc == null))))){ this.finishAddBarControl(_arg1); } else { _arg1.addEventListener(Event.REMOVED_FROM_STAGE, this.cleanupHandle); _arg1.addEventListener(Event.ENTER_FRAME, this.finishAddBarControl); }; } flvplayback_internal function finishAddBarControl(_arg1:Object):void{ var ctrl:Sprite; var e:Event; var ctrlOrEvent = _arg1; if (ctrlOrEvent == null){ return; }; if ((ctrlOrEvent is Event)){ e = Event(ctrlOrEvent); ctrl = Sprite(e.currentTarget); ctrl.removeEventListener(Event.ENTER_FRAME, this.finishAddBarControl); } else { ctrl = Sprite(ctrlOrEvent); }; var ctrlData:ControlData = this.ctrlDataDict[ctrl]; try { if ((ctrl["addBarControl"] is Function)){ var _local3 = ctrl; _local3["addBarControl"](); }; } catch(re:ReferenceError) { }; ctrlData.origWidth = ctrl.width; ctrlData.origHeight = ctrl.height; this.fixUpBar(ctrl, "progress", ctrl, "progress_mc"); this.calcBarMargins(ctrl, "progress", false); if (ctrlData.progress_mc != null){ this.fixUpBar(ctrl, "progressBarFill", ctrlData.progress_mc, "fill_mc"); this.calcBarMargins(ctrlData.progress_mc, "fill", false); this.calcBarMargins(ctrlData.progress_mc, "mask", false); if (isNaN(this._progressPercent)){ this._progressPercent = (this._vc.isRTMP) ? 100 : 0; }; this.positionBar(ctrl, "progress", this._progressPercent); }; this.fixUpBar(ctrl, "fullness", ctrl, "fullness_mc"); this.calcBarMargins(ctrl, "fullness", false); if (ctrlData.fullness_mc != null){ this.fixUpBar(ctrl, "fullnessBarFill", ctrlData.fullness_mc, "fill_mc"); this.calcBarMargins(ctrlData.fullness_mc, "fill", false); this.calcBarMargins(ctrlData.fullness_mc, "mask", false); }; this.fixUpBar(ctrl, "hit", ctrl, "hit_mc"); this.fixUpBar(ctrl, "handle", ctrl, "handle_mc"); this.calcBarMargins(ctrl, "handle", true); switch (ctrlData.index){ case SEEK_BAR: this.setControl(SEEK_BAR_HANDLE, ctrlData.handle_mc); if (ctrlData.hit_mc != null){ this.setControl(SEEK_BAR_HIT, ctrlData.hit_mc); }; break; case VOLUME_BAR: this.setControl(VOLUME_BAR_HANDLE, ctrlData.handle_mc); if (ctrlData.hit_mc != null){ this.setControl(VOLUME_BAR_HIT, ctrlData.hit_mc); }; break; }; this.positionHandle(ctrl); ctrl.accessibilityProperties = new AccessibilityProperties(); ctrl.accessibilityProperties.silent = true; } flvplayback_internal function cleanupHandle(_arg1:Object):void{ var e:Event; var ctrl:Sprite; var ctrlData:ControlData; var ctrlOrEvent = _arg1; try { if ((ctrlOrEvent is Event)){ e = Event(ctrlOrEvent); }; ctrl = ((e == null)) ? Sprite(ctrlOrEvent) : Sprite(e.currentTarget); ctrlData = this.ctrlDataDict[ctrl]; if ((((ctrlData == null)) || ((e == null)))){ ctrl.removeEventListener(Event.REMOVED_FROM_STAGE, this.cleanupHandle, false); if (ctrlData == null){ return; }; }; ctrl.removeEventListener(Event.ENTER_FRAME, this.finishAddBarControl); if (ctrlData.handle_mc != null){ if (ctrlData.handle_mc.parent != null){ ctrlData.handle_mc.parent.removeChild(ctrlData.handle_mc); }; delete this.ctrlDataDict[ctrlData.handle_mc]; ctrlData.handle_mc = null; }; if (ctrlData.hit_mc != null){ if (ctrlData.hit_mc.parent != null){ ctrlData.hit_mc.parent.removeChild(ctrlData.hit_mc); }; delete this.ctrlDataDict[ctrlData.hit_mc]; ctrlData.hit_mc = null; }; } catch(err:Error) { }; } flvplayback_internal function fixUpBar(_arg1:DisplayObject, _arg2:String, _arg3:DisplayObject, _arg4:String):void{ var bar:DisplayObject; var definitionHolder = _arg1; var propPrefix = _arg2; var ctrl = _arg3; var name = _arg4; var ctrlData:ControlData = this.ctrlDataDict[ctrl]; if (ctrlData[name] != null){ return; }; try { bar = ctrl[name]; } catch(re:ReferenceError) { bar = null; }; if (bar == null){ try { bar = this.createSkin(definitionHolder, (propPrefix + "LinkageID")); } catch(ve:VideoError) { bar = null; }; if (bar == null){ return; }; if (ctrl.parent != null){ if (getBooleanPropSafe(ctrl, (propPrefix + "Below"))){ ctrl.parent.addChildAt(bar, ctrl.parent.getChildIndex(ctrl)); } else { ctrl.parent.addChild(bar); }; }; }; ctrlData[name] = bar; var barData:ControlData = this.ctrlDataDict[bar]; if (barData == null){ barData = new ControlData(this, bar, ctrl, -1); this.ctrlDataDict[bar] = barData; }; } flvplayback_internal function calcBarMargins(_arg1:DisplayObject, _arg2:String, _arg3:Boolean):void{ var ctrl = _arg1; var type = _arg2; var symmetricMargins = _arg3; if (ctrl == null){ return; }; var ctrlData:ControlData = this.ctrlDataDict[ctrl]; var bar:DisplayObject = ctrlData[(type + "_mc")]; if (bar == null){ try { bar = ctrl[(type + "_mc")]; } catch(re:ReferenceError) { bar = null; }; if (bar == null){ return; }; ctrlData[(type + "_mc")] = bar; }; var barData:ControlData = this.ctrlDataDict[bar]; if (barData == null){ barData = new ControlData(this, bar, ctrl, -1); this.ctrlDataDict[bar] = barData; }; barData.leftMargin = getNumberPropSafe(ctrl, (type + "LeftMargin")); if (((isNaN(barData.leftMargin)) && ((bar.parent == ctrl.parent)))){ barData.leftMargin = (bar.x - ctrl.x); }; barData.rightMargin = getNumberPropSafe(ctrl, (type + "RightMargin")); if (isNaN(barData.rightMargin)){ if (symmetricMargins){ barData.rightMargin = barData.leftMargin; } else { if (bar.parent == ctrl.parent){ barData.rightMargin = (((ctrl.width - bar.width) - bar.x) + ctrl.x); }; }; }; barData.topMargin = getNumberPropSafe(ctrl, (type + "TopMargin")); if (((isNaN(barData.topMargin)) && ((bar.parent == ctrl.parent)))){ barData.topMargin = (bar.y - ctrl.y); }; barData.bottomMargin = getNumberPropSafe(ctrl, (type + "BottomMargin")); if (isNaN(barData.bottomMargin)){ if (symmetricMargins){ barData.bottomMargin = barData.topMargin; } else { if (bar.parent == ctrl.parent){ barData.bottomMargin = (((ctrl.height - bar.height) - bar.y) + ctrl.y); }; }; }; barData.origX = getNumberPropSafe(ctrl, (type + "X")); if (isNaN(barData.origX)){ if (bar.parent == ctrl.parent){ barData.origX = (bar.x - ctrl.x); } else { if (bar.parent == ctrl){ barData.origX = bar.x; }; }; }; barData.origY = getNumberPropSafe(ctrl, (type + "Y")); if (isNaN(barData.origY)){ if (bar.parent == ctrl.parent){ barData.origY = (bar.y - ctrl.y); } else { if (bar.parent == ctrl){ barData.origY = bar.y; }; }; }; barData.origWidth = bar.width; barData.origHeight = bar.height; barData.origScaleX = bar.scaleX; barData.origScaleY = bar.scaleY; } flvplayback_internal function finishAddBufferingBar(_arg1:Event=null):void{ if (_arg1 != null){ _arg1.currentTarget.removeEventListener(Event.ENTER_FRAME, this.finishAddBufferingBar); }; var _local2:Sprite = this.controls[BUFFERING_BAR]; this.calcBarMargins(_local2, "fill", true); this.fixUpBar(_local2, "fill", _local2, "fill_mc"); this.positionMaskedFill(_local2, 100); } flvplayback_internal function positionMaskedFill(_arg1:DisplayObject, _arg2:Number):void{ var ctrlData:ControlData; var slideReveal:Boolean; var maskSprite:Sprite; var barData:ControlData; var ctrl = _arg1; var percent = _arg2; if (ctrl == null){ return; }; ctrlData = this.ctrlDataDict[ctrl]; var fill:DisplayObject = ctrlData.fill_mc; if (fill == null){ return; }; var mask:DisplayObject = ctrlData.mask_mc; if (ctrlData.mask_mc == null){ try { var _local4 = ctrl["mask_mc"]; mask = _local4; ctrlData.mask_mc = _local4; } catch(re:ReferenceError) { ctrlData.mask_mc = null; }; if (ctrlData.mask_mc == null){ maskSprite = new Sprite(); _local4 = maskSprite; mask = _local4; ctrlData.mask_mc = _local4; maskSprite.graphics.beginFill(0xFFFFFF); maskSprite.graphics.drawRect(0, 0, 1, 1); maskSprite.graphics.endFill(); barData = this.ctrlDataDict[fill]; maskSprite.x = barData.origX; maskSprite.y = barData.origY; maskSprite.width = barData.origWidth; maskSprite.height = barData.origHeight; maskSprite.visible = false; fill.parent.addChild(maskSprite); fill.mask = maskSprite; }; if (ctrlData.mask_mc != null){ this.calcBarMargins(ctrl, "mask", true); }; }; var fillData:ControlData = this.ctrlDataDict[fill]; var maskData:ControlData = this.ctrlDataDict[mask]; try { slideReveal = fill["slideReveal"]; } catch(re:ReferenceError) { slideReveal = false; }; if (fill.parent == ctrl){ if (slideReveal){ fill.x = ((maskData.origX - fillData.origWidth) + ((fillData.origWidth * percent) / 100)); } else { mask.width = ((fillData.origWidth * percent) / 100); }; } else { if (fill.parent == ctrl.parent){ if (slideReveal){ mask.x = (ctrl.x + maskData.leftMargin); mask.y = (ctrl.y + maskData.topMargin); mask.width = ((ctrl.width - maskData.rightMargin) - maskData.leftMargin); mask.height = ((ctrl.height - maskData.topMargin) - maskData.bottomMargin); fill.x = ((mask.x - fillData.origWidth) + ((maskData.origWidth * percent) / 100)); fill.y = (ctrl.y + fillData.topMargin); } else { fill.x = (ctrl.x + fillData.leftMargin); fill.y = (ctrl.y + fillData.topMargin); mask.x = fill.x; mask.y = fill.y; mask.width = ((((ctrl.width - fillData.rightMargin) - fillData.leftMargin) * percent) / 100); mask.height = ((ctrl.height - fillData.topMargin) - fillData.bottomMargin); }; }; }; } flvplayback_internal function startHandleDrag(_arg1:Sprite):void{ var ctrl = _arg1; if (ctrl == null){ return; }; var ctrlData:ControlData = this.ctrlDataDict[ctrl]; try { if ((((ctrl["startHandleDrag"] is Function)) && (ctrl["startHandleDrag"]()))){ ctrlData.isDragging = true; return; }; } catch(re:ReferenceError) { }; var handle:Sprite = ctrlData.handle_mc; if (handle == null){ return; }; var handleData:ControlData = this.ctrlDataDict[handle]; var theY:Number = (ctrl.y + handleData.origY); var theWidth:Number = (isNaN(ctrlData.origWidth)) ? ctrl.width : ctrlData.origWidth; var bounds:Rectangle = new Rectangle((ctrl.x + handleData.leftMargin), theY, (theWidth - handleData.rightMargin), 0); handle.startDrag(false, bounds); ctrlData.isDragging = true; handle.focusRect = false; handle.stage.focus = handle; } flvplayback_internal function stopHandleDrag(_arg1:Sprite):void{ var ctrl = _arg1; if (ctrl == null){ return; }; var ctrlData:ControlData = this.ctrlDataDict[ctrl]; try { if ((((ctrl["stopHandleDrag"] is Function)) && (ctrl["stopHandleDrag"]()))){ ctrlData.isDragging = false; return; }; } catch(re:ReferenceError) { }; var handle:Sprite = ctrlData.handle_mc; if (handle == null){ return; }; handle.stopDrag(); ctrlData.isDragging = false; handle.stage.focus = handle; } flvplayback_internal function positionHandle(_arg1:Sprite):void{ if (_arg1 == null){ return; }; if ((((_arg1["positionHandle"] is Function)) && (_arg1["positionHandle"]()))){ return; }; var _local2:ControlData = this.ctrlDataDict[_arg1]; var _local3:Sprite = _local2.handle_mc; if (_local3 == null){ return; }; var _local4:ControlData = this.ctrlDataDict[_local3]; var _local5:Number = (isNaN(_local2.origWidth)) ? _arg1.width : _local2.origWidth; var _local6:Number = ((_local5 - _local4.rightMargin) - _local4.leftMargin); _local3.x = ((_arg1.x + _local4.leftMargin) + ((_local6 * _local2.percentage) / 100)); _local3.y = (_arg1.y + _local4.origY); if (_local2.fullness_mc != null){ this.positionBar(_arg1, "fullness", _local2.percentage); }; } flvplayback_internal function positionBar(_arg1:Sprite, _arg2:String, _arg3:Number):void{ var ctrl = _arg1; var type = _arg2; var percent = _arg3; try { if ((((ctrl["positionBar"] is Function)) && (ctrl["positionBar"](type, percent)))){ return; }; } catch(re2:ReferenceError) { }; var ctrlData:ControlData = this.ctrlDataDict[ctrl]; var bar:DisplayObject = ctrlData[(type + "_mc")]; if (bar == null){ return; }; var barData:ControlData = this.ctrlDataDict[bar]; if (bar.parent == ctrl){ if (barData.fill_mc == null){ bar.scaleX = ((barData.origScaleX * percent) / 100); } else { this.positionMaskedFill(bar, percent); }; } else { bar.x = (ctrl.x + barData.leftMargin); bar.y = (ctrl.y + barData.origY); if (barData.fill_mc == null){ bar.width = ((((ctrl.width - barData.leftMargin) - barData.rightMargin) * percent) / 100); } else { this.positionMaskedFill(bar, percent); }; }; } flvplayback_internal function calcPercentageFromHandle(_arg1:Sprite):void{ if (_arg1 == null){ return; }; var _local2:ControlData = this.ctrlDataDict[_arg1]; if ((((_arg1["calcPercentageFromHandle"] is Function)) && (_arg1["calcPercentageFromHandle"]()))){ if (_local2.percentage < 0){ _local2.percentage = 0; }; if (_local2.percentage > 100){ _local2.percentage = 100; }; return; }; var _local3:Sprite = _local2.handle_mc; if (_local3 == null){ return; }; var _local4:ControlData = this.ctrlDataDict[_local3]; var _local5:Number = (isNaN(_local2.origWidth)) ? _arg1.width : _local2.origWidth; var _local6:Number = ((_local5 - _local4.rightMargin) - _local4.leftMargin); var _local7:Number = (_local3.x - (_arg1.x + _local4.leftMargin)); _local2.percentage = ((_local7 / _local6) * 100); if (_local2.percentage < 0){ _local2.percentage = 0; }; if (_local2.percentage > 100){ _local2.percentage = 100; }; if (_local2.fullness_mc != null){ this.positionBar(_arg1, "fullness", _local2.percentage); }; } flvplayback_internal function handleRelease(_arg1:int):void{ var _local2:int = this._vc.activeVideoPlayerIndex; this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex; if (_arg1 == SEEK_BAR){ this.seekBarListener(null); } else { if (_arg1 == VOLUME_BAR){ this.volumeBarListener(null); }; }; this.stopHandleDrag(this.controls[_arg1]); this._vc.activeVideoPlayerIndex = _local2; if (_arg1 == SEEK_BAR){ this._vc._scrubFinish(); }; } flvplayback_internal function seekBarListener(_arg1:TimerEvent):void{ var _local2:int = this._vc.activeVideoPlayerIndex; this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex; var _local3:Sprite = this.controls[SEEK_BAR]; if (_local3 == null){ return; }; var _local4:ControlData = this.ctrlDataDict[_local3]; this.calcPercentageFromHandle(_local3); var _local5:Number = _local4.percentage; if (_arg1 == null){ this._seekBarTimer.stop(); if (_local5 != this._lastScrubPos){ this._vc.seekPercent(_local5); }; this._vc.addEventListener(VideoEvent.PLAYHEAD_UPDATE, this.handleIVPEvent); if (this._playAfterScrub){ this._vc.play(); }; } else { if (this._vc.getVideoPlayer(this._vc.visibleVideoPlayerIndex).state == VideoState.SEEKING){ } else { if ((((((((this._seekBarScrubTolerance <= 0)) || ((Math.abs((_local5 - this._lastScrubPos)) > this._seekBarScrubTolerance)))) || ((_local5 < this._seekBarScrubTolerance)))) || ((_local5 > (100 - this._seekBarScrubTolerance))))){ if (_local5 != this._lastScrubPos){ this._lastScrubPos = _local5; this._vc.seekPercent(_local5); }; }; }; }; this._vc.activeVideoPlayerIndex = _local2; } flvplayback_internal function volumeBarListener(_arg1:TimerEvent):void{ var _local2:Sprite = this.controls[VOLUME_BAR]; if (_local2 == null){ return; }; var _local3:ControlData = this.ctrlDataDict[_local2]; this.calcPercentageFromHandle(_local2); var _local4:Number = _local3.percentage; var _local5 = (_arg1 == null); if (_local5){ this._volumeBarTimer.stop(); this._vc.addEventListener(SoundEvent.SOUND_UPDATE, this.handleSoundEvent); }; if (((((((((_local5) || ((this._volumeBarScrubTolerance <= 0)))) || ((Math.abs((_local4 - this._lastVolumePos)) > this._volumeBarScrubTolerance)))) || ((_local4 < this._volumeBarScrubTolerance)))) || ((_local4 > (100 - this._volumeBarScrubTolerance))))){ if (_local4 != this._lastVolumePos){ if (this._isMuted){ this.cachedSoundLevel = (_local4 / 100); } else { this._vc.volume = (_local4 / 100); }; this._lastVolumePos = _local4; }; }; } flvplayback_internal function doBufferingDelay(_arg1:TimerEvent):void{ this._bufferingDelayTimer.reset(); var _local2:int = this._vc.activeVideoPlayerIndex; this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex; if (this._vc.state == VideoState.BUFFERING){ this._bufferingOn = true; this.handleIVPEvent(new VideoEvent(VideoEvent.STATE_CHANGE, false, false, VideoState.BUFFERING, NaN, this._vc.visibleVideoPlayerIndex)); }; this._vc.activeVideoPlayerIndex = _local2; } flvplayback_internal function dispatchMessage(_arg1:int):void{ var ctrl:Sprite; var ctrlData:ControlData; var handle:Sprite; var index = _arg1; if ((((index == SEEK_BAR_HANDLE)) || ((index == SEEK_BAR_HIT)))){ this._vc._scrubStart(); }; var cachedActivePlayerIndex:int = this._vc.activeVideoPlayerIndex; this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex; switch (index){ case PAUSE_BUTTON: this._vc.pause(); break; case PLAY_BUTTON: this._vc.play(); break; case STOP_BUTTON: this._vc.stop(); break; case SEEK_BAR_HIT: case SEEK_BAR_HANDLE: ctrl = this.controls[SEEK_BAR]; ctrlData = this.ctrlDataDict[ctrl]; this.calcPercentageFromHandle(ctrl); this._lastScrubPos = ctrlData.percentage; if (index == SEEK_BAR_HIT){ handle = this.controls[SEEK_BAR_HANDLE]; handle.x = handle.parent.mouseX; handle.y = handle.parent.mouseY; }; this._vc.removeEventListener(VideoEvent.PLAYHEAD_UPDATE, this.handleIVPEvent); if (((this._vc.playing) || (this._vc.buffering))){ this._playAfterScrub = true; } else { if (this._vc.state != VideoState.SEEKING){ this._playAfterScrub = false; }; }; this._seekBarTimer.start(); this.startHandleDrag(ctrl); this._vc.pause(); break; case VOLUME_BAR_HIT: case VOLUME_BAR_HANDLE: ctrl = this.controls[VOLUME_BAR]; ctrlData = this.ctrlDataDict[ctrl]; this.calcPercentageFromHandle(ctrl); this._lastVolumePos = ctrlData.percentage; if (index == VOLUME_BAR_HIT){ handle = this.controls[VOLUME_BAR_HANDLE]; handle.x = handle.parent.mouseX; handle.y = handle.parent.mouseY; }; this._vc.removeEventListener(SoundEvent.SOUND_UPDATE, this.handleSoundEvent); this._volumeBarTimer.start(); this.startHandleDrag(ctrl); break; case BACK_BUTTON: this._vc.seekToPrevNavCuePoint(); break; case FORWARD_BUTTON: this._vc.seekToNextNavCuePoint(); break; case MUTE_ON_BUTTON: if (!this._isMuted){ this._isMuted = true; this.cachedSoundLevel = this._vc.volume; this._vc.volume = 0; this.setEnabledAndVisibleForState(MUTE_OFF_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[MUTE_OFF_BUTTON]); this.setEnabledAndVisibleForState(MUTE_ON_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[MUTE_ON_BUTTON]); }; break; case MUTE_OFF_BUTTON: if (this._isMuted){ this._isMuted = false; this._vc.volume = this.cachedSoundLevel; this.setEnabledAndVisibleForState(MUTE_OFF_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[MUTE_OFF_BUTTON]); this.setEnabledAndVisibleForState(MUTE_ON_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[MUTE_ON_BUTTON]); }; break; case FULL_SCREEN_ON_BUTTON: if (((!(this._fullScreen)) && (!((this._vc.stage == null))))){ this.enterFullScreenDisplayState(); this.setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[FULL_SCREEN_OFF_BUTTON]); this.setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[FULL_SCREEN_ON_BUTTON]); }; break; case FULL_SCREEN_OFF_BUTTON: if (((this._fullScreen) && (!((this._vc.stage == null))))){ try { this._vc.stage.displayState = StageDisplayState.NORMAL; } catch(se:SecurityError) { }; this.setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[FULL_SCREEN_OFF_BUTTON]); this.setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[FULL_SCREEN_ON_BUTTON]); }; break; default: throw (new Error("Unknown ButtonControl")); }; this._vc.activeVideoPlayerIndex = cachedActivePlayerIndex; } flvplayback_internal function setEnabledAndVisibleForState(_arg1:int, _arg2:String):void{ var _local6:ControlData; var _local7:Boolean; var _local8:ControlData; var _local9:ControlData; var _local10:ControlData; var _local11:ControlData; var _local3:int = this._vc.activeVideoPlayerIndex; this._vc.activeVideoPlayerIndex = this._vc.visibleVideoPlayerIndex; var _local4:String = _arg2; if ((((_local4 == VideoState.BUFFERING)) && (!(this._bufferingOn)))){ _local4 = VideoState.PLAYING; }; var _local5:Sprite = this.controls[_arg1]; if (_local5 == null){ return; }; _local6 = this.ctrlDataDict[_local5]; if (_local6 == null){ return; }; switch (_arg1){ case VOLUME_BAR: case VOLUME_BAR_HANDLE: case VOLUME_BAR_HIT: _local6.enabled = true; break; case FULL_SCREEN_ON_BUTTON: _local6.enabled = !(this._fullScreen); if (this.controls[FULL_SCREEN_BUTTON] != undefined){ _local5.visible = _local6.enabled; }; break; case FULL_SCREEN_OFF_BUTTON: _local6.enabled = this._fullScreen; if (this.controls[FULL_SCREEN_BUTTON] != undefined){ _local5.visible = _local6.enabled; }; break; case MUTE_ON_BUTTON: _local6.enabled = !(this._isMuted); if (this.controls[MUTE_BUTTON] != undefined){ _local5.visible = _local6.enabled; }; break; case MUTE_OFF_BUTTON: _local6.enabled = this._isMuted; if (this.controls[MUTE_BUTTON] != undefined){ _local5.visible = _local6.enabled; }; break; default: switch (_local4){ case VideoState.LOADING: case VideoState.CONNECTION_ERROR: _local6.enabled = false; break; case VideoState.DISCONNECTED: _local6.enabled = ((!((this._vc.source == null))) && (!((this._vc.source == "")))); break; case VideoState.SEEKING: break; default: _local6.enabled = true; break; }; break; }; switch (_arg1){ case SEEK_BAR: switch (_local4){ case VideoState.STOPPED: case VideoState.PLAYING: case VideoState.PAUSED: case VideoState.REWINDING: case VideoState.SEEKING: _local6.enabled = true; break; case VideoState.BUFFERING: _local6.enabled = ((!(this._bufferingBarHides)) || ((this.controls[BUFFERING_BAR] == undefined))); break; default: _local6.enabled = false; break; }; if (_local6.enabled){ _local6.enabled = !(isNaN(this._vc.totalTime)); }; if (_local6.handle_mc != null){ _local8 = this.ctrlDataDict[_local6.handle_mc]; _local8.enabled = _local6.enabled; _local6.handle_mc.visible = _local8.enabled; }; if (_local6.hit_mc != null){ _local9 = this.ctrlDataDict[_local6.hit_mc]; _local9.enabled = _local6.enabled; _local6.hit_mc.visible = _local9.enabled; }; _local7 = ((((((!(this._bufferingBarHides)) || (_local6.enabled))) || ((this.controls[BUFFERING_BAR] == undefined)))) || (!(this.controls[BUFFERING_BAR].visible))); _local5.visible = _local7; if (_local6.progress_mc != null){ _local6.progress_mc.visible = _local7; _local10 = this.ctrlDataDict[_local6.progress_mc]; if (_local10.fill_mc != null){ _local10.fill_mc.visible = _local7; }; }; if (_local6.fullness_mc != null){ _local6.fullness_mc.visible = _local7; _local11 = this.ctrlDataDict[_local6.fullness_mc]; if (_local11.fill_mc != null){ _local11.fill_mc.visible = _local7; }; }; break; case BUFFERING_BAR: switch (_local4){ case VideoState.STOPPED: case VideoState.PLAYING: case VideoState.PAUSED: case VideoState.REWINDING: case VideoState.SEEKING: _local6.enabled = false; break; default: _local6.enabled = true; break; }; _local5.visible = _local6.enabled; if (_local6.fill_mc != null){ _local6.fill_mc.visible = _local6.enabled; }; break; case PAUSE_BUTTON: switch (_local4){ case VideoState.DISCONNECTED: case VideoState.STOPPED: case VideoState.PAUSED: case VideoState.REWINDING: _local6.enabled = false; break; case VideoState.PLAYING: _local6.enabled = true; break; case VideoState.BUFFERING: _local6.enabled = ((!(this._bufferingBarHides)) || ((this.controls[BUFFERING_BAR] == undefined))); break; }; if (this.controls[PLAY_PAUSE_BUTTON] != undefined){ _local5.visible = _local6.enabled; }; break; case PLAY_BUTTON: switch (_local4){ case VideoState.PLAYING: _local6.enabled = false; break; case VideoState.STOPPED: case VideoState.PAUSED: _local6.enabled = true; break; case VideoState.BUFFERING: _local6.enabled = ((!(this._bufferingBarHides)) || ((this.controls[BUFFERING_BAR] == undefined))); break; }; if (this.controls[PLAY_PAUSE_BUTTON] != undefined){ _local5.visible = !(this.controls[PAUSE_BUTTON].visible); }; break; case STOP_BUTTON: switch (_local4){ case VideoState.DISCONNECTED: case VideoState.STOPPED: _local6.enabled = false; _local5.tabEnabled = false; break; case VideoState.PAUSED: case VideoState.PLAYING: case VideoState.BUFFERING: _local6.enabled = true; _local5.tabEnabled = true; break; }; break; case BACK_BUTTON: case FORWARD_BUTTON: switch (_local4){ case VideoState.BUFFERING: _local6.enabled = ((!(this._bufferingBarHides)) || ((this.controls[BUFFERING_BAR] == undefined))); _local5.tabEnabled = ((!(this._bufferingBarHides)) || ((this.controls[BUFFERING_BAR] == undefined))); break; }; }; _local5.mouseEnabled = _local6.enabled; this._vc.activeVideoPlayerIndex = _local3; } flvplayback_internal function setupSkinAutoHide(_arg1:Boolean):void{ var uiMgr:UIManager; var clickHandler:Function; var doFade = _arg1; if (((this._skinAutoHide) && (!((this.skin_mc == null))))){ if (!this.hitTarget_mc){ this.hitTarget_mc = new Sprite(); this.hitTarget_mc.accessibilityProperties = new AccessibilityProperties(); this.hitTarget_mc.accessibilityProperties.name = this.accessibilityPropertyNames[SHOW_CONTROLS_BUTTON]; this.customClips.push(this.hitTarget_mc); uiMgr = this; clickHandler = function (_arg1):void{ if (_arg1.type == FocusEvent.FOCUS_IN){ uiMgr._skinAutoHide = false; } else { if (_arg1.type == MouseEvent.CLICK){ uiMgr._skinAutoHide = !(uiMgr._skinAutoHide); }; }; uiMgr.setupSkinAutoHide(true); if (uiMgr._skinAutoHide){ _arg1.target.accessibilityProperties.name = accessibilityPropertyNames[SHOW_CONTROLS_BUTTON]; } else { _arg1.target.accessibilityProperties.name = accessibilityPropertyNames[HIDE_CONTROLS_BUTTON]; }; if (Accessibility.active){ Accessibility.updateProperties(); }; }; this.hitTarget_mc.useHandCursor = false; this.hitTarget_mc.buttonMode = true; this.hitTarget_mc.tabEnabled = true; this.hitTarget_mc.tabChildren = true; this.hitTarget_mc.focusRect = true; this.hitTarget_mc.addEventListener(FocusEvent.FOCUS_IN, clickHandler); this.hitTarget_mc.addEventListener(MouseEvent.CLICK, clickHandler); this.hitTarget_mc.accessibilityProperties.silent = this._fullScreen; this.hitTarget_mc.tabEnabled = !(this._fullScreen); if (Accessibility.active){ Accessibility.updateProperties(); }; this._vc.addChild(this.hitTarget_mc); }; this.hitTarget_mc.graphics.clear(); this.hitTarget_mc.graphics.lineStyle(0, 0xFF0000, 0); this.hitTarget_mc.graphics.drawRect(0, 0, this._vc.width, this._vc.height); this.skinAutoHideHitTest(null, doFade); this._skinAutoHideTimer.start(); } else { if (this.skin_mc != null){ if (((((((doFade) && ((this._skinFadingMaxTime > 0)))) && (((!(this.skin_mc.visible)) || ((this.skin_mc.alpha < 1)))))) && (this.__visible))){ this._skinFadingTimer.stop(); this._skinFadeStartTime = getTimer(); this._skinFadingIn = true; if (this.skin_mc.alpha == 1){ this.skin_mc.alpha = 0; }; this._skinFadingTimer.start(); } else { if (this._skinFadingMaxTime <= 0){ this._skinFadingTimer.stop(); this.skin_mc.alpha = 1; }; }; this.skin_mc.visible = this.__visible; }; this._skinAutoHideTimer.stop(); }; } flvplayback_internal function skinAutoHideHitTest(_arg1:TimerEvent, _arg2:Boolean=true):void{ var visibleVP:VideoPlayer; var hit:Boolean; var e = _arg1; var doFade = _arg2; try { if (!this.__visible){ this.skin_mc.visible = false; if (this.hitTarget_mc){ this.hitTarget_mc.accessibilityProperties.name = this.accessibilityPropertyNames[SHOW_CONTROLS_BUTTON]; }; } else { if (this._vc.stage != null){ visibleVP = this._vc.getVideoPlayer(this._vc.visibleVideoPlayerIndex); hit = visibleVP.hitTestPoint(this._vc.stage.mouseX, this._vc.stage.mouseY, true); if (((((this._fullScreen) && (this._fullScreenTakeOver))) && (!((e == null))))){ if ((((this._vc.stage.mouseX == this._skinAutoHideMouseX)) && ((this._vc.stage.mouseY == this._skinAutoHideMouseY)))){ if ((getTimer() - this._skinAutoHideLastMotionTime) > this._skinAutoHideMotionTimeout){ hit = false; }; } else { this._skinAutoHideLastMotionTime = getTimer(); this._skinAutoHideMouseX = this._vc.stage.mouseX; this._skinAutoHideMouseY = this._vc.stage.mouseY; }; }; if (((!(hit)) && (!((this.border_mc == null))))){ hit = this.border_mc.hitTestPoint(this._vc.stage.mouseX, this._vc.stage.mouseY, true); if (((((hit) && (this._fullScreen))) && (this._fullScreenTakeOver))){ this._skinAutoHideLastMotionTime = getTimer(); }; }; if (((!(doFade)) || ((this._skinFadingMaxTime <= 0)))){ this._skinFadingTimer.stop(); this.skin_mc.visible = hit; this.skin_mc.alpha = 1; } else { if (((((((hit) && (this.skin_mc.visible))) && (((!(this._skinFadingTimer.running)) || (this._skinFadingIn))))) || (((!(hit)) && (((!(this.skin_mc.visible)) || (((this._skinFadingTimer.running) && (!(this._skinFadingIn)))))))))){ } else { this._skinFadingTimer.stop(); this._skinFadingIn = hit; if (((this._skinFadingIn) && ((this.skin_mc.alpha == 1)))){ this.skin_mc.alpha = 0; }; this._skinFadeStartTime = getTimer(); this._skinFadingTimer.start(); this.skin_mc.visible = true; }; }; if (this.hitTarget_mc){ this.hitTarget_mc.accessibilityProperties.name = (hit) ? this.accessibilityPropertyNames[HIDE_CONTROLS_BUTTON] : this.accessibilityPropertyNames[SHOW_CONTROLS_BUTTON]; }; }; }; } catch(se:SecurityError) { _skinAutoHideTimer.stop(); _skinFadingTimer.stop(); skin_mc.visible = __visible; skin_mc.alpha = 1; if (hitTarget_mc){ hitTarget_mc.accessibilityProperties.name = accessibilityPropertyNames[HIDE_CONTROLS_BUTTON]; }; }; if (((this.hitTarget_mc) && (Capabilities.hasAccessibility))){ Accessibility.updateProperties(); }; } flvplayback_internal function skinFadeMore(_arg1:TimerEvent):void{ var _local2:Number; if (((((!(this._skinFadingIn)) && ((this.skin_mc.alpha <= 0.5)))) || (((this._skinFadingIn) && ((this.skin_mc.alpha >= 0.95)))))){ this.skin_mc.visible = this._skinFadingIn; this.skin_mc.alpha = 1; this._skinFadingTimer.stop(); } else { _local2 = ((getTimer() - this._skinFadeStartTime) / this._skinFadingMaxTime); if (!this._skinFadingIn){ _local2 = (1 - _local2); }; if (_local2 < 0){ _local2 = 0; } else { if (_local2 > 1){ _local2 = 1; }; }; this.skin_mc.alpha = _local2; }; } public function enterFullScreenDisplayState():void{ var theRect:Rectangle; var vp:VideoPlayer; var effectiveWidth:int; var effectiveHeight:int; var videoAspectRatio:Number; var screenAspectRatio:Number; var effectiveMinWidth:int; var effectiveMinHeight:int; var skinScaleMinWidth:int; var skinScaleMinHeight:int; if (((!(this._fullScreen)) && (!((this._vc.stage == null))))){ if (this._fullScreenTakeOver){ try { theRect = this._vc.stage.fullScreenSourceRect; this._fullScreenAccel = true; vp = this._vc.getVideoPlayer(this._vc.visibleVideoPlayerIndex); effectiveWidth = vp.videoWidth; effectiveHeight = vp.videoHeight; videoAspectRatio = (effectiveWidth / effectiveHeight); screenAspectRatio = (this._vc.stage.fullScreenWidth / this._vc.stage.fullScreenHeight); if (videoAspectRatio > screenAspectRatio){ effectiveHeight = (effectiveWidth / screenAspectRatio); } else { if (videoAspectRatio < screenAspectRatio){ effectiveWidth = (effectiveHeight * screenAspectRatio); }; }; effectiveMinWidth = this.fullScreenSourceRectMinWidth; effectiveMinHeight = this.fullScreenSourceRectMinHeight; if (this.fullScreenSourceRectMinAspectRatio > screenAspectRatio){ effectiveMinHeight = (effectiveMinWidth / screenAspectRatio); } else { if (this.fullScreenSourceRectMinAspectRatio < screenAspectRatio){ effectiveMinWidth = (effectiveMinHeight * screenAspectRatio); }; }; skinScaleMinWidth = (this._vc.stage.fullScreenWidth / this._skinScaleMaximum); skinScaleMinHeight = (this._vc.stage.fullScreenHeight / this._skinScaleMaximum); if ((((effectiveMinWidth < skinScaleMinWidth)) || ((effectiveMinHeight < skinScaleMinHeight)))){ effectiveMinWidth = skinScaleMinWidth; effectiveMinHeight = skinScaleMinHeight; }; if ((((effectiveWidth < effectiveMinWidth)) || ((effectiveHeight < effectiveMinHeight)))){ effectiveWidth = effectiveMinWidth; effectiveHeight = effectiveMinHeight; }; this._vc.stage.fullScreenSourceRect = new Rectangle(0, 0, effectiveWidth, effectiveHeight); this._vc.stage.displayState = StageDisplayState.FULL_SCREEN; } catch(re:ReferenceError) { _fullScreenAccel = false; } catch(re:SecurityError) { _fullScreenAccel = false; }; }; try { this._vc.stage.displayState = StageDisplayState.FULL_SCREEN; } catch(se:SecurityError) { }; }; } flvplayback_internal function enterFullScreenTakeOver():void{ var i:int; var fullScreenBG:Sprite; var vp:VideoPlayer; if (((!(this._fullScreen)) || (!((this.cacheFLVPlaybackParent == null))))){ return; }; this._vc.removeEventListener(LayoutEvent.LAYOUT, this.handleLayoutEvent); this._vc.removeEventListener(AutoLayoutEvent.AUTO_LAYOUT, this.handleLayoutEvent); this._vc.removeEventListener(Event.ADDED_TO_STAGE, this.handleEvent); this._vc.stage.removeEventListener(FullScreenEvent.FULL_SCREEN, this.handleFullScreenEvent); try { this.cacheFLVPlaybackScaleMode = new Array(); this.cacheFLVPlaybackAlign = new Array(); i = 0; while (i < this._vc.videoPlayers.length) { vp = (this._vc.videoPlayers[i] as VideoPlayer); if (vp != null){ this.cacheFLVPlaybackScaleMode[i] = vp.scaleMode; this.cacheFLVPlaybackAlign[i] = vp.align; }; i = (i + 1); }; this.cacheFLVPlaybackParent = this._vc.parent; this.cacheFLVPlaybackIndex = this._vc.parent.getChildIndex(this._vc); this.cacheFLVPlaybackLocation = new Rectangle(this._vc.registrationX, this._vc.registrationY, this._vc.registrationWidth, this._vc.registrationHeight); if (!this._fullScreenAccel){ this.cacheStageAlign = this._vc.stage.align; this.cacheStageScaleMode = this._vc.stage.scaleMode; this._vc.stage.align = StageAlign.TOP_LEFT; this._vc.stage.scaleMode = StageScaleMode.NO_SCALE; }; this._vc.align = VideoAlign.CENTER; this._vc.scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO; this._vc.registrationX = 0; this._vc.registrationY = 0; if (this._fullScreenAccel){ this._vc.setSize(this._vc.stage.fullScreenSourceRect.width, this._vc.stage.fullScreenSourceRect.height); } else { this._vc.setSize(this._vc.stage.stageWidth, this._vc.stage.stageHeight); }; if (this._vc.stage != this._vc.parent){ this._vc.stage.addChild(this._vc); } else { this._vc.stage.setChildIndex(this._vc, (this._vc.stage.numChildren - 1)); }; fullScreenBG = Sprite(this._vc.getChildByName("fullScreenBG")); if (fullScreenBG == null){ fullScreenBG = new Sprite(); fullScreenBG.name = "fullScreenBG"; this._vc.addChildAt(fullScreenBG, 0); } else { this._vc.setChildIndex(fullScreenBG, 0); }; fullScreenBG.graphics.beginFill(this._fullScreenBgColor); if (this._fullScreenAccel){ fullScreenBG.graphics.drawRect(0, 0, this._vc.stage.fullScreenSourceRect.width, this._vc.stage.fullScreenSourceRect.height); } else { fullScreenBG.graphics.drawRect(0, 0, this._vc.stage.stageWidth, this._vc.stage.stageHeight); }; this.layoutSkin(); this.setupSkinAutoHide(false); if (this.hitTarget_mc != null){ this.hitTarget_mc.graphics.clear(); this.hitTarget_mc.graphics.lineStyle(0, 0, 0); if (this._fullScreenAccel){ this.hitTarget_mc.graphics.drawRect(0, 0, this._vc.stage.fullScreenSourceRect.width, this._vc.stage.fullScreenSourceRect.height); } else { this.hitTarget_mc.graphics.drawRect(0, 0, this._vc.stage.stageWidth, this._vc.stage.stageHeight); }; }; } catch(err:Error) { cacheFLVPlaybackParent = null; }; this._vc.addEventListener(LayoutEvent.LAYOUT, this.handleLayoutEvent); this._vc.addEventListener(AutoLayoutEvent.AUTO_LAYOUT, this.handleLayoutEvent); this._vc.addEventListener(Event.ADDED_TO_STAGE, this.handleEvent); this._vc.stage.addEventListener(FullScreenEvent.FULL_SCREEN, this.handleFullScreenEvent, false, 0, true); } flvplayback_internal function exitFullScreenTakeOver():void{ var fullScreenBG:Sprite; var cacheActiveIndex:int; var i:int; var vp:VideoPlayer; if (this.cacheFLVPlaybackParent == null){ return; }; this._vc.removeEventListener(Event.ADDED_TO_STAGE, this.handleEvent); this._vc.stage.removeEventListener(FullScreenEvent.FULL_SCREEN, this.handleFullScreenEvent); try { if (this._fullScreenAccel){ this._vc.stage.fullScreenSourceRect = new Rectangle(0, 0, -1, -1); } else { this._vc.stage.align = this.cacheStageAlign; this._vc.stage.scaleMode = this.cacheStageScaleMode; }; fullScreenBG = Sprite(this._vc.getChildByName("fullScreenBG")); if (fullScreenBG != null){ this._vc.removeChild(fullScreenBG); }; if (this.hitTarget_mc != null){ this.hitTarget_mc.graphics.clear(); this.hitTarget_mc.graphics.lineStyle(0, 0, 0); this.hitTarget_mc.graphics.drawRect(0, 0, this._vc.width, this._vc.height); }; if (this._vc.parent != this.cacheFLVPlaybackParent){ this.cacheFLVPlaybackParent.addChildAt(this._vc, this.cacheFLVPlaybackIndex); } else { this.cacheFLVPlaybackParent.setChildIndex(this._vc, this.cacheFLVPlaybackIndex); }; cacheActiveIndex = this._vc.activeVideoPlayerIndex; i = 0; while (i < this._vc.videoPlayers.length) { vp = (this._vc.videoPlayers[i] as VideoPlayer); if (vp != null){ this._vc.activeVideoPlayerIndex = i; if (this.cacheFLVPlaybackScaleMode[i] != undefined){ this._vc.scaleMode = this.cacheFLVPlaybackScaleMode[i]; }; if (this.cacheFLVPlaybackAlign[i]){ this._vc.align = this.cacheFLVPlaybackAlign[i]; }; }; i = (i + 1); }; this._vc.activeVideoPlayerIndex = cacheActiveIndex; this._vc.registrationX = this.cacheFLVPlaybackLocation.x; this._vc.registrationY = this.cacheFLVPlaybackLocation.y; this._vc.setSize(this.cacheFLVPlaybackLocation.width, this.cacheFLVPlaybackLocation.height); } catch(err:Error) { }; this._vc.addEventListener(Event.ADDED_TO_STAGE, this.handleEvent); this._vc.stage.addEventListener(FullScreenEvent.FULL_SCREEN, this.handleFullScreenEvent, false, 0, true); this._fullScreen = false; this._fullScreenAccel = false; this.cacheStageAlign = null; this.cacheStageScaleMode = null; this.cacheFLVPlaybackParent = null; this.cacheFLVPlaybackIndex = 0; this.cacheFLVPlaybackLocation = null; this.cacheFLVPlaybackScaleMode = null; this.cacheFLVPlaybackAlign = null; if (this._skinAutoHide != this.cacheSkinAutoHide){ this._skinAutoHide = this.cacheSkinAutoHide; this.setupSkinAutoHide(false); }; } flvplayback_internal function hookUpCustomComponents():void{ var i:int; var dispObj:DisplayObject; var name:String; var index:int; var ctrl:Sprite; this.focusRect = this.isFocusRectActive(); var searchHash:Object = new Object(); var doTheSearch:Boolean; i = 0; while (i < NUM_CONTROLS) { if (this.controls[i] == null){ searchHash[customComponentClassNames[i]] = i; doTheSearch = true; }; i = (i + 1); }; if (!doTheSearch){ return; }; i = 0; while (i < this._vc.parent.numChildren) { dispObj = this._vc.parent.getChildAt(i); name = getQualifiedClassName(dispObj); if (searchHash[name] != undefined){ if (typeof(searchHash[name]) == "number"){ index = int(searchHash[name]); try { ctrl = Sprite(dispObj); if ((((((index >= NUM_BUTTONS)) || ((ctrl["placeholder_mc"] is DisplayObject)))) && ((ctrl["uiMgr"] == null)))){ this.setControl(index, ctrl); searchHash[name] = ctrl; }; } catch(err:Error) { }; }; }; i = (i + 1); }; } flvplayback_internal function configureBarAccessibility(_arg1:int):void{ switch (_arg1){ case SEEK_BAR_HANDLE: SeekBarAccImpl.createAccessibilityImplementation(this.controls[SEEK_BAR_HANDLE]); break; case VOLUME_BAR_HANDLE: VolumeBarAccImpl.createAccessibilityImplementation(this.controls[VOLUME_BAR_HANDLE]); break; }; } flvplayback_internal function handleKeyEvent(_arg1:KeyboardEvent):void{ var ctrlData:ControlData; var focusControl:InteractiveObject; var percent:Number; var nearestCuePoint:Object; var nextCuePoint:Object; var wasMuted:Boolean; var num:Number; var ctrl:Sprite; var setFocusedControl:Function; var event = _arg1; ctrlData = this.ctrlDataDict[event.currentTarget]; var k:int = event.keyCode; var ka:int = event.charCode; var kaBool:Boolean = (((ka >= 48)) && ((ka <= 57))); ka = int(String.fromCharCode(event.charCode)); switch (event.type){ case KeyboardEvent.KEY_DOWN: switch (event.target){ case this.controls[SEEK_BAR_HANDLE]: case this.controls[VOLUME_BAR_HANDLE]: if (((!((k == Keyboard.TAB))) && ((((((((((((((((((k == Keyboard.UP)) || ((k == Keyboard.DOWN)))) || ((k == Keyboard.LEFT)))) || ((k == Keyboard.RIGHT)))) || ((k == Keyboard.PAGE_UP)))) || ((k == Keyboard.PAGE_DOWN)))) || ((k == Keyboard.HOME)))) || ((k == Keyboard.END)))) || (((!(isNaN(ka))) && (kaBool))))))){ focusControl = (event.target as InteractiveObject); focusControl.stage.focus = focusControl; if (event.target == this.controls[SEEK_BAR_HANDLE]){ percent = this._vc.playheadPercentage; nearestCuePoint = this._vc.findNearestCuePoint(this._vc.playheadTime); if ((((k == Keyboard.LEFT)) || ((k == Keyboard.DOWN)))){ percent = (percent - (this._vc.seekBarScrubTolerance * 2)); this._vc.playheadPercentage = Math.max(percent, 0); } else { if ((((k == Keyboard.RIGHT)) || ((k == Keyboard.UP)))){ if (this._vc.playheadPercentage >= 99){ return; }; if (((!((nearestCuePoint == null))) && ((nearestCuePoint.index < ((nearestCuePoint.array as Array).length - 1))))){ try { nextCuePoint = this._vc.findCuePoint(nearestCuePoint.array[(nearestCuePoint.index + 1)]); if (((nextCuePoint) && (this._vc.isFLVCuePointEnabled(nextCuePoint)))){ if (isNaN(Number(this._vc.metadata.videocodecid))){ this._vc.playheadPercentage = Math.max(((nextCuePoint.time / this._vc.totalTime) * 100), Math.min(99, (this._vc.playheadPercentage + (this._vc.seekBarScrubTolerance * 2)))); } else { this._vc.playheadTime = nextCuePoint.time; }; }; } catch(err:Error) { }; } else { percent = (percent + this._vc.seekBarScrubTolerance); this._vc.playheadPercentage = Math.min(99, percent); }; } else { if ((((k == Keyboard.PAGE_UP)) || ((k == Keyboard.HOME)))){ this._vc.playheadPercentage = 0; } else { if ((((k == Keyboard.PAGE_DOWN)) || ((k == Keyboard.END)))){ this._vc.playheadPercentage = 99; }; }; }; }; } else { wasMuted = this._isMuted; num = (this._isMuted) ? (Math.round((this.cachedSoundLevel * 1000)) / 100) : (Math.round((this._vc.volume * 1000)) / 100); if ((((k == Keyboard.LEFT)) || ((k == Keyboard.DOWN)))){ if (Math.floor(num) != num){ this._vc.volume = (Math.floor(num) / 10); } else { this._vc.volume = Math.max(0, ((num - 1) / 10)); }; } else { if ((((k == Keyboard.RIGHT)) || ((k == Keyboard.UP)))){ if (Math.round(num) != num){ this._vc.volume = (Math.round(num) / 10); } else { this._vc.volume = Math.min(1, ((num + 1) / 10)); }; } else { if ((((k == Keyboard.PAGE_UP)) || ((k == Keyboard.HOME)))){ this._vc.volume = 1; } else { if ((((k == Keyboard.PAGE_DOWN)) || ((k == Keyboard.END)))){ this._vc.volume = 0; } else { if (((!(isNaN(ka))) && (kaBool))){ this._vc.volume = Math.min(1, ((ka + 1) / 10)); }; }; }; }; }; this.cachedSoundLevel = this._vc.volume; if (wasMuted){ this._isMuted = true; this.cachedSoundLevel = this._vc.volume; this._vc.volume = 0; this.setEnabledAndVisibleForState(MUTE_OFF_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[MUTE_OFF_BUTTON]); this.setEnabledAndVisibleForState(MUTE_ON_BUTTON, VideoState.PLAYING); this.skinButtonControl(this.controls[MUTE_ON_BUTTON]); }; }; }; break; case this.controls[PAUSE_BUTTON]: if ((((k == Keyboard.SPACE)) || ((k == Keyboard.ENTER)))){ ctrlData.state = DOWN_STATE; if (!event.target.focusRect){ this.dispatchMessage(ctrlData.index); }; focusControl = (this.controls[PLAY_BUTTON] as InteractiveObject); }; break; case this.controls[PLAY_BUTTON]: if ((((k == Keyboard.SPACE)) || ((k == Keyboard.ENTER)))){ ctrlData.state = DOWN_STATE; if (!event.target.focusRect){ this.dispatchMessage(ctrlData.index); }; focusControl = (this.controls[PAUSE_BUTTON] as InteractiveObject); }; break; case this.controls[STOP_BUTTON]: case this.controls[BACK_BUTTON]: case this.controls[FORWARD_BUTTON]: if ((((k == Keyboard.SPACE)) || ((k == Keyboard.ENTER)))){ ctrlData.state = DOWN_STATE; event.target.tabEnabled = true; if (!event.target.focusRect){ this.dispatchMessage(ctrlData.index); }; focusControl = (event.target as InteractiveObject); }; break; case this.controls[MUTE_ON_BUTTON]: if ((((k == Keyboard.SPACE)) || ((k == Keyboard.ENTER)))){ ctrlData.state = DOWN_STATE; if (!event.target.focusRect){ this.dispatchMessage(ctrlData.index); }; focusControl = (this.controls[MUTE_OFF_BUTTON] as InteractiveObject); }; break; case this.controls[MUTE_OFF_BUTTON]: if ((((k == Keyboard.SPACE)) || ((k == Keyboard.ENTER)))){ ctrlData.state = DOWN_STATE; if (!event.target.focusRect){ this.dispatchMessage(ctrlData.index); }; focusControl = (this.controls[MUTE_ON_BUTTON] as InteractiveObject); }; break; case this.controls[FULL_SCREEN_ON_BUTTON]: if ((((k == Keyboard.SPACE)) || ((k == Keyboard.ENTER)))){ ctrlData.state = DOWN_STATE; this.dispatchMessage(FULL_SCREEN_ON_BUTTON); }; break; case this.controls[FULL_SCREEN_OFF_BUTTON]: if ((((k == Keyboard.SPACE)) || ((k == Keyboard.ENTER)))){ ctrlData.state = DOWN_STATE; this.dispatchMessage(FULL_SCREEN_OFF_BUTTON); }; break; }; this.skinButtonControl(event.currentTarget); break; case KeyboardEvent.KEY_UP: switch (event.target){ case this.controls[SEEK_BAR_HANDLE]: case this.controls[VOLUME_BAR_HANDLE]: if (((!((k == Keyboard.TAB))) && ((((((((((((((((k == Keyboard.UP)) || ((k == Keyboard.DOWN)))) || ((k == Keyboard.LEFT)))) || ((k == Keyboard.RIGHT)))) || ((k == Keyboard.PAGE_UP)))) || ((k == Keyboard.PAGE_DOWN)))) || ((k == Keyboard.HOME)))) || ((k == Keyboard.END)))))){ focusControl = (event.target as InteractiveObject); focusControl.stage.focus = focusControl; }; break; default: ctrlData.state = OVER_STATE; break; }; break; }; if (focusControl != null){ if (focusControl.visible){ ctrlData.state = NORMAL_STATE; if (!focusControl.tabEnabled){ focusControl.tabEnabled = true; }; focusControl.stage.focus = focusControl; } else { ctrl = (event.currentTarget as Sprite); setFocusedControl = function (_arg1:Event):void{ if (_arg1.target.visible){ ctrlData.state = NORMAL_STATE; if (!_arg1.target.tabEnabled){ _arg1.target.tabEnabled = true; }; _arg1.target.stage.focus = _arg1.target; _arg1.target.removeEventListener(Event.ENTER_FRAME, setFocusedControl); }; }; focusControl.addEventListener(Event.ENTER_FRAME, setFocusedControl); }; }; } flvplayback_internal function handleFocusEvent(_arg1:FocusEvent):void{ var _local2:ControlData = this.ctrlDataDict[_arg1.currentTarget]; if (_local2 == null){ return; }; switch (_arg1.type){ case FocusEvent.FOCUS_IN: switch (_arg1.target){ case this.controls[SEEK_BAR_HANDLE]: case this.controls[VOLUME_BAR_HANDLE]: _arg1.target.focusRect = false; break; }; _local2.state = OVER_STATE; break; case FocusEvent.FOCUS_OUT: switch (_arg1.target){ case this.controls[SEEK_BAR_HANDLE]: case this.controls[VOLUME_BAR_HANDLE]: _arg1.target.focusRect = true; break; case this.controls[STOP_BUTTON]: if (!_local2.enabled){ _arg1.target.tabEnabled = false; }; break; }; _local2.state = NORMAL_STATE; break; }; this.skinButtonControl(_arg1.currentTarget); } flvplayback_internal function assignTabIndexes(_arg1:int):int{ var controlsSlice:Array; var customSlice:Array; var sortedControls:Array; var i:int; var ctrl:Sprite; var startTabbing = _arg1; if (startTabbing){ this.startTabIndex = startTabbing; this.endTabIndex = (this.startTabIndex + 1); } else { if (this._vc.tabIndex){ this.startTabIndex = this._vc.tabIndex; this.endTabIndex = (this.startTabIndex + 1); } else { return (this.endTabIndex); }; }; var sortByPosition:Function = function (_arg1:DisplayObject, _arg2:DisplayObject):int{ var _local3:Rectangle = _arg1.getBounds(_vc); var _local4:Rectangle = _arg2.getBounds(_vc); if (_local3.x > _local4.x){ return (1); }; if (_local3.x < _local4.x){ return (-1); }; if (_local3.y > _local4.y){ return (-1); }; if (_local3.y < _local4.y){ return (1); }; return (0); }; try { controlsSlice = this.controls.slice(); if (((this.customClips) && ((this.customClips.length > 0)))){ customSlice = this.customClips.slice(); }; sortedControls = (customSlice) ? controlsSlice.concat(customSlice) : controlsSlice; sortedControls.sort(sortByPosition); while (i < sortedControls.length) { ctrl = (sortedControls[i] as Sprite); ctrl.tabIndex = ++this.endTabIndex; if (!ctrl.tabEnabled){ ctrl.tabEnabled = false; }; i = (i + 1); }; } catch(err:Error) { }; return (++this.endTabIndex); } flvplayback_internal function isFocusRectActive():Boolean{ var i:int; var doc:DisplayObjectContainer; var child:DisplayObject; var classReference:Class; var c:*; var o:InteractiveObject = this._vc.parent; while (o) { if ((o is DisplayObjectContainer)){ doc = DisplayObjectContainer(o); }; i = 0; while (i < doc.numChildren) { try { child = (doc.getChildAt(i) as DisplayObject); classReference = (getDefinitionByName("fl.core.UIComponent") as Class); if (((((!((child == null))) && (!((child == this._vc))))) && ((child is classReference)))){ c = (child as classReference); if (c.focusManager.showFocusIndicator){ return (false); }; break; }; } catch(e:Error) { }; i = (i + 1); }; o = o.parent; }; return (true); } private function handleMouseFocusChangeEvent(_arg1:FocusEvent):void{ var ctrlData:ControlData; var focusCtrlData:ControlData; var ctrl:Sprite; var setFocusedControl:Function; var event = _arg1; try { ctrlData = this.ctrlDataDict[event.relatedObject]; } catch(error:ReferenceError) { }; if (ctrlData == null){ return; }; var index:int = ctrlData.index; var currentFocus:InteractiveObject = (event.target.stage.focus as InteractiveObject); var focusControl:InteractiveObject; switch (index){ case PLAY_BUTTON: focusControl = (this.controls[PAUSE_BUTTON] as InteractiveObject); break; case PAUSE_BUTTON: focusControl = (this.controls[PLAY_BUTTON] as InteractiveObject); break; case STOP_BUTTON: case BACK_BUTTON: case FORWARD_BUTTON: case SEEK_BAR_HANDLE: case VOLUME_BAR_HANDLE: focusControl = (this.controls[event.relatedObject] as InteractiveObject); break; case SEEK_BAR_HIT: focusControl = (this.controls[SEEK_BAR_HANDLE] as InteractiveObject); break; case VOLUME_BAR_HIT: focusControl = (this.controls[VOLUME_BAR_HANDLE] as InteractiveObject); break; case MUTE_ON_BUTTON: focusControl = (this.controls[MUTE_OFF_BUTTON] as InteractiveObject); break; case MUTE_OFF_BUTTON: focusControl = (this.controls[MUTE_ON_BUTTON] as InteractiveObject); break; case FULL_SCREEN_ON_BUTTON: focusControl = (this.controls[FULL_SCREEN_OFF_BUTTON] as InteractiveObject); break; case FULL_SCREEN_OFF_BUTTON: focusControl = (this.controls[FULL_SCREEN_ON_BUTTON] as InteractiveObject); break; }; if (focusControl != null){ try { focusCtrlData = this.ctrlDataDict[focusControl]; focusCtrlData.cachedFocusRect = focusControl.focusRect; } catch(error:ReferenceError) { }; focusControl.focusRect = false; if (focusControl.visible){ focusControl.stage.focus = focusControl; focusControl.focusRect = focusCtrlData.cachedFocusRect; } else { ctrl = (event.currentTarget as Sprite); setFocusedControl = function (_arg1:Event):void{ if (_arg1.target.visible){ _arg1.target.stage.focus = _arg1.target; _arg1.target.focusRect = focusCtrlData.cachedFocusRect; _arg1.target.removeEventListener(Event.ENTER_FRAME, setFocusedControl); }; }; focusControl.addEventListener(Event.ENTER_FRAME, setFocusedControl); }; }; } flvplayback_internal static function initLayoutNameToIndexMappings():void{ layoutNameToIndexMappings = new Object(); var _local1:int; while (_local1 < layoutNameArray.length) { if (layoutNameArray[_local1] != null){ layoutNameToIndexMappings[layoutNameArray[_local1]] = _local1; }; _local1++; }; } flvplayback_internal static function getNumberPropSafe(_arg1:Object, _arg2:String):Number{ var numProp:*; var obj = _arg1; var propName = _arg2; try { numProp = obj[propName]; return (Number(numProp)); } catch(re:ReferenceError) { }; return (NaN); } flvplayback_internal static function getBooleanPropSafe(_arg1:Object, _arg2:String):Boolean{ var boolProp:*; var obj = _arg1; var propName = _arg2; try { boolProp = obj[propName]; return (Boolean(boolProp)); } catch(re:ReferenceError) { }; return (false); } } }//package fl.video
Section 23
//VideoAlign (fl.video.VideoAlign) package fl.video { public final class VideoAlign { public static const CENTER:String = "center"; public static const TOP:String = "top"; public static const LEFT:String = "left"; public static const BOTTOM:String = "bottom"; public static const RIGHT:String = "right"; public static const TOP_LEFT:String = "topLeft"; public static const TOP_RIGHT:String = "topRight"; public static const BOTTOM_LEFT:String = "bottomLeft"; public static const BOTTOM_RIGHT:String = "bottomRight"; } }//package fl.video
Section 24
//VideoError (fl.video.VideoError) package fl.video { public class VideoError extends Error { private var _code:uint; public static const VERSION:String = "2.1.0.23"; public static const SHORT_VERSION:String = "2.1"; flvplayback_internal static const BASE_ERROR_CODE:uint = 1000; public static const NO_CONNECTION:uint = 1000; public static const ILLEGAL_CUE_POINT:uint = 1002; public static const INVALID_SEEK:uint = 1003; public static const INVALID_SOURCE:uint = 1004; public static const INVALID_XML:uint = 1005; public static const NO_BITRATE_MATCH:uint = 1006; public static const DELETE_DEFAULT_PLAYER:uint = 1007; public static const INCMANAGER_CLASS_UNSET:uint = 1008; public static const NULL_URL_LOAD:uint = 1009; public static const MISSING_SKIN_STYLE:uint = 1010; public static const UNSUPPORTED_PROPERTY:uint = 1011; public static const NETSTREAM_CLIENT_CLASS_UNSET:uint = 1012; flvplayback_internal static const ERROR_MSG:Array = ["Unable to make connection to server or to find FLV on server", "No matching cue point found", "Illegal cue point", "Invalid seek", "Invalid source", "Invalid xml", "No bitrate match, must be no default flv", "Cannot delete default VideoPlayer", "VideoPlayer.iNCManagerClass has not been set or its value is invalid", "Null url parameter sent to load()", "Skin is missing a required style definition or its value is invalid", "Unsupported property", "VideoPlayer.netStreamClientClass has not been set or its value is invalid"]; public function VideoError(_arg1:uint, _arg2:String=null){ super((((("" + _arg1) + ": ") + ERROR_MSG[(_arg1 - BASE_ERROR_CODE)]) + ((_arg2)==null) ? "" : (": " + _arg2))); name = "VideoError"; this._code = _arg1; } public function get code():uint{ return (this._code); } } }//package fl.video
Section 25
//VideoEvent (fl.video.VideoEvent) package fl.video { import flash.events.*; public class VideoEvent extends Event implements IVPEvent { private var _state:String; private var _playheadTime:Number; private var _vp:uint; public static const AUTO_REWOUND:String = "autoRewound"; public static const BUFFERING_STATE_ENTERED:String = "bufferingStateEntered"; public static const CLOSE:String = "close"; public static const COMPLETE:String = "complete"; public static const FAST_FORWARD:String = "fastForward"; public static const PAUSED_STATE_ENTERED:String = "pausedStateEntered"; public static const PLAYHEAD_UPDATE:String = "playheadUpdate"; public static const PLAYING_STATE_ENTERED:String = "playingStateEntered"; public static const READY:String = "ready"; public static const REWIND:String = "rewind"; public static const SCRUB_FINISH:String = "scrubFinish"; public static const SCRUB_START:String = "scrubStart"; public static const SEEKED:String = "seeked"; public static const SKIN_LOADED:String = "skinLoaded"; public static const STATE_CHANGE:String = "stateChange"; public static const STOPPED_STATE_ENTERED:String = "stoppedStateEntered"; public function VideoEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:String=null, _arg5:Number=NaN, _arg6:uint=0){ super(_arg1, _arg2, _arg3); this._state = _arg4; this._playheadTime = _arg5; this._vp = _arg6; } public function get state():String{ return (this._state); } public function set state(_arg1:String):void{ this._state = _arg1; } public function get playheadTime():Number{ return (this._playheadTime); } public function set playheadTime(_arg1:Number):void{ this._playheadTime = _arg1; } public function get vp():uint{ return (this._vp); } public function set vp(_arg1:uint):void{ this._vp = _arg1; } override public function clone():Event{ return (new VideoEvent(type, bubbles, cancelable, this.state, this.playheadTime, this.vp)); } } }//package fl.video
Section 26
//VideoPlayer (fl.video.VideoPlayer) package fl.video { import flash.events.*; import flash.geom.*; import flash.net.*; import flash.media.*; import flash.utils.*; public class VideoPlayer extends Video { protected var _state:String; flvplayback_internal var _cachedState:String; flvplayback_internal var _bufferState:String; flvplayback_internal var _sawPlayStop:Boolean; flvplayback_internal var _cachedPlayheadTime:Number; protected var _metadata:Object; protected var _registrationX:Number; protected var _registrationY:Number; protected var _registrationWidth:Number; protected var _registrationHeight:Number; flvplayback_internal var _startingPlay:Boolean; flvplayback_internal var _lastSeekTime:Number; flvplayback_internal var _invalidSeekTime:Boolean; flvplayback_internal var _invalidSeekRecovery:Boolean; flvplayback_internal var _readyDispatched:Boolean; flvplayback_internal var _autoResizeDone:Boolean; flvplayback_internal var _lastUpdateTime:Number; flvplayback_internal var lastUpdateTimeStuckCount:Number; flvplayback_internal var _sawSeekNotify:Boolean; protected var _ncMgr:INCManager; protected var _ns:NetStream; flvplayback_internal var _currentPos:Number; flvplayback_internal var _atEnd:Boolean; flvplayback_internal var _atEndCheckPlayhead:Number; protected var _streamLength:Number; protected var _align:String; protected var _scaleMode:String; protected var _autoPlay:Boolean; protected var _autoRewind:Boolean; protected var _contentPath:String; protected var _bufferTime:Number; protected var _isLive:Boolean; protected var _volume:Number; protected var _soundTransform:SoundTransform; protected var __visible:Boolean; flvplayback_internal var _hiddenForResize:Boolean; flvplayback_internal var _hiddenForResizeMetadataDelay:Number; flvplayback_internal var _resizeImmediatelyOnMetadata:Boolean; flvplayback_internal var _hiddenRewindPlayheadTime:Number; protected var _videoWidth:int; protected var _videoHeight:int; flvplayback_internal var _prevVideoWidth:int; flvplayback_internal var _prevVideoHeight:int; flvplayback_internal var oldBounds:Rectangle; flvplayback_internal var oldRegistrationBounds:Rectangle; flvplayback_internal var _updateTimeTimer:Timer; flvplayback_internal var _updateProgressTimer:Timer; flvplayback_internal var _idleTimeoutTimer:Timer; flvplayback_internal var _autoResizeTimer:Timer; flvplayback_internal var _rtmpDoStopAtEndTimer:Timer; flvplayback_internal var _rtmpDoSeekTimer:Timer; flvplayback_internal var _httpDoSeekTimer:Timer; flvplayback_internal var _httpDoSeekCount:Number; flvplayback_internal var _finishAutoResizeTimer:Timer; flvplayback_internal var _delayedBufferingTimer:Timer; flvplayback_internal var waitingForEnough:Boolean; flvplayback_internal var baselineProgressTime:Number; flvplayback_internal var startProgressTime:Number; flvplayback_internal var totalDownloadTime:Number; flvplayback_internal var totalProgressTime:Number; flvplayback_internal var autoResizePlayheadTimeout:Number;// = 0.5 flvplayback_internal var autoResizeMetadataDelayMax:Number;// = 5 flvplayback_internal var httpDoSeekMaxCount:Number;// = 4 flvplayback_internal var lastUpdateTimeStuckCountMax:int;// = 10 flvplayback_internal var _cmdQueue:Array; public static const VERSION:String = "2.1.0.23"; public static const SHORT_VERSION:String = "2.1"; public static const DEFAULT_UPDATE_TIME_INTERVAL:Number = 250; public static const DEFAULT_UPDATE_PROGRESS_INTERVAL:Number = 250; public static const DEFAULT_IDLE_TIMEOUT_INTERVAL:Number = 300000; flvplayback_internal static const AUTO_RESIZE_INTERVAL:Number = 100; flvplayback_internal static const DEFAULT_AUTO_RESIZE_PLAYHEAD_TIMEOUT:Number = 0.5; flvplayback_internal static const DEFAULT_AUTO_RESIZE_METADATA_DELAY_MAX:Number = 5; flvplayback_internal static const FINISH_AUTO_RESIZE_INTERVAL:Number = 250; flvplayback_internal static const RTMP_DO_STOP_AT_END_INTERVAL:Number = 500; flvplayback_internal static const RTMP_DO_SEEK_INTERVAL:Number = 100; flvplayback_internal static const HTTP_DO_SEEK_INTERVAL:Number = 250; flvplayback_internal static const DEFAULT_HTTP_DO_SEEK_MAX_COUNT:Number = 4; flvplayback_internal static const HTTP_DELAYED_BUFFERING_INTERVAL:Number = 100; flvplayback_internal static const DEFAULT_LAST_UPDATE_TIME_STUCK_COUNT_MAX:int = 10; flvplayback_internal static var BUFFER_EMPTY:String = "bufferEmpty"; flvplayback_internal static var BUFFER_FULL:String = "bufferFull"; flvplayback_internal static var BUFFER_FLUSH:String = "bufferFlush"; public static var iNCManagerClass:Object = "fl.video.NCManager"; public static var netStreamClientClass:Object = VideoPlayerClient; public function VideoPlayer(_arg1:int=320, _arg2:int=240){ super(_arg1, _arg2); this._registrationX = x; this._registrationY = y; this._registrationWidth = _arg1; this._registrationHeight = _arg2; this._state = VideoState.DISCONNECTED; this._cachedState = this._state; this._bufferState = BUFFER_EMPTY; this._sawPlayStop = false; this._cachedPlayheadTime = 0; this._metadata = null; this._startingPlay = false; this._invalidSeekTime = false; this._invalidSeekRecovery = false; this._currentPos = 0; this._atEnd = false; this._streamLength = 0; this._cmdQueue = new Array(); this._readyDispatched = false; this._autoResizeDone = false; this._lastUpdateTime = NaN; this.lastUpdateTimeStuckCount = 0; this._sawSeekNotify = false; this._hiddenForResize = false; this._hiddenForResizeMetadataDelay = 0; this._resizeImmediatelyOnMetadata = false; this._videoWidth = -1; this._videoHeight = -1; this._prevVideoWidth = 0; this._prevVideoHeight = 0; this._updateTimeTimer = new Timer(DEFAULT_UPDATE_TIME_INTERVAL); this._updateTimeTimer.addEventListener(TimerEvent.TIMER, this.doUpdateTime); this._updateProgressTimer = new Timer(DEFAULT_UPDATE_PROGRESS_INTERVAL); this._updateProgressTimer.addEventListener(TimerEvent.TIMER, this.doUpdateProgress); this._idleTimeoutTimer = new Timer(DEFAULT_IDLE_TIMEOUT_INTERVAL, 1); this._idleTimeoutTimer.addEventListener(TimerEvent.TIMER, this.doIdleTimeout); this._autoResizeTimer = new Timer(AUTO_RESIZE_INTERVAL); this._autoResizeTimer.addEventListener(TimerEvent.TIMER, this.doAutoResize); this._rtmpDoStopAtEndTimer = new Timer(RTMP_DO_STOP_AT_END_INTERVAL); this._rtmpDoStopAtEndTimer.addEventListener(TimerEvent.TIMER, this.rtmpDoStopAtEnd); this._rtmpDoSeekTimer = new Timer(RTMP_DO_SEEK_INTERVAL); this._rtmpDoSeekTimer.addEventListener(TimerEvent.TIMER, this.rtmpDoSeek); this._httpDoSeekTimer = new Timer(HTTP_DO_SEEK_INTERVAL); this._httpDoSeekTimer.addEventListener(TimerEvent.TIMER, this.httpDoSeek); this._httpDoSeekCount = 0; this._finishAutoResizeTimer = new Timer(FINISH_AUTO_RESIZE_INTERVAL, 1); this._finishAutoResizeTimer.addEventListener(TimerEvent.TIMER, this.finishAutoResize); this._delayedBufferingTimer = new Timer(HTTP_DELAYED_BUFFERING_INTERVAL); this._delayedBufferingTimer.addEventListener(TimerEvent.TIMER, this.doDelayedBuffering); this._isLive = false; this._align = VideoAlign.CENTER; this._scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO; this._autoPlay = true; this._autoRewind = false; this._bufferTime = 0.1; this._soundTransform = new SoundTransform(); this._volume = this._soundTransform.volume; this.__visible = true; this._contentPath = ""; this.waitingForEnough = false; this.baselineProgressTime = NaN; this.startProgressTime = NaN; this.totalDownloadTime = NaN; this.totalProgressTime = NaN; } public function setSize(_arg1:Number, _arg2:Number):void{ super.width = (this._registrationWidth = _arg1); super.height = (this._registrationHeight = _arg2); switch (this._scaleMode){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: this.startAutoResize(); break; default: super.x = this._registrationX; super.y = this._registrationY; break; }; } public function setScale(_arg1:Number, _arg2:Number):void{ super.scaleX = _arg1; super.scaleY = _arg2; this._registrationWidth = width; this._registrationHeight = height; switch (this._scaleMode){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: this.startAutoResize(); break; default: super.x = this._registrationX; super.y = this._registrationY; break; }; } public function play(_arg1:String=null, _arg2:Number=NaN, _arg3:Boolean=false):void{ if (_arg1 != null){ if (this._state == VideoState.EXEC_QUEUED_CMD){ this._state = this._cachedState; } else { if (((((!(this.stateResponsive)) && (!((this._state == VideoState.DISCONNECTED))))) && (!((this._state == VideoState.CONNECTION_ERROR))))){ this.queueCmd(QueuedCommand.PLAY, _arg1, _arg3, _arg2); return; }; this.execQueuedCmds(); }; this._autoPlay = true; this._load(_arg1, _arg2, _arg3); return; }; if (!this.isXnOK()){ if ((((((this._state == VideoState.CONNECTION_ERROR)) || ((this._ncMgr == null)))) || ((this._ncMgr.netConnection == null)))){ throw (new VideoError(VideoError.NO_CONNECTION)); }; this.flushQueuedCmds(); this.queueCmd(QueuedCommand.PLAY); this.setState(VideoState.LOADING); this._cachedState = VideoState.LOADING; this._ncMgr.reconnect(); return; } else { if (this._state == VideoState.EXEC_QUEUED_CMD){ this._state = this._cachedState; } else { if (!this.stateResponsive){ this.queueCmd(QueuedCommand.PLAY); return; }; this.execQueuedCmds(); }; }; if (this._ns == null){ this._createStream(); }; switch (this._state){ case VideoState.BUFFERING: if (this._ncMgr.isRTMP){ this._play(0); if (this._atEnd){ this._atEnd = false; this._currentPos = 0; this.setState(VideoState.REWINDING); } else { if (this._currentPos > 0){ this._seek(this._currentPos); this._currentPos = 0; }; }; }; case VideoState.PLAYING: return; case VideoState.STOPPED: if (this._ncMgr.isRTMP){ if (this._isLive){ this._play(-1); this.setState(VideoState.BUFFERING); } else { this._play(0); if (this._atEnd){ this._atEnd = false; this._currentPos = 0; this._state = VideoState.BUFFERING; this.setState(VideoState.REWINDING); } else { if (this._currentPos > 0){ this._seek(this._currentPos); this._currentPos = 0; this.setState(VideoState.BUFFERING); } else { this.setState(VideoState.BUFFERING); }; }; }; } else { this._pause(false); if (this._atEnd){ this._atEnd = false; this._seek(0); this._state = VideoState.BUFFERING; this.setState(VideoState.REWINDING); } else { if (this._bufferState == BUFFER_EMPTY){ this.setState(VideoState.BUFFERING); } else { this.setState(VideoState.PLAYING); }; }; }; break; case VideoState.PAUSED: this._pause(false); if (!this._ncMgr.isRTMP){ if (this._bufferState == BUFFER_EMPTY){ this.setState(VideoState.BUFFERING); } else { this.setState(VideoState.PLAYING); }; } else { this.setState(VideoState.BUFFERING); }; break; }; } public function playWhenEnoughDownloaded():void{ if (((!((this._ncMgr == null))) && (this._ncMgr.isRTMP))){ this.play(); return; }; if (!this.isXnOK()){ throw (new VideoError(VideoError.NO_CONNECTION)); }; if (this._state == VideoState.EXEC_QUEUED_CMD){ this._state = this._cachedState; } else { if (!this.stateResponsive){ this.queueCmd(QueuedCommand.PLAY_WHEN_ENOUGH); return; }; this.execQueuedCmds(); }; this.waitingForEnough = true; this.checkReadyForPlay(this.bytesLoaded, this.bytesTotal); } public function load(_arg1:String, _arg2:Number=NaN, _arg3:Boolean=false):void{ if (_arg1 == null){ throw (new VideoError(VideoError.NULL_URL_LOAD)); }; if (this._state == VideoState.EXEC_QUEUED_CMD){ this._state = this._cachedState; } else { if (((((!(this.stateResponsive)) && (!((this._state == VideoState.DISCONNECTED))))) && (!((this._state == VideoState.CONNECTION_ERROR))))){ this.queueCmd(QueuedCommand.LOAD, _arg1, _arg3, _arg2); return; }; this.execQueuedCmds(); }; this._autoPlay = false; this._load(_arg1, _arg2, _arg3); } flvplayback_internal function _load(_arg1:String, _arg2:Number, _arg3:Boolean):void{ this._prevVideoWidth = super.videoWidth; this._prevVideoHeight = super.videoHeight; this._autoResizeDone = false; this._cachedPlayheadTime = 0; this._bufferState = BUFFER_EMPTY; this._sawPlayStop = false; this._metadata = null; this._startingPlay = false; this._invalidSeekTime = false; this._invalidSeekRecovery = false; this._isLive = _arg3; this._contentPath = _arg1; this._currentPos = 0; this._streamLength = (((isNaN(_arg2)) || ((_arg2 <= 0)))) ? NaN : _arg2; this._atEnd = false; this._readyDispatched = false; this._lastUpdateTime = NaN; this.lastUpdateTimeStuckCount = 0; this._sawSeekNotify = false; this.waitingForEnough = false; this.baselineProgressTime = NaN; this.startProgressTime = NaN; this.totalDownloadTime = NaN; this.totalProgressTime = NaN; this._httpDoSeekCount = 0; this._updateTimeTimer.reset(); this._updateProgressTimer.reset(); this._idleTimeoutTimer.reset(); this._autoResizeTimer.reset(); this._rtmpDoStopAtEndTimer.reset(); this._rtmpDoSeekTimer.reset(); this._httpDoSeekTimer.reset(); this._finishAutoResizeTimer.reset(); this._delayedBufferingTimer.reset(); this.closeNS(false); if (this._ncMgr == null){ this.createINCManager(); }; var _local4:Boolean = this._ncMgr.connectToURL(this._contentPath); this.setState(VideoState.LOADING); this._cachedState = VideoState.LOADING; if (_local4){ this._createStream(); this._setUpStream(); }; if (!this._ncMgr.isRTMP){ this._updateProgressTimer.start(); }; } public function pause():void{ if (!this.isXnOK()){ if ((((((this._state == VideoState.CONNECTION_ERROR)) || ((this._ncMgr == null)))) || ((this._ncMgr.netConnection == null)))){ throw (new VideoError(VideoError.NO_CONNECTION)); }; return; } else { if (this._state == VideoState.EXEC_QUEUED_CMD){ this._state = this._cachedState; } else { if (!this.stateResponsive){ this.queueCmd(QueuedCommand.PAUSE); return; }; this.execQueuedCmds(); }; }; if ((((((this._state == VideoState.PAUSED)) || ((this._state == VideoState.STOPPED)))) || ((this._ns == null)))){ return; }; this._pause(true); this.setState(VideoState.PAUSED); } public function stop():void{ if (!this.isXnOK()){ if ((((((this._state == VideoState.CONNECTION_ERROR)) || ((this._ncMgr == null)))) || ((this._ncMgr.netConnection == null)))){ throw (new VideoError(VideoError.NO_CONNECTION)); }; return; } else { if (this._state == VideoState.EXEC_QUEUED_CMD){ this._state = this._cachedState; } else { if (!this.stateResponsive){ this.queueCmd(QueuedCommand.STOP); return; }; this.execQueuedCmds(); }; }; if ((((this._state == VideoState.STOPPED)) || ((this._ns == null)))){ return; }; if (this._ncMgr.isRTMP){ if (((this._autoRewind) && (!(this._isLive)))){ this._currentPos = 0; this._play(0, 0); this._state = VideoState.STOPPED; this.setState(VideoState.REWINDING); } else { this.closeNS(true); this.setState(VideoState.STOPPED); }; } else { this._pause(true); if (this._autoRewind){ this._seek(0); this._state = VideoState.STOPPED; this.setState(VideoState.REWINDING); } else { this.setState(VideoState.STOPPED); }; }; } public function seek(_arg1:Number):void{ if (this._invalidSeekTime){ return; }; if (((isNaN(_arg1)) || ((_arg1 < 0)))){ throw (new VideoError(VideoError.INVALID_SEEK)); }; if (!this.isXnOK()){ if ((((((this._state == VideoState.CONNECTION_ERROR)) || ((this._ncMgr == null)))) || ((this._ncMgr.netConnection == null)))){ throw (new VideoError(VideoError.NO_CONNECTION)); }; this.flushQueuedCmds(); this.queueCmd(QueuedCommand.SEEK, null, false, _arg1); this.setState(VideoState.LOADING); this._cachedState = VideoState.LOADING; this._ncMgr.reconnect(); return; } else { if (this._state == VideoState.EXEC_QUEUED_CMD){ this._state = this._cachedState; } else { if (!this.stateResponsive){ this.queueCmd(QueuedCommand.SEEK, null, false, _arg1); return; }; this.execQueuedCmds(); }; }; if (this._ns == null){ this._createStream(); }; if (((this._atEnd) && ((_arg1 < this.playheadTime)))){ this._atEnd = false; }; switch (this._state){ case VideoState.PLAYING: this._state = VideoState.BUFFERING; case VideoState.BUFFERING: case VideoState.PAUSED: this._seek(_arg1); this.setState(VideoState.SEEKING); break; case VideoState.STOPPED: if (this._ncMgr.isRTMP){ this._play(0); this._pause(true); }; this._seek(_arg1); this._state = VideoState.PAUSED; this.setState(VideoState.SEEKING); break; }; } public function close():void{ this.closeNS(true); if (((!((this._ncMgr == null))) && (this._ncMgr.isRTMP))){ this._ncMgr.close(); }; this.setState(VideoState.DISCONNECTED); dispatchEvent(new VideoEvent(VideoEvent.CLOSE, false, false, this._state, this.playheadTime)); } override public function set scaleX(_arg1:Number):void{ super.scaleX = _arg1; this._registrationWidth = width; switch (this._scaleMode){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: this.startAutoResize(); break; }; } override public function set scaleY(_arg1:Number):void{ super.scaleY = _arg1; this._registrationHeight = height; switch (this._scaleMode){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: this.startAutoResize(); break; }; } override public function set x(_arg1:Number):void{ var _local2:Number; if (this.x != _arg1){ _local2 = (_arg1 - this.x); super.x = _arg1; this._registrationX = (this._registrationX + _local2); }; } override public function set y(_arg1:Number):void{ var _local2:Number; if (this.y != _arg1){ _local2 = (_arg1 - this.y); super.y = _arg1; this._registrationY = (this._registrationY + _local2); }; } override public function set width(_arg1:Number):void{ super.width = (this._registrationWidth = _arg1); switch (this._scaleMode){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: this.startAutoResize(); break; default: super.width = _arg1; break; }; } override public function set height(_arg1:Number):void{ super.height = (this._registrationHeight = _arg1); switch (this._scaleMode){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: this.startAutoResize(); break; default: super.height = _arg1; break; }; } public function get registrationX():Number{ return (this._registrationX); } public function set registrationX(_arg1:Number):void{ var _local2:Number; if (this._registrationX != _arg1){ _local2 = (_arg1 - this._registrationX); this._registrationX = _arg1; this.x = (this.x + _local2); }; } public function get registrationY():Number{ return (this._registrationY); } public function set registrationY(_arg1:Number):void{ var _local2:Number; if (this._registrationY != _arg1){ _local2 = (_arg1 - this._registrationY); this._registrationY = _arg1; this.y = (this.y + _local2); }; } public function get registrationWidth():Number{ return (this._registrationWidth); } public function set registrationWidth(_arg1:Number):void{ this.width = _arg1; } public function get registrationHeight():Number{ return (this._registrationHeight); } public function set registrationHeight(_arg1:Number):void{ this.height = _arg1; } override public function get videoWidth():int{ if (this._videoWidth > 0){ return (this._videoWidth); }; if (((((!((this._metadata == null))) && (!(isNaN(this._metadata.width))))) && (!(isNaN(this._metadata.height))))){ if ((((this._metadata.width == this._metadata.height)) && (this._readyDispatched))){ return (super.videoWidth); }; return (int(this._metadata.width)); }; if (this._readyDispatched){ return (super.videoWidth); }; return (-1); } override public function get videoHeight():int{ if (this._videoHeight > 0){ return (this._videoHeight); }; if (((((!((this._metadata == null))) && (!(isNaN(this._metadata.width))))) && (!(isNaN(this._metadata.height))))){ if ((((this._metadata.width == this._metadata.height)) && (this._readyDispatched))){ return (super.videoHeight); }; return (int(this._metadata.height)); }; if (this._readyDispatched){ return (super.videoHeight); }; return (-1); } override public function get visible():Boolean{ if (!this._hiddenForResize){ this.__visible = super.visible; }; return (this.__visible); } override public function set visible(_arg1:Boolean):void{ this.__visible = _arg1; if (!this._hiddenForResize){ super.visible = this.__visible; }; } public function get align():String{ return (this._align); } public function set align(_arg1:String):void{ if (this._align != _arg1){ switch (_arg1){ case VideoAlign.CENTER: case VideoAlign.TOP: case VideoAlign.LEFT: case VideoAlign.BOTTOM: case VideoAlign.RIGHT: case VideoAlign.TOP_LEFT: case VideoAlign.TOP_RIGHT: case VideoAlign.BOTTOM_LEFT: case VideoAlign.BOTTOM_RIGHT: break; default: return; }; this._align = _arg1; switch (this._scaleMode){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: this.startAutoResize(); break; }; }; } public function get scaleMode():String{ return (this._scaleMode); } public function set scaleMode(_arg1:String):void{ if (this._scaleMode != _arg1){ switch (_arg1){ case VideoScaleMode.MAINTAIN_ASPECT_RATIO: case VideoScaleMode.NO_SCALE: case VideoScaleMode.EXACT_FIT: break; default: return; }; if ((((((this._scaleMode == VideoScaleMode.EXACT_FIT)) && (this._resizeImmediatelyOnMetadata))) && ((((this._videoWidth < 0)) || ((this._videoHeight < 0)))))){ this._resizeImmediatelyOnMetadata = false; }; this._scaleMode = _arg1; this.startAutoResize(); }; } public function get autoRewind():Boolean{ return (this._autoRewind); } public function set autoRewind(_arg1:Boolean):void{ this._autoRewind = _arg1; } public function get playheadTime():Number{ var _local1:Number = ((this._ns)==null) ? this._currentPos : this._ns.time; if (((!((this._metadata == null))) && (!((this._metadata.audiodelay == undefined))))){ _local1 = (_local1 - this._metadata.audiodelay); if (_local1 < 0){ _local1 = 0; }; }; return (_local1); } public function set playheadTime(_arg1:Number):void{ this.seek(_arg1); } public function get source():String{ return (this._contentPath); } public function get volume():Number{ return (this.soundTransform.volume); } public function set volume(_arg1:Number):void{ var _local2:SoundTransform = this.soundTransform; _local2.volume = _arg1; this.soundTransform = _local2; } public function get soundTransform():SoundTransform{ if (this._ns != null){ this._soundTransform = this._ns.soundTransform; }; var _local1:SoundTransform = new SoundTransform(); _local1.volume = (this._hiddenForResize) ? this._volume : this._soundTransform.volume; _local1.leftToLeft = this._soundTransform.leftToLeft; _local1.leftToRight = this._soundTransform.leftToRight; _local1.rightToLeft = this._soundTransform.rightToLeft; _local1.rightToRight = this._soundTransform.rightToRight; return (_local1); } public function set soundTransform(_arg1:SoundTransform):void{ if (_arg1 == null){ return; }; if (this._hiddenForResize){ this._volume = _arg1.volume; }; this._soundTransform = new SoundTransform(); this._soundTransform.volume = (this._hiddenForResize) ? 0 : _arg1.volume; this._soundTransform.leftToLeft = _arg1.leftToLeft; this._soundTransform.leftToRight = _arg1.leftToRight; this._soundTransform.rightToLeft = _arg1.rightToLeft; this._soundTransform.rightToRight = _arg1.rightToRight; if (this._ns != null){ this._ns.soundTransform = this._soundTransform; }; } public function get isRTMP():Boolean{ if (this._ncMgr == null){ return (false); }; return (this._ncMgr.isRTMP); } public function get isLive():Boolean{ return (this._isLive); } public function get state():String{ return (this._state); } public function get stateResponsive():Boolean{ switch (this._state){ case VideoState.STOPPED: case VideoState.PLAYING: case VideoState.PAUSED: case VideoState.BUFFERING: return (true); default: return (false); }; } public function get bytesLoaded():uint{ if ((((this._ns == null)) || (this._ncMgr.isRTMP))){ return (uint.MIN_VALUE); }; return (this._ns.bytesLoaded); } public function get bytesTotal():uint{ if ((((this._ns == null)) || (this._ncMgr.isRTMP))){ return (uint.MAX_VALUE); }; return (this._ns.bytesTotal); } public function get totalTime():Number{ return (this._streamLength); } public function get bufferTime():Number{ if (this._ns != null){ this._bufferTime = this._ns.bufferTime; }; return (this._bufferTime); } public function set bufferTime(_arg1:Number):void{ this._bufferTime = _arg1; if (this._ns != null){ this._ns.bufferTime = this._bufferTime; }; } public function get idleTimeout():Number{ return (this._idleTimeoutTimer.delay); } public function set idleTimeout(_arg1:Number):void{ this._idleTimeoutTimer.delay = _arg1; } public function get playheadUpdateInterval():Number{ return (this._updateTimeTimer.delay); } public function set playheadUpdateInterval(_arg1:Number):void{ this._updateTimeTimer.delay = _arg1; } public function get progressInterval():Number{ return (this._updateProgressTimer.delay); } public function set progressInterval(_arg1:Number):void{ this._updateProgressTimer.delay = _arg1; } public function get ncMgr():INCManager{ if (this._ncMgr == null){ this.createINCManager(); }; return (this._ncMgr); } public function get netConnection():NetConnection{ if (this._ncMgr != null){ return (this._ncMgr.netConnection); }; return (null); } public function get netStream():NetStream{ return (this._ns); } public function get metadata():Object{ return (this._metadata); } flvplayback_internal function doUpdateTime(_arg1:TimerEvent=null):void{ var _local2:Number = this.playheadTime; if (_local2 != this._atEndCheckPlayhead){ this._atEndCheckPlayhead = NaN; }; switch (this._state){ case VideoState.STOPPED: case VideoState.PAUSED: case VideoState.DISCONNECTED: case VideoState.CONNECTION_ERROR: this._updateTimeTimer.stop(); break; case VideoState.PLAYING: case VideoState.BUFFERING: if (((((((((!((this._ncMgr == null))) && (!(this._ncMgr.isRTMP)))) && ((this._lastUpdateTime == _local2)))) && (!((this._ns == null))))) && ((this._ns.bytesLoaded == this._ns.bytesTotal)))){ if (this.lastUpdateTimeStuckCount > this.lastUpdateTimeStuckCountMax){ this.lastUpdateTimeStuckCount = 0; this.httpDoStopAtEnd(); } else { this.lastUpdateTimeStuckCount++; }; }; }; if (this._lastUpdateTime != _local2){ dispatchEvent(new VideoEvent(VideoEvent.PLAYHEAD_UPDATE, false, false, this._state, _local2)); this._lastUpdateTime = _local2; this.lastUpdateTimeStuckCount = 0; }; } flvplayback_internal function doUpdateProgress(_arg1:TimerEvent):void{ if (this._ns == null){ return; }; var _local2:uint = this._ns.bytesLoaded; var _local3:uint = this._ns.bytesTotal; if (_local3 < uint.MAX_VALUE){ dispatchEvent(new VideoProgressEvent(VideoProgressEvent.PROGRESS, false, false, _local2, _local3)); }; if ((((((this._state == VideoState.DISCONNECTED)) || ((this._state == VideoState.CONNECTION_ERROR)))) || ((_local2 >= _local3)))){ this._updateProgressTimer.stop(); }; this.checkEnoughDownloaded(_local2, _local3); } flvplayback_internal function checkEnoughDownloaded(_arg1:uint, _arg2:uint):void{ if ((((_arg1 == 0)) || ((_arg2 == uint.MAX_VALUE)))){ return; }; if (((isNaN(this.totalTime)) || ((this.totalTime <= 0)))){ if (((this.waitingForEnough) && (this.stateResponsive))){ this.waitingForEnough = false; this._cachedState = this._state; this._state = VideoState.EXEC_QUEUED_CMD; this.play(); this.execQueuedCmds(); }; return; }; if (_arg1 >= _arg2){ if (this.waitingForEnough){ this.waitingForEnough = false; this._cachedState = this._state; this._state = VideoState.EXEC_QUEUED_CMD; this.play(); this.execQueuedCmds(); }; return; }; if (isNaN(this.baselineProgressTime)){ this.baselineProgressTime = ((_arg1 / _arg2) * this.totalTime); }; if (isNaN(this.startProgressTime)){ this.startProgressTime = getTimer(); } else { this.totalDownloadTime = ((getTimer() - this.startProgressTime) / 1000); this.totalProgressTime = ((_arg1 / _arg2) * this.totalTime); if (this.waitingForEnough){ this.checkReadyForPlay(_arg1, _arg2); }; }; } flvplayback_internal function checkReadyForPlay(_arg1:uint, _arg2:uint):void{ var _local3:Number; if (_arg1 >= _arg2){ this.waitingForEnough = false; this._cachedState = this._state; this._state = VideoState.EXEC_QUEUED_CMD; this.play(); this.execQueuedCmds(); return; }; if (isNaN(this.baselineProgressTime)){ return; }; if (((isNaN(this.totalTime)) || ((this.totalTime < 0)))){ this.waitingForEnough = false; this._cachedState = this._state; this._state = VideoState.EXEC_QUEUED_CMD; this.play(); this.execQueuedCmds(); } else { if (this.totalDownloadTime > 1.5){ _local3 = ((this.totalProgressTime - this.baselineProgressTime) / this.totalDownloadTime); if ((this.totalTime - this.playheadTime) > ((this.totalTime - this.totalProgressTime) / _local3)){ this.waitingForEnough = false; this._cachedState = this._state; this._state = VideoState.EXEC_QUEUED_CMD; this.play(); this.execQueuedCmds(); }; }; }; } flvplayback_internal function rtmpNetStatus(_arg1:NetStatusEvent):void{ if (this._state == VideoState.CONNECTION_ERROR){ return; }; switch (_arg1.info.code){ case "NetStream.Play.Stop": if (this._startingPlay){ return; }; switch (this._state){ case VideoState.RESIZING: if (this._hiddenForResize){ this.finishAutoResize(); }; break; case VideoState.LOADING: case VideoState.STOPPED: case VideoState.PAUSED: break; default: this._sawPlayStop = true; if (((!(this._rtmpDoStopAtEndTimer.running)) && ((((this._bufferState == BUFFER_FLUSH)) || ((((this._ns.bufferTime <= 0.1)) && ((this._ns.bufferLength <= 0.1)))))))){ this._cachedPlayheadTime = this.playheadTime; this._rtmpDoStopAtEndTimer.reset(); this._rtmpDoStopAtEndTimer.start(); }; break; }; break; case "NetStream.Buffer.Empty": switch (this._bufferState){ case BUFFER_FULL: if (this._sawPlayStop){ this.rtmpDoStopAtEnd(); } else { if (this._state == VideoState.PLAYING){ this.setState(VideoState.BUFFERING); }; }; break; }; this._bufferState = BUFFER_EMPTY; this._sawPlayStop = false; break; case "NetStream.Buffer.Flush": if (((this._sawSeekNotify) && ((this._state == VideoState.SEEKING)))){ this._bufferState = BUFFER_EMPTY; this._sawPlayStop = false; this.setStateFromCachedState(false); this.doUpdateTime(); this.execQueuedCmds(); }; if (((((!(this._rtmpDoStopAtEndTimer.running)) && (this._sawPlayStop))) && ((((this._bufferState == BUFFER_EMPTY)) || ((((this._ns.bufferTime <= 0.1)) && ((this._ns.bufferLength <= 0.1)))))))){ this._cachedPlayheadTime = this.playheadTime; this._rtmpDoStopAtEndTimer.reset(); this._rtmpDoStopAtEndTimer.start(); }; switch (this._bufferState){ case BUFFER_EMPTY: if (!this._hiddenForResize){ if ((((((this._state == VideoState.LOADING)) && ((this._cachedState == VideoState.PLAYING)))) || ((this._state == VideoState.BUFFERING)))){ this.setState(VideoState.PLAYING); } else { if (this._cachedState == VideoState.BUFFERING){ this._cachedState = VideoState.PLAYING; }; }; }; this._bufferState = BUFFER_FLUSH; break; default: if (this._state == VideoState.BUFFERING){ this.setStateFromCachedState(); }; break; }; break; case "NetStream.Buffer.Full": if (((this._sawSeekNotify) && ((this._state == VideoState.SEEKING)))){ this._bufferState = BUFFER_EMPTY; this._sawPlayStop = false; this.setStateFromCachedState(false); this.doUpdateTime(); this.execQueuedCmds(); }; switch (this._bufferState){ case BUFFER_EMPTY: this._bufferState = BUFFER_FULL; if (!this._hiddenForResize){ if ((((((this._state == VideoState.LOADING)) && ((this._cachedState == VideoState.PLAYING)))) || ((this._state == VideoState.BUFFERING)))){ this.setState(VideoState.PLAYING); } else { if (this._cachedState == VideoState.BUFFERING){ this._cachedState = VideoState.PLAYING; }; }; if (this._rtmpDoStopAtEndTimer.running){ this._sawPlayStop = true; this._rtmpDoStopAtEndTimer.reset(); }; }; break; case BUFFER_FLUSH: this._bufferState = BUFFER_FULL; if (this._rtmpDoStopAtEndTimer.running){ this._sawPlayStop = true; this._rtmpDoStopAtEndTimer.reset(); }; break; }; if (this._state == VideoState.BUFFERING){ this.setStateFromCachedState(); }; break; case "NetStream.Pause.Notify": if ((((this._state == VideoState.RESIZING)) && (this._hiddenForResize))){ this.finishAutoResize(); }; break; case "NetStream.Unpause.Notify": if (this._state == VideoState.PAUSED){ this._state = VideoState.PLAYING; this.setState(VideoState.BUFFERING); } else { this._cachedState = VideoState.PLAYING; }; break; case "NetStream.Play.Start": this._rtmpDoStopAtEndTimer.reset(); this._bufferState = BUFFER_EMPTY; this._sawPlayStop = false; if (this._startingPlay){ this._startingPlay = false; this._cachedPlayheadTime = this.playheadTime; } else { if (this._state == VideoState.PLAYING){ this.setState(VideoState.BUFFERING); }; }; break; case "NetStream.Play.Reset": this._rtmpDoStopAtEndTimer.reset(); if (this._state == VideoState.REWINDING){ this._rtmpDoSeekTimer.reset(); if ((((this.playheadTime == 0)) || ((this.playheadTime < this._cachedPlayheadTime)))){ this.setStateFromCachedState(); } else { this._cachedPlayheadTime = this.playheadTime; this._rtmpDoSeekTimer.start(); }; }; break; case "NetStream.Seek.Notify": if (this.playheadTime != this._cachedPlayheadTime){ this.setStateFromCachedState(false); this.doUpdateTime(); this.execQueuedCmds(); } else { this._sawSeekNotify = true; this._rtmpDoSeekTimer.start(); }; break; case "Netstream.Play.UnpublishNotify": break; case "Netstream.Play.PublishNotify": break; case "NetStream.Play.StreamNotFound": this.closeNS(false); if (!this._ncMgr.connectAgain()){ this.setState(VideoState.CONNECTION_ERROR); }; break; case "NetStream.Play.Failed": case "NetStream.Failed": case "NetStream.Play.FileStructureInvalid": case "NetStream.Play.NoSupportedTrackFound": this.setState(VideoState.CONNECTION_ERROR); break; }; } flvplayback_internal function httpNetStatus(_arg1:NetStatusEvent):void{ switch (_arg1.info.code){ case "NetStream.Play.Stop": this._delayedBufferingTimer.reset(); if (this._invalidSeekTime){ this._invalidSeekTime = false; this._invalidSeekRecovery = true; this.setState(this._cachedState); this.seek(this.playheadTime); } else { switch (this._state){ case VideoState.SEEKING: this.httpDoSeek(null); case VideoState.PLAYING: case VideoState.BUFFERING: this.httpDoStopAtEnd(); break; }; }; break; case "NetStream.Seek.InvalidTime": if (this._invalidSeekRecovery){ this._invalidSeekTime = false; this._invalidSeekRecovery = false; this.setState(this._cachedState); this.seek(0); } else { this._invalidSeekTime = true; this._httpDoSeekCount = 0; this._httpDoSeekTimer.start(); }; break; case "NetStream.Buffer.Empty": this._bufferState = BUFFER_EMPTY; if (this._state == VideoState.PLAYING){ this._delayedBufferingTimer.reset(); this._delayedBufferingTimer.start(); }; break; case "NetStream.Buffer.Full": case "NetStream.Buffer.Flush": this._delayedBufferingTimer.reset(); this._bufferState = BUFFER_FULL; if (!this._hiddenForResize){ if ((((((this._state == VideoState.LOADING)) && ((this._cachedState == VideoState.PLAYING)))) || ((this._state == VideoState.BUFFERING)))){ this.setState(VideoState.PLAYING); } else { if (this._cachedState == VideoState.BUFFERING){ this._cachedState = VideoState.PLAYING; }; }; }; break; case "NetStream.Seek.Notify": this._invalidSeekRecovery = false; switch (this._state){ case VideoState.SEEKING: case VideoState.REWINDING: this._httpDoSeekCount = 0; this._httpDoSeekTimer.start(); break; }; break; case "NetStream.Play.StreamNotFound": case "NetStream.Play.FileStructureInvalid": case "NetStream.Play.NoSupportedTrackFound": this.setState(VideoState.CONNECTION_ERROR); break; }; } public function ncConnected():void{ if ((((this._ncMgr == null)) || ((this._ncMgr.netConnection == null)))){ this.setState(VideoState.CONNECTION_ERROR); } else { if (this._ns == null){ this._createStream(); this._setUpStream(); }; }; } public function ncReconnected():void{ if ((((this._ncMgr == null)) || ((this._ncMgr.netConnection == null)))){ this.setState(VideoState.CONNECTION_ERROR); } else { this._ns = null; this._state = VideoState.STOPPED; this.execQueuedCmds(); }; } flvplayback_internal function onMetaData(_arg1:Object):void{ if (this._metadata != null){ return; }; this._metadata = _arg1; if (isNaN(this._streamLength)){ this._streamLength = _arg1.duration; }; if (((this._resizeImmediatelyOnMetadata) && (this._ns.client.ready))){ this._resizeImmediatelyOnMetadata = false; this._autoResizeTimer.reset(); this._autoResizeDone = false; this.doAutoResize(); }; dispatchEvent(new MetadataEvent(MetadataEvent.METADATA_RECEIVED, false, false, _arg1)); } flvplayback_internal function onCuePoint(_arg1:Object):void{ if (((!(this._hiddenForResize)) || (((!(isNaN(this._hiddenRewindPlayheadTime))) && ((this.playheadTime < this._hiddenRewindPlayheadTime)))))){ dispatchEvent(new MetadataEvent(MetadataEvent.CUE_POINT, false, false, _arg1)); }; } flvplayback_internal function setState(_arg1:String, _arg2:Boolean=true):void{ if (_arg1 == this._state){ return; }; this._hiddenRewindPlayheadTime = NaN; this._cachedState = this._state; this._cachedPlayheadTime = this.playheadTime; this._state = _arg1; var _local3:String = this._state; dispatchEvent(new VideoEvent(VideoEvent.STATE_CHANGE, false, false, _local3, this.playheadTime)); if (!this._readyDispatched){ switch (_local3){ case VideoState.STOPPED: case VideoState.PLAYING: case VideoState.PAUSED: case VideoState.BUFFERING: this._readyDispatched = true; dispatchEvent(new VideoEvent(VideoEvent.READY, false, false, _local3, this.playheadTime)); break; }; }; switch (this._cachedState){ case VideoState.REWINDING: dispatchEvent(new VideoEvent(VideoEvent.AUTO_REWOUND, false, false, _local3, this.playheadTime)); if (((this._ncMgr.isRTMP) && ((_local3 == VideoState.STOPPED)))){ this.closeNS(); }; break; }; switch (_local3){ case VideoState.STOPPED: case VideoState.PAUSED: if (this._ncMgr.isRTMP){ this._idleTimeoutTimer.reset(); this._idleTimeoutTimer.start(); }; break; case VideoState.SEEKING: case VideoState.REWINDING: this._bufferState = BUFFER_EMPTY; this._sawPlayStop = false; this._idleTimeoutTimer.reset(); break; case VideoState.PLAYING: case VideoState.BUFFERING: this._updateTimeTimer.start(); this._idleTimeoutTimer.reset(); break; case VideoState.LOADING: case VideoState.RESIZING: this._idleTimeoutTimer.reset(); break; }; if (_arg2){ this.execQueuedCmds(); }; } flvplayback_internal function setStateFromCachedState(_arg1:Boolean=true):void{ switch (this._cachedState){ case VideoState.PLAYING: case VideoState.PAUSED: case VideoState.BUFFERING: this.setState(this._cachedState, _arg1); break; default: this.setState(VideoState.STOPPED, _arg1); break; }; } flvplayback_internal function createINCManager():void{ var theClass:Class; try { if ((iNCManagerClass is String)){ theClass = Class(getDefinitionByName(String(iNCManagerClass))); } else { if ((iNCManagerClass is Class)){ theClass = Class(iNCManagerClass); }; }; } catch(e:Error) { theClass = null; }; if (theClass == null){ throw (new VideoError(VideoError.INCMANAGER_CLASS_UNSET, ((iNCManagerClass)==null) ? "null" : iNCManagerClass.toString())); }; this._ncMgr = new (theClass); this._ncMgr.videoPlayer = this; } flvplayback_internal function createNetStreamClient():Object{ var theClass:Class; var theInst:Object; try { if ((netStreamClientClass is String)){ theClass = Class(getDefinitionByName(String(netStreamClientClass))); } else { if ((netStreamClientClass is Class)){ theClass = Class(netStreamClientClass); }; }; if (theClass != null){ theInst = new theClass(this); }; } catch(e:Error) { theClass = null; theInst = null; }; if (theInst == null){ throw (new VideoError(VideoError.NETSTREAM_CLIENT_CLASS_UNSET, ((netStreamClientClass)==null) ? "null" : netStreamClientClass.toString())); }; return (theInst); } flvplayback_internal function rtmpDoStopAtEnd(_arg1:TimerEvent=null):void{ if (this._rtmpDoStopAtEndTimer.running){ switch (this._state){ case VideoState.DISCONNECTED: case VideoState.CONNECTION_ERROR: this._rtmpDoStopAtEndTimer.reset(); return; }; if ((((_arg1 == null)) || ((this._cachedPlayheadTime == this.playheadTime)))){ this._rtmpDoStopAtEndTimer.reset(); } else { this._cachedPlayheadTime = this.playheadTime; return; }; }; if ((((((((this._atEndCheckPlayhead == this.playheadTime)) && (!((this._atEndCheckPlayhead == this._lastSeekTime))))) && (!(this._isLive)))) && (!((this.playheadTime == 0))))){ this._atEnd = false; this._currentPos = 0; this._play(0); return; }; this._atEndCheckPlayhead = NaN; this._bufferState = BUFFER_EMPTY; this._sawPlayStop = false; this._atEnd = true; this.setState(VideoState.STOPPED); if (this._state != VideoState.STOPPED){ return; }; this.doUpdateTime(); if (this._state != VideoState.STOPPED){ return; }; dispatchEvent(new VideoEvent(VideoEvent.COMPLETE, false, false, this._state, this.playheadTime)); if (this._state != VideoState.STOPPED){ return; }; if (((((this._autoRewind) && (!(this._isLive)))) && (!((this.playheadTime == 0))))){ this._atEnd = false; this._currentPos = 0; this._play(0, 0); this.setState(VideoState.REWINDING); } else { this.closeNS(); }; } flvplayback_internal function rtmpDoSeek(_arg1:TimerEvent):void{ if (((!((this._state == VideoState.REWINDING))) && (!((this._state == VideoState.SEEKING))))){ this._rtmpDoSeekTimer.reset(); this._sawSeekNotify = false; } else { if (this.playheadTime != this._cachedPlayheadTime){ this._rtmpDoSeekTimer.reset(); this._sawSeekNotify = false; this.setStateFromCachedState(false); this.doUpdateTime(); this._lastSeekTime = this.playheadTime; this.execQueuedCmds(); }; }; } flvplayback_internal function httpDoStopAtEnd():void{ if ((((((this._atEndCheckPlayhead == this.playheadTime)) && (!((this._atEndCheckPlayhead == this._lastUpdateTime))))) && (!((this.playheadTime == 0))))){ this._atEnd = false; this._seek(0); return; }; this._atEndCheckPlayhead = NaN; this._atEnd = true; if (isNaN(this._streamLength)){ this._streamLength = this._ns.time; }; this._pause(true); this.setState(VideoState.STOPPED); if (this._state != VideoState.STOPPED){ return; }; this.doUpdateTime(); if (this._state != VideoState.STOPPED){ return; }; dispatchEvent(new VideoEvent(VideoEvent.COMPLETE, false, false, this._state, this.playheadTime)); if (this._state != VideoState.STOPPED){ return; }; if (this._autoRewind){ this._atEnd = false; this._pause(true); this._seek(0); this.setState(VideoState.REWINDING); }; } flvplayback_internal function httpDoSeek(_arg1:TimerEvent):void{ var _local2:Boolean = (((this._state == VideoState.REWINDING)) || ((this._state == VideoState.SEEKING))); if (((((_local2) && ((this._httpDoSeekCount < this.httpDoSeekMaxCount)))) && ((((this._cachedPlayheadTime == this.playheadTime)) || (this._invalidSeekTime))))){ this._httpDoSeekCount++; return; }; this._httpDoSeekCount = 0; this._httpDoSeekTimer.reset(); if (!_local2){ return; }; this.setStateFromCachedState(false); if (this._invalidSeekTime){ this._invalidSeekTime = false; this._invalidSeekRecovery = true; this.seek(this.playheadTime); } else { this.doUpdateTime(); this._lastSeekTime = this.playheadTime; this.execQueuedCmds(); }; } flvplayback_internal function closeNS(_arg1:Boolean=false):void{ if (this._ns != null){ if (_arg1){ this.doUpdateTime(); this._currentPos = this._ns.time; }; this._updateTimeTimer.reset(); this._updateProgressTimer.reset(); this._idleTimeoutTimer.reset(); this._autoResizeTimer.reset(); this._rtmpDoStopAtEndTimer.reset(); this._rtmpDoSeekTimer.reset(); this._httpDoSeekTimer.reset(); this._finishAutoResizeTimer.reset(); this._delayedBufferingTimer.reset(); this._ns.removeEventListener(NetStatusEvent.NET_STATUS, this.rtmpNetStatus); this._ns.removeEventListener(NetStatusEvent.NET_STATUS, this.httpNetStatus); this._ns.close(); this._ns = null; }; } flvplayback_internal function doDelayedBuffering(_arg1:TimerEvent):void{ switch (this._state){ case VideoState.LOADING: case VideoState.RESIZING: break; case VideoState.PLAYING: this._delayedBufferingTimer.reset(); if (((((((((!(isNaN(this.totalTime))) && ((this.totalTime > 0)))) && ((this.bytesLoaded > 0)))) && ((this.bytesLoaded < uint.MAX_VALUE)))) && ((this.bytesLoaded < this.bytesTotal)))){ this.pause(); if (this._state == VideoState.PAUSED){ this.waitingForEnough = true; this.playWhenEnoughDownloaded(); }; } else { this.setState(VideoState.BUFFERING); }; break; default: this._delayedBufferingTimer.reset(); break; }; } flvplayback_internal function _pause(_arg1:Boolean):void{ this._atEndCheckPlayhead = this.playheadTime; this._rtmpDoStopAtEndTimer.reset(); if (_arg1){ this._ns.pause(); } else { this._ns.resume(); }; } flvplayback_internal function _play(_arg1:int=0, _arg2:int=-1):void{ this.waitingForEnough = false; this._rtmpDoStopAtEndTimer.reset(); this._startingPlay = true; this._ns.play(this._ncMgr.streamName, (this._isLive) ? -1 : _arg1, _arg2); } flvplayback_internal function _seek(_arg1:Number):void{ this._rtmpDoStopAtEndTimer.reset(); if (((((!((this._metadata == null))) && (!((this._metadata.audiodelay == undefined))))) && (((isNaN(this._streamLength)) || (((_arg1 + this._metadata.audiodelay) < this._streamLength)))))){ _arg1 = (_arg1 + this._metadata.audiodelay); }; this._ns.seek(_arg1); this._lastSeekTime = _arg1; this._invalidSeekTime = false; this._bufferState = BUFFER_EMPTY; this._sawPlayStop = false; this._sawSeekNotify = false; } flvplayback_internal function isXnOK():Boolean{ if (this._state == VideoState.LOADING){ return (true); }; if (this._state == VideoState.CONNECTION_ERROR){ return (false); }; if (this._state != VideoState.DISCONNECTED){ if ((((((this._ncMgr == null)) || ((this._ncMgr.netConnection == null)))) || (((this._ncMgr.isRTMP) && (!(this._ncMgr.netConnection.connected)))))){ this.setState(VideoState.DISCONNECTED); return (false); }; return (true); }; return (false); } flvplayback_internal function startAutoResize():void{ switch (this._state){ case VideoState.DISCONNECTED: case VideoState.CONNECTION_ERROR: return; default: if (this._ns == null){ return; }; this._autoResizeDone = false; if (((this.stateResponsive) && (((((((((!((super.videoWidth == 0))) || (!((super.videoHeight == 0))))) || ((this._bufferState == BUFFER_FULL)))) || ((this._bufferState == BUFFER_FLUSH)))) || ((this._ns.time > this.autoResizePlayheadTimeout)))))){ this.doAutoResize(); } else { this._autoResizeTimer.reset(); this._autoResizeTimer.start(); }; break; }; } flvplayback_internal function doAutoResize(_arg1:TimerEvent=null):void{ var _local3:int; var _local4:int; var _local5:Number; var _local6:Number; if (this._autoResizeTimer.running){ switch (this._state){ case VideoState.RESIZING: case VideoState.LOADING: break; case VideoState.DISCONNECTED: case VideoState.CONNECTION_ERROR: this._autoResizeTimer.reset(); return; default: if (!this.stateResponsive){ return; }; }; if (((((((((!((super.videoWidth == this._prevVideoWidth))) || (!((super.videoHeight == this._prevVideoHeight))))) || ((this._bufferState == BUFFER_FULL)))) || ((this._bufferState == BUFFER_FLUSH)))) || ((this._ns.time > this.autoResizePlayheadTimeout)))){ if (((((this._hiddenForResize) && (!(this._ns.client.ready)))) && ((this._hiddenForResizeMetadataDelay < this.autoResizeMetadataDelayMax)))){ this._hiddenForResizeMetadataDelay++; return; }; this._autoResizeTimer.reset(); } else { return; }; }; if (this._autoResizeDone){ this.setState(this._cachedState); return; }; this.oldBounds = new Rectangle(x, y, width, height); this.oldRegistrationBounds = new Rectangle(this.registrationX, this.registrationY, this.registrationWidth, this.registrationHeight); this._autoResizeDone = true; var _local2:Boolean = this._readyDispatched; this._readyDispatched = true; _local3 = this.videoWidth; _local4 = this.videoHeight; this._readyDispatched = _local2; switch (this._scaleMode){ case VideoScaleMode.NO_SCALE: super.width = Math.round(_local3); super.height = Math.round(_local4); break; case VideoScaleMode.EXACT_FIT: super.width = this.registrationWidth; super.height = this.registrationHeight; break; case VideoScaleMode.MAINTAIN_ASPECT_RATIO: default: _local5 = ((_local3 * this._registrationHeight) / _local4); _local6 = ((_local4 * this._registrationWidth) / _local3); if (_local6 < this._registrationHeight){ super.width = this._registrationWidth; super.height = _local6; } else { if (_local5 < this._registrationWidth){ super.width = _local5; super.height = this._registrationHeight; } else { super.width = this._registrationWidth; super.height = this._registrationHeight; }; }; }; switch (this._align){ case VideoAlign.CENTER: case VideoAlign.TOP: case VideoAlign.BOTTOM: default: super.x = Math.round((this._registrationX + ((this._registrationWidth - width) / 2))); break; case VideoAlign.LEFT: case VideoAlign.TOP_LEFT: case VideoAlign.BOTTOM_LEFT: super.x = Math.round(this._registrationX); break; case VideoAlign.RIGHT: case VideoAlign.TOP_RIGHT: case VideoAlign.BOTTOM_RIGHT: super.x = Math.round((this._registrationX + (this._registrationWidth - width))); break; }; switch (this._align){ case VideoAlign.CENTER: case VideoAlign.LEFT: case VideoAlign.RIGHT: default: super.y = Math.round((this._registrationY + ((this._registrationHeight - height) / 2))); break; case VideoAlign.TOP: case VideoAlign.TOP_LEFT: case VideoAlign.TOP_RIGHT: super.y = Math.round(this._registrationY); break; case VideoAlign.BOTTOM: case VideoAlign.BOTTOM_LEFT: case VideoAlign.BOTTOM_RIGHT: super.y = Math.round((this._registrationY + (this._registrationHeight - height))); break; }; if (this._hiddenForResize){ this._hiddenRewindPlayheadTime = this.playheadTime; if (this._state == VideoState.LOADING){ this._cachedState = VideoState.PLAYING; }; if (!this._ncMgr.isRTMP){ this._pause(true); this._seek(0); this._finishAutoResizeTimer.reset(); this._finishAutoResizeTimer.start(); } else { if (!this._isLive){ this._currentPos = 0; this._play(0, 0); this.setState(VideoState.RESIZING); } else { if (this._autoPlay){ this._finishAutoResizeTimer.reset(); this._finishAutoResizeTimer.start(); } else { this.finishAutoResize(); }; }; }; } else { dispatchEvent(new AutoLayoutEvent(AutoLayoutEvent.AUTO_LAYOUT, false, false, this.oldBounds, this.oldRegistrationBounds)); }; } flvplayback_internal function finishAutoResize(_arg1:TimerEvent=null):void{ if (this.stateResponsive){ return; }; this._hiddenForResize = false; super.visible = this.__visible; this.volume = this._volume; dispatchEvent(new AutoLayoutEvent(AutoLayoutEvent.AUTO_LAYOUT, false, false, this.oldBounds, this.oldRegistrationBounds)); if (this._autoPlay){ if (this._ncMgr.isRTMP){ if (!this._isLive){ this._currentPos = 0; this._play(0); }; if (this._state == VideoState.RESIZING){ this.setState(VideoState.LOADING); this._cachedState = VideoState.PLAYING; }; } else { this.waitingForEnough = true; this._cachedState = this._state; this._state = VideoState.PAUSED; this.checkReadyForPlay(this.bytesLoaded, this.bytesTotal); if (this.waitingForEnough){ this._state = this._cachedState; this.setState(VideoState.PAUSED); } else { this._cachedState = VideoState.PLAYING; }; }; } else { this.setState(VideoState.STOPPED); }; } flvplayback_internal function _createStream():void{ this._ns = null; var _local1:NetStream = new NetStream(this._ncMgr.netConnection); if (this._ncMgr.isRTMP){ _local1.addEventListener(NetStatusEvent.NET_STATUS, this.rtmpNetStatus); } else { _local1.addEventListener(NetStatusEvent.NET_STATUS, this.httpNetStatus); }; _local1.client = this.createNetStreamClient(); _local1.bufferTime = this._bufferTime; _local1.soundTransform = this.soundTransform; this._ns = _local1; attachNetStream(this._ns); } flvplayback_internal function _setUpStream():void{ if (((!(isNaN(this._ncMgr.streamLength))) && ((this._ncMgr.streamLength >= 0)))){ this._streamLength = this._ncMgr.streamLength; }; this._videoWidth = ((this._ncMgr.streamWidth)>=0) ? this._ncMgr.streamWidth : -1; this._videoHeight = ((this._ncMgr.streamHeight)>=0) ? this._ncMgr.streamHeight : -1; this._resizeImmediatelyOnMetadata = (((((this._videoWidth >= 0)) && ((this._videoHeight >= 0)))) || ((this._scaleMode == VideoScaleMode.EXACT_FIT))); if (!this._hiddenForResize){ this.__visible = super.visible; super.visible = false; this._volume = this.volume; this.volume = 0; this._hiddenForResize = true; }; this._hiddenForResizeMetadataDelay = 0; this._play(0); if (this._currentPos > 0){ this._seek(this._currentPos); this._currentPos = 0; }; this._autoResizeTimer.reset(); this._autoResizeTimer.start(); } flvplayback_internal function doIdleTimeout(_arg1:TimerEvent):void{ this.close(); } flvplayback_internal function flushQueuedCmds():void{ while (this._cmdQueue.length > 0) { this._cmdQueue.pop(); }; } flvplayback_internal function execQueuedCmds():void{ var nextCmd:Object; while ((((((this._cmdQueue.length > 0)) && (((((this.stateResponsive) || ((this._state == VideoState.DISCONNECTED)))) || ((this._state == VideoState.CONNECTION_ERROR)))))) && (((!((this._cmdQueue[0].url == null))) || (((!((this._state == VideoState.DISCONNECTED))) && (!((this._state == VideoState.CONNECTION_ERROR))))))))) { try { nextCmd = this._cmdQueue.shift(); this._cachedState = this._state; this._state = VideoState.EXEC_QUEUED_CMD; switch (nextCmd.type){ case QueuedCommand.PLAY: this.play(nextCmd.url, nextCmd.time, nextCmd.isLive); break; case QueuedCommand.LOAD: this.load(nextCmd.url, nextCmd.time, nextCmd.isLive); break; case QueuedCommand.PAUSE: this.pause(); break; case QueuedCommand.STOP: this.stop(); break; case QueuedCommand.SEEK: this.seek(nextCmd.time); break; case QueuedCommand.PLAY_WHEN_ENOUGH: this.playWhenEnoughDownloaded(); break; }; } finally { if (this._state == VideoState.EXEC_QUEUED_CMD){ this._state = this._cachedState; }; }; }; } flvplayback_internal function queueCmd(_arg1:Number, _arg2:String=null, _arg3:Boolean=false, _arg4:Number=NaN):void{ this._cmdQueue.push(new QueuedCommand(_arg1, _arg2, _arg3, _arg4)); } } }//package fl.video
Section 27
//VideoPlayerClient (fl.video.VideoPlayerClient) package fl.video { public dynamic class VideoPlayerClient { protected var _owner:VideoPlayer; protected var gotMetadata:Boolean; public function VideoPlayerClient(_arg1:VideoPlayer){ this._owner = _arg1; this.gotMetadata = false; } public function get owner():VideoPlayer{ return (this._owner); } public function onMetaData(_arg1:Object, ... _args):void{ _arg1.duration; _arg1.width; _arg1.height; this._owner.onMetaData(_arg1); this.gotMetadata = true; } public function onCuePoint(_arg1:Object, ... _args):void{ _arg1.name; _arg1.time; _arg1.type; this._owner.onCuePoint(_arg1); } public function get ready():Boolean{ return (this.gotMetadata); } } }//package fl.video
Section 28
//VideoPlayerState (fl.video.VideoPlayerState) package fl.video { public class VideoPlayerState { public var owner:VideoPlayer; public var index:int; public var url:String; public var isLive:Boolean; public var isLiveSet:Boolean; public var totalTime:Number; public var totalTimeSet:Boolean; public var autoPlay:Boolean; public var isWaiting:Boolean; public var prevState:String; public var minProgressPercent:Number; public var preSeekTime:Number; public var cmdQueue:Array; public function VideoPlayerState(_arg1:VideoPlayer, _arg2:int){ this.owner = _arg1; this.index = _arg2; this.url = ""; this.isLive = false; this.isLiveSet = true; this.totalTime = NaN; this.totalTimeSet = true; this.autoPlay = (_arg2 == 0); this.isWaiting = false; this.preSeekTime = NaN; this.cmdQueue = null; } } }//package fl.video
Section 29
//VideoProgressEvent (fl.video.VideoProgressEvent) package fl.video { import flash.events.*; public class VideoProgressEvent extends ProgressEvent implements IVPEvent { private var _vp:uint; public static const PROGRESS:String = "progress"; public function VideoProgressEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:uint=0, _arg5:uint=0, _arg6:uint=0){ super(_arg1, _arg2, _arg3, _arg4, _arg5); this._vp = _arg6; } public function get vp():uint{ return (this._vp); } public function set vp(_arg1:uint):void{ this._vp = _arg1; } override public function clone():Event{ return (new VideoProgressEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, this.vp)); } } }//package fl.video
Section 30
//VideoScaleMode (fl.video.VideoScaleMode) package fl.video { public final class VideoScaleMode { public static const MAINTAIN_ASPECT_RATIO:String = "maintainAspectRatio"; public static const NO_SCALE:String = "noScale"; public static const EXACT_FIT:String = "exactFit"; } }//package fl.video
Section 31
//VideoState (fl.video.VideoState) package fl.video { public final class VideoState { public static const DISCONNECTED:String = "disconnected"; public static const STOPPED:String = "stopped"; public static const PLAYING:String = "playing"; public static const PAUSED:String = "paused"; public static const BUFFERING:String = "buffering"; public static const LOADING:String = "loading"; public static const CONNECTION_ERROR:String = "connectionError"; public static const REWINDING:String = "rewinding"; public static const SEEKING:String = "seeking"; public static const RESIZING:String = "resizing"; flvplayback_internal static var EXEC_QUEUED_CMD:String = "execQueuedCmd"; } }//package fl.video
Section 32
//VolumeBarAccImpl (fl.video.VolumeBarAccImpl) package fl.video { import flash.display.*; import flash.events.*; import flash.utils.*; import flash.accessibility.*; public class VolumeBarAccImpl extends AccessibilityImplementation { protected var master:Sprite; protected var role:uint; private var _vc:FLVPlayback; private static const STATE_SYSTEM_NORMAL:uint = 0; private static const STATE_SYSTEM_FOCUSABLE:uint = 0x100000; private static const STATE_SYSTEM_FOCUSED:uint = 4; private static const STATE_SYSTEM_SELECTABLE:uint = 0x200000; private static const STATE_SYSTEM_SELECTED:uint = 2; private static const STATE_SYSTEM_UNAVAILABLE:uint = 1; private static const EVENT_OBJECT_FOCUS:uint = 32773; private static const EVENT_OBJECT_VALUECHANGE:uint = 32782; private static const EVENT_OBJECT_SELECTION:uint = 32774; private static const EVENT_OBJECT_LOCATIONCHANGE:uint = 32779; private static const ROLE_WINDOW:uint = 9; private static const ROLE_SLIDER:uint = 51; private static const ROLE_SYSTEM_INDICATOR:uint = 39; private static const ROLE_SYSTEM_PUSHBUTTON:uint = 43; public function VolumeBarAccImpl(_arg1:Sprite){ var n:int; var i:int; var sprite = _arg1; super(); stub = false; this.master = sprite; if (!this.master.accessibilityProperties){ this.master.accessibilityProperties = new AccessibilityProperties(); }; this.master.accessibilityProperties.forceSimple = true; var events:Array = this.eventsToHandle; if (events){ n = events.length; i = 0; while (i < n) { this.master.addEventListener(events[i], this.eventHandler); i = (i + 1); }; }; this.master.addEventListener(FocusEvent.FOCUS_IN, this.focusInHandler); try { this._vc = Object(this.master).uiMgr._vc; this._vc.addEventListener(SoundEvent.SOUND_UPDATE, this.eventHandler); } catch(e:Error) { }; this.role = VolumeBarAccImpl.ROLE_SLIDER; } protected function get eventsToHandle():Array{ return ([]); } override public function get_accRole(_arg1:uint):uint{ if (_arg1 == 0){ return (this.role); }; if (_arg1 == 2){ return (ROLE_SYSTEM_INDICATOR); }; return (ROLE_SYSTEM_PUSHBUTTON); } override public function get_accName(_arg1:uint):String{ var _local2 = ""; if ((((((((_arg1 == 0)) && (this.master.accessibilityProperties))) && (this.master.accessibilityProperties.name))) && (!((this.master.accessibilityProperties.name == ""))))){ _local2 = (_local2 + (this.master.accessibilityProperties.name + " ")); }; _local2 = (_local2 + (this.getName(_arg1) + this.getStatusName())); return ((((!((_local2 == null))) && (!((_local2 == ""))))) ? _local2 : null); } override public function get_accValue(_arg1:uint):String{ var _local2:Number; if (_arg1 == 0){ _local2 = (Math.round((this._vc.volume * 10000)) / 100); return ((String(_local2) + "%")); }; return (null); } protected function getName(_arg1:uint):String{ var _local2 = ""; switch (_arg1){ case 1: _local2 = "Page Left"; break; case 2: _local2 = "Position"; break; case 3: _local2 = "Page Right"; break; case 0: _local2 = ""; break; }; return (_local2); } override public function getChildIDArray():Array{ var _local1:Array = []; var _local2:uint; while (_local2 < 3) { _local1[_local2] = (_local2 + 1); _local2++; }; return (_local1); } override public function accLocation(_arg1:uint){ var _local7:DisplayObject; var _local2:Object = this.master; var _local3:UIManager = (this._vc.uiMgr as UIManager); var _local4:DisplayObject = (_local3.controls[UIManager.VOLUME_BAR] as DisplayObject); var _local5:Dictionary = (UIManager(_local3).ctrlDataDict as Dictionary); var _local6:ControlData = _local5[_local4]; if (_local5[_local6.fullness_mc].mask_mc){ _local7 = DisplayObject(_local5[_local6.fullness_mc].mask_mc); }; switch (_arg1){ case 1: case 3: if (_local7){ _local2 = _local7; }; break; default: break; }; return (_local2); } override public function get_accState(_arg1:uint):uint{ var _local2:uint = this.getState(_arg1); return (_local2); } protected function getState(_arg1:uint):uint{ var _local2:uint = STATE_SYSTEM_NORMAL; if (_arg1 == 0){ if (((!(this.master.mouseEnabled)) || (!(this.master.tabEnabled)))){ _local2 = (_local2 | STATE_SYSTEM_UNAVAILABLE); } else { _local2 = (_local2 | STATE_SYSTEM_FOCUSABLE); }; if (Sprite(this.master).stage.focus == this.master){ _local2 = (_local2 | STATE_SYSTEM_FOCUSED); }; }; return (_local2); } override public function get_accDefaultAction(_arg1:uint):String{ if ((((_arg1 == 1)) || ((_arg1 == 3)))){ return ("Press"); }; return (null); } override public function accDoDefaultAction(_arg1:uint):void{ var _local2:UIManager = (this._vc.uiMgr as UIManager); var _local3:Boolean = _local2._isMuted; var _local4:Number = (_local3) ? (Math.round((_local2.cachedSoundLevel * 1000)) / 100) : (Math.round((this._vc.volume * 1000)) / 100); if (_arg1 == 1){ if (Math.floor(_local4) != _local4){ this._vc.volume = (Math.floor(_local4) / 10); } else { this._vc.volume = Math.max(0, ((_local4 - 1) / 10)); }; } else { if (_arg1 == 3){ if (Math.round(_local4) != _local4){ this._vc.volume = (Math.round(_local4) / 10); } else { this._vc.volume = Math.min(1, ((_local4 + 1) / 10)); }; }; }; _local2.cachedSoundLevel = this._vc.volume; if (_local3){ _local2._isMuted = true; _local2.cachedSoundLevel = this._vc.volume; this._vc.volume = 0; _local2.setEnabledAndVisibleForState(UIManager.MUTE_OFF_BUTTON, VideoState.PLAYING); _local2.skinButtonControl(_local2.controls[UIManager.MUTE_OFF_BUTTON]); _local2.setEnabledAndVisibleForState(UIManager.MUTE_ON_BUTTON, VideoState.PLAYING); _local2.skinButtonControl(_local2.controls[UIManager.MUTE_ON_BUTTON]); }; } private function getStatusName():String{ return (""); } protected function eventHandler(_arg1:Event):void{ if (_arg1.type == SoundEvent.SOUND_UPDATE){ if (Accessibility.active){ Accessibility.sendEvent(this.master, 0, EVENT_OBJECT_SELECTION); Accessibility.sendEvent(this.master, 0, EVENT_OBJECT_VALUECHANGE, true); }; }; } private function focusInHandler(_arg1:Event):void{ if (Accessibility.active){ Accessibility.sendEvent(this.master, 0, EVENT_OBJECT_FOCUS); Accessibility.sendEvent(this.master, 0, EVENT_OBJECT_VALUECHANGE, true); }; } public static function createAccessibilityImplementation(_arg1:Sprite):void{ _arg1.accessibilityImplementation = new VolumeBarAccImpl(_arg1); } public static function enableAccessibility():void{ } } }//package fl.video
Section 33
//errorMC (errorMC) package { import flash.display.*; public dynamic class errorMC extends MovieClip { } }//package
Section 34
//FLVPlay (FLVPlay) package { import fl.video.*; import flash.display.*; import flash.events.*; import flash.utils.*; import flash.system.*; public class FLVPlay extends MovieClip { public var LoadingMC:MovieClip; public var player:FLVPlayback; public var __setPropDict:Dictionary; var previewImage; var HitBox; var errorTimer:int;// = 0 var errorSeconds:int;// = 20 public function FLVPlay(){ __setPropDict = new Dictionary(true); super(); addFrameScript(0, frame1, 1, frame2, 2, frame3); previewImage = new PreviewImage(); addChild(previewImage); HitBox = new hitBox(); addChild(HitBox); HitBox.addEventListener(MouseEvent.CLICK, removePreview); Security.allowDomain("*"); } private function removePreview(_arg1:MouseEvent):void{ stage.removeEventListener(MouseEvent.CLICK, removePreview); stage.addEventListener(Event.ENTER_FRAME, onTick); removeChild(previewImage); removeChild(HitBox); play(); } private function onTick(_arg1:Event):void{ var _local3:*; var _local2:* = (errorSeconds * stage.frameRate); errorTimer++; if (errorTimer >= _local2){ stage.removeEventListener(Event.ENTER_FRAME, onTick); removeChild(LoadingMC); _local3 = new errorMC(); addChildAt(_local3, 0); }; } function __setProp_player_Scene1_Layer1_1(){ if ((((__setPropDict[player] == undefined)) || (!((int(__setPropDict[player]) == 2))))){ __setPropDict[player] = 2; try { player["componentInspectorSetting"] = true; } catch(e:Error) { }; player.align = "center"; player.autoPlay = true; player.isLive = false; player.scaleMode = "maintainAspectRatio"; player.skin = "http://www.taurinfox.com/animations/FLVSkin02.swf"; player.skinAutoHide = true; player.skinBackgroundAlpha = 0.85; player.skinBackgroundColor = 1711164; player.source = "http://www.taurinfox.com/animations/fox-in-the-stable.mp4"; player.volume = 0.75; try { player["componentInspectorSetting"] = false; } catch(e:Error) { }; }; } function frame1(){ stop(); } function frame2(){ __setProp_player_Scene1_Layer1_1(); stop(); Security.allowDomain("*"); } function frame3(){ stop(); } Security.allowDomain("*"); } }//package
Section 35
//hitBox (hitBox) package { import flash.display.*; public dynamic class hitBox extends SimpleButton { } }//package
Section 36
//PreviewImage (PreviewImage) package { import flash.display.*; public dynamic class PreviewImage extends MovieClip { } }//package

Library Items

Symbol 1 BitmapUsed by:2
Symbol 2 GraphicUses:1Used by:3
Symbol 3 MovieClip {PreviewImage}Uses:2
Symbol 4 GraphicUsed by:5
Symbol 5 Button {hitBox}Uses:4
Symbol 6 FontUsed by:7 17 20 21
Symbol 7 TextUses:6Used by:8
Symbol 8 MovieClip {errorMC}Uses:7
Symbol 9 GraphicUsed by:10
Symbol 10 MovieClipUses:9Used by:14
Symbol 11 BitmapUsed by:12
Symbol 12 GraphicUses:11Used by:13
Symbol 13 MovieClip {fl.video.Icon}Uses:12Used by:14
Symbol 14 MovieClip {fl.video.FLVPlayback}Uses:10 13Used by:Timeline
Symbol 15 GraphicUsed by:16
Symbol 16 MovieClipUses:15Used by:22
Symbol 17 TextUses:6Used by:18
Symbol 18 MovieClipUses:17Used by:19
Symbol 19 MovieClipUses:18Used by:22
Symbol 20 TextUses:6Used by:22
Symbol 21 TextUses:6Used by:22
Symbol 22 MovieClipUses:16 19 20 21Used by:Timeline
Symbol 23 BitmapUsed by:25
Symbol 24 BitmapUsed by:25
Symbol 25 GraphicUses:23 24Used by:Timeline

Instance Names

"LoadingMC"Frame 1Symbol 22 MovieClip
"player"Frame 2Symbol 14 MovieClip {fl.video.FLVPlayback}
"boundingBox_mc"Symbol 14 MovieClip {fl.video.FLVPlayback} Frame 1Symbol 10 MovieClip

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata not present, AS3.




http://swfchan.com/21/102314/info.shtml
Created: 4/11 -2018 12:22:37 Last modified: 4/11 -2018 12:22:37 Server time: 09/08 -2020 02:06:27