home *** CD-ROM | disk | FTP | other *** search
/ Freelog 115 / FreelogNo115-MaiJuin2013.iso / Internet / Free Download Manager / fdminst.exe / {app} / player.swf / scripts / __Packages / mx / video / FLVPlayback.as < prev    next >
Encoding:
Text File  |  2012-08-12  |  50.9 KB  |  1,704 lines

  1. class mx.video.FLVPlayback extends MovieClip
  2. {
  3.    var _autoPlay;
  4.    var _autoRewind;
  5.    var _autoSize;
  6.    var _bufferTime;
  7.    var _contentPath;
  8.    var _cuePoints;
  9.    var _idleTimeout;
  10.    var _isLive;
  11.    var _aspectRatio;
  12.    var _seekToPrevOffset;
  13.    var _playheadUpdateInterval;
  14.    var _progressInterval;
  15.    var _totalTime;
  16.    var _transform;
  17.    var _volume;
  18.    var _skinAutoHide;
  19.    var _bufferingBarHides;
  20.    var _origHeight;
  21.    var _prevHeight;
  22.    var __height;
  23.    var _origWidth;
  24.    var _prevWidth;
  25.    var __width;
  26.    var _scaleX;
  27.    var _scaleY;
  28.    var _preSeekTime;
  29.    var _firstStreamReady;
  30.    var _firstStreamShown;
  31.    var _activeVP;
  32.    var _visibleVP;
  33.    var _topVP;
  34.    var _vp;
  35.    var _vpState;
  36.    var _cpMgr;
  37.    var boundingBox_mc;
  38.    var preview_mc;
  39.    var dispatchEvent;
  40.    var _uiMgr;
  41.    var playheadTime;
  42.    var _bufferingBar;
  43.    var _backButton;
  44.    var _forwardButton;
  45.    var _muteButton;
  46.    var _pauseButton;
  47.    var _playButton;
  48.    var _playPauseButton;
  49.    var _seekBar;
  50.    var _seekBarInterval;
  51.    var _seekBarScrubTolerance;
  52.    var _skin;
  53.    var _stopButton;
  54.    var _volumeBar;
  55.    var _volumeBarInterval;
  56.    var _volumeBarScrubTolerance;
  57.    static var version = "1.0.0.103";
  58.    static var DISCONNECTED = "disconnected";
  59.    static var STOPPED = "stopped";
  60.    static var PLAYING = "playing";
  61.    static var PAUSED = "paused";
  62.    static var BUFFERING = "buffering";
  63.    static var LOADING = "loading";
  64.    static var CONNECTION_ERROR = "connectionError";
  65.    static var REWINDING = "rewinding";
  66.    static var SEEKING = "seeking";
  67.    static var ALL = "all";
  68.    static var EVENT = "event";
  69.    static var NAVIGATION = "navigation";
  70.    static var FLV = "flv";
  71.    static var ACTIONSCRIPT = "actionscript";
  72.    static var VP_DEPTH_OFFSET = 100;
  73.    static var SEEK_TO_PREV_OFFSET_DEFAULT = 1;
  74.    function FLVPlayback()
  75.    {
  76.       super();
  77.       mx.events.EventDispatcher.initialize(this);
  78.       if(this._autoPlay == undefined)
  79.       {
  80.          this._autoPlay = true;
  81.       }
  82.       if(this._autoRewind == undefined)
  83.       {
  84.          this._autoRewind = true;
  85.       }
  86.       if(this._autoSize == undefined)
  87.       {
  88.          this._autoSize = false;
  89.       }
  90.       if(this._bufferTime == undefined)
  91.       {
  92.          this._bufferTime = 0.1;
  93.       }
  94.       if(this._contentPath == undefined)
  95.       {
  96.          this._contentPath = "";
  97.       }
  98.       if(this._cuePoints == undefined)
  99.       {
  100.          this._cuePoints = null;
  101.       }
  102.       if(this._idleTimeout == undefined)
  103.       {
  104.          this._idleTimeout = mx.video.VideoPlayer.DEFAULT_IDLE_TIMEOUT_INTERVAL;
  105.       }
  106.       if(this._isLive == undefined)
  107.       {
  108.          this._isLive = false;
  109.       }
  110.       if(this._aspectRatio == undefined)
  111.       {
  112.          this._aspectRatio = true;
  113.       }
  114.       if(this._seekToPrevOffset == undefined)
  115.       {
  116.          this._seekToPrevOffset = mx.video.FLVPlayback.SEEK_TO_PREV_OFFSET_DEFAULT;
  117.       }
  118.       if(this._playheadUpdateInterval == undefined)
  119.       {
  120.          this._playheadUpdateInterval = mx.video.VideoPlayer.DEFAULT_UPDATE_PROGRESS_INTERVAL;
  121.       }
  122.       if(this._progressInterval == undefined)
  123.       {
  124.          this._progressInterval = mx.video.VideoPlayer.DEFAULT_UPDATE_TIME_INTERVAL;
  125.       }
  126.       if(this._totalTime == undefined)
  127.       {
  128.          this._totalTime = 0;
  129.       }
  130.       if(this._transform == undefined)
  131.       {
  132.          this._transform = null;
  133.       }
  134.       if(this._volume == undefined)
  135.       {
  136.          this._volume = 100;
  137.       }
  138.       if(this._skinAutoHide == undefined)
  139.       {
  140.          this._skinAutoHide = false;
  141.       }
  142.       if(this._bufferingBarHides == undefined)
  143.       {
  144.          this._bufferingBarHides = false;
  145.       }
  146.       this._origHeight = this._prevHeight = this.__height = this._height;
  147.       this._origWidth = this._prevWidth = this.__width = this._width;
  148.       this._scaleX = 100;
  149.       this._scaleY = 100;
  150.       this._xscale = 100;
  151.       this._yscale = 100;
  152.       this._preSeekTime = -1;
  153.       this._firstStreamReady = false;
  154.       this._firstStreamShown = false;
  155.       this.createUIManager();
  156.       this._activeVP = 0;
  157.       this._visibleVP = 0;
  158.       this._topVP = 0;
  159.       this._vp = new Array();
  160.       this._vpState = new Array();
  161.       this._cpMgr = new Array();
  162.       this.createVideoPlayer(0);
  163.       this._vp[0].visible = false;
  164.       this._vp[0].volume = 0;
  165.       this.boundingBox_mc._visible = false;
  166.       this.boundingBox_mc.unloadMovie();
  167.       delete this.boundingBox_mc;
  168.       if(_global.isLivePreview)
  169.       {
  170.          this.createLivePreviewMovieClip();
  171.          this.setSize(this.__width,this.__height);
  172.       }
  173.       this._cpMgr[0].processCuePointsProperty(this._cuePoints);
  174.       delete this._cuePoints;
  175.       this._cuePoints = null;
  176.    }
  177.    function setSize(w, h)
  178.    {
  179.       if(_global.isLivePreview)
  180.       {
  181.          if(this.preview_mc == undefined)
  182.          {
  183.             this.createLivePreviewMovieClip();
  184.          }
  185.          this.preview_mc.box_mc._width = w;
  186.          this.preview_mc.box_mc._height = h;
  187.          if(this.preview_mc.box_mc._width < this.preview_mc.icon_mc._width || this.preview_mc.box_mc._height < this.preview_mc.icon_mc._height)
  188.          {
  189.             this.preview_mc.icon_mc._visible = false;
  190.          }
  191.          else
  192.          {
  193.             this.preview_mc.icon_mc._visible = true;
  194.             this.preview_mc.icon_mc._x = (this.preview_mc.box_mc._width - this.preview_mc.icon_mc._width) / 2;
  195.             this.preview_mc.icon_mc._y = (this.preview_mc.box_mc._height - this.preview_mc.icon_mc._height) / 2;
  196.          }
  197.       }
  198.       if(w == this.width && h == this.height)
  199.       {
  200.          return undefined;
  201.       }
  202.       this._prevWidth = this.__width = w;
  203.       this._prevHeight = this.__height = h;
  204.       var _loc3_ = 0;
  205.       while(_loc3_ < this._vp.length)
  206.       {
  207.          if(this._vp[_loc3_] != undefined)
  208.          {
  209.             this._vp[_loc3_].setSize(w,h);
  210.          }
  211.          _loc3_ = _loc3_ + 1;
  212.       }
  213.       this.dispatchEvent({type:"resize",x:this.x,y:this.y,width:w,height:h});
  214.    }
  215.    function setScale(xs, ys)
  216.    {
  217.       if(xs == this.scaleX && ys == this.scaleY)
  218.       {
  219.          return undefined;
  220.       }
  221.       this._scaleX = xs;
  222.       this._scaleY = ys;
  223.       var _loc2_ = 0;
  224.       while(_loc2_ < this._vp.length)
  225.       {
  226.          if(this._vp[_loc2_] != undefined)
  227.          {
  228.             this._vp[_loc2_].setSize(this._origWidth * xs / 100,this._origHeight * ys / 100);
  229.          }
  230.          _loc2_ = _loc2_ + 1;
  231.       }
  232.       this.dispatchEvent({type:"resize",x:this.x,y:this.y,width:this.width,height:this.height});
  233.    }
  234.    function handleEvent(e)
  235.    {
  236.       var _loc3_ = e.state;
  237.       if(e.state != undefined && e.target._name == this._visibleVP && this.scrubbing)
  238.       {
  239.          _loc3_ = mx.video.FLVPlayback.SEEKING;
  240.       }
  241.       if(e.type == "metadataReceived")
  242.       {
  243.          this._cpMgr[e.target._name].processFLVCuePoints(e.info.cuePoints);
  244.          this.dispatchEvent({type:e.type,info:e.info,vp:e.target._name});
  245.       }
  246.       else if(e.type == "cuePoint")
  247.       {
  248.          if(this._cpMgr[e.target._name].isFLVCuePointEnabled(e.info))
  249.          {
  250.             this.dispatchEvent({type:e.type,info:e.info,vp:e.target._name});
  251.          }
  252.       }
  253.       else if(e.type == "rewind")
  254.       {
  255.          this.dispatchEvent({type:e.type,auto:true,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  256.          this._cpMgr[e.target._name].resetASCuePointIndex(e.playheadTime);
  257.       }
  258.       else if(e.type == "resize")
  259.       {
  260.          this.dispatchEvent({type:e.type,x:this.x,y:this.y,width:this.width,height:this.height,auto:true,vp:e.target._name});
  261.          this._prevWidth = this.__width;
  262.          this._prevHeight = this.__height;
  263.       }
  264.       else if(e.type == "playheadUpdate")
  265.       {
  266.          this.dispatchEvent({type:e.type,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  267.          if(this._preSeekTime >= 0 && e.target.state != mx.video.FLVPlayback.SEEKING)
  268.          {
  269.             var _loc5_ = this._preSeekTime;
  270.             this._preSeekTime = -1;
  271.             this._cpMgr[e.target._name].resetASCuePointIndex(e.playheadTime);
  272.             this.dispatchEvent({type:"seek",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  273.             if(_loc5_ < e.playheadTime)
  274.             {
  275.                this.dispatchEvent({type:"fastForward",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  276.             }
  277.             else if(_loc5_ > e.playheadTime)
  278.             {
  279.                this.dispatchEvent({type:"rewind",auto:false,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  280.             }
  281.          }
  282.          this._cpMgr[e.target._name].dispatchASCuePoints();
  283.       }
  284.       else if(e.type == "stateChange")
  285.       {
  286.          var _loc4_ = e.target._name;
  287.          if(_loc4_ == this._visibleVP && this.scrubbing)
  288.          {
  289.             return undefined;
  290.          }
  291.          if(e.state == mx.video.VideoPlayer.RESIZING)
  292.          {
  293.             return undefined;
  294.          }
  295.          if(this._vpState[_loc4_].prevState == mx.video.FLVPlayback.LOADING && this._vpState[_loc4_].autoPlay && e.state == mx.video.FLVPlayback.STOPPED)
  296.          {
  297.             return undefined;
  298.          }
  299.          this._vpState[_loc4_].prevState = e.state;
  300.          this.dispatchEvent({type:e.type,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  301.          if(this._vp[e.target._name].state != _loc3_)
  302.          {
  303.             return undefined;
  304.          }
  305.          switch(_loc3_)
  306.          {
  307.             case mx.video.FLVPlayback.BUFFERING:
  308.                this.dispatchEvent({type:"buffering",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  309.                break;
  310.             case mx.video.FLVPlayback.PAUSED:
  311.                this.dispatchEvent({type:"paused",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  312.                break;
  313.             case mx.video.FLVPlayback.PLAYING:
  314.                this.dispatchEvent({type:"playing",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  315.                break;
  316.             case mx.video.FLVPlayback.STOPPED:
  317.                this.dispatchEvent({type:"stopped",state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  318.          }
  319.       }
  320.       else if(e.type == "progress")
  321.       {
  322.          this.dispatchEvent({type:e.type,bytesLoaded:e.bytesLoaded,bytesTotal:e.bytesTotal,vp:e.target._name});
  323.       }
  324.       else if(e.type == "ready")
  325.       {
  326.          _loc4_ = e.target._name;
  327.          if(!this._firstStreamReady)
  328.          {
  329.             if(_loc4_ == this._visibleVP)
  330.             {
  331.                this._firstStreamReady = true;
  332.                if(this._uiMgr.skinReady && !this._firstStreamShown)
  333.                {
  334.                   this._uiMgr.visible = true;
  335.                   this.showFirstStream();
  336.                }
  337.             }
  338.          }
  339.          else if(this._firstStreamShown && _loc3_ == mx.video.FLVPlayback.STOPPED && this._vpState[_loc4_].autoPlay)
  340.          {
  341.             this._vp[_loc4_].play();
  342.          }
  343.          this.dispatchEvent({type:e.type,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  344.       }
  345.       else if(e.type == "close" || e.type == "complete")
  346.       {
  347.          this.dispatchEvent({type:e.type,state:_loc3_,playheadTime:e.playheadTime,vp:e.target._name});
  348.       }
  349.    }
  350.    function load(contentPath, totalTime, isLive)
  351.    {
  352.       if(this._vp[this._activeVP] == undefined)
  353.       {
  354.          return undefined;
  355.       }
  356.       if(contentPath == undefined || contentPath == null || contentPath == "")
  357.       {
  358.          return undefined;
  359.       }
  360.       this.autoPlay = false;
  361.       if(totalTime != undefined)
  362.       {
  363.          this.totalTime = totalTime;
  364.       }
  365.       if(isLive != undefined)
  366.       {
  367.          this.isLive = isLive;
  368.       }
  369.       this.contentPath = contentPath;
  370.    }
  371.    function play(contentPath, totalTime, isLive)
  372.    {
  373.       if(this._vp[this._activeVP] == undefined)
  374.       {
  375.          return undefined;
  376.       }
  377.       if(contentPath == undefined)
  378.       {
  379.          this._vp[this._activeVP].play();
  380.       }
  381.       else
  382.       {
  383.          this.autoPlay = true;
  384.          if(totalTime != undefined)
  385.          {
  386.             this.totalTime = totalTime;
  387.          }
  388.          if(isLive != undefined)
  389.          {
  390.             this.isLive = isLive;
  391.          }
  392.          this.contentPath = contentPath;
  393.       }
  394.    }
  395.    function pause()
  396.    {
  397.       if(this._vp[this._activeVP] == undefined)
  398.       {
  399.          return undefined;
  400.       }
  401.       this._vp[this._activeVP].pause();
  402.    }
  403.    function stop()
  404.    {
  405.       if(this._vp[this._activeVP] == undefined)
  406.       {
  407.          return undefined;
  408.       }
  409.       this._vp[this._activeVP].stop();
  410.    }
  411.    function seek(time)
  412.    {
  413.       if(this._vp[this._activeVP] == undefined)
  414.       {
  415.          return undefined;
  416.       }
  417.       this._preSeekTime = this.playheadTime;
  418.       this._vp[this._activeVP].seek(time);
  419.    }
  420.    function seekSeconds(time)
  421.    {
  422.       this.seek(time);
  423.    }
  424.    function seekPercent(percent)
  425.    {
  426.       if(this._vp[this._activeVP] == undefined)
  427.       {
  428.          return undefined;
  429.       }
  430.       if(percent < 0 || percent > 100 || this._vp[this._activeVP].totalTime == undefined || this._vp[this._activeVP].totalTime == null || this._vp[this._activeVP].totalTime <= 0)
  431.       {
  432.          throw new mx.video.VideoError(mx.video.VideoError.INVALID_SEEK);
  433.       }
  434.       this.seek(this._vp[this._activeVP].totalTime * percent / 100);
  435.    }
  436.    function get playheadPercentage()
  437.    {
  438.       if(this._vp[this._activeVP].totalTime == undefined || this._vp[this._activeVP].totalTime == null || this._vp[this._activeVP].totalTime <= 0)
  439.       {
  440.          return undefined;
  441.       }
  442.       return this._vp[this._activeVP].playheadTime / this._vp[this._activeVP].totalTime * 100;
  443.    }
  444.    function set playheadPercentage(percent)
  445.    {
  446.       this.seekPercent(percent);
  447.    }
  448.    function seekToNavCuePoint(timeNameOrCuePoint)
  449.    {
  450.       var _loc3_ = undefined;
  451.       switch(typeof timeNameOrCuePoint)
  452.       {
  453.          case "string":
  454.             _loc3_ = {name:timeNameOrCuePoint};
  455.             break;
  456.          case "number":
  457.             _loc3_ = {time:timeNameOrCuePoint};
  458.             break;
  459.          case "object":
  460.             _loc3_ = timeNameOrCuePoint;
  461.       }
  462.       if(_loc3_.name == null || _loc3_.name == undefined || typeof _loc3_.name != "string")
  463.       {
  464.          this.seekToNextNavCuePoint(_loc3_.time);
  465.          return undefined;
  466.       }
  467.       if(isNaN(_loc3_.time))
  468.       {
  469.          _loc3_.time = 0;
  470.       }
  471.       var _loc2_ = this.findNearestCuePoint(timeNameOrCuePoint,mx.video.FLVPlayback.NAVIGATION);
  472.       while(_loc2_ != null && (_loc2_.time < _loc3_.time || !this.isFLVCuePointEnabled(_loc2_)))
  473.       {
  474.          _loc2_ = this.findNextCuePointWithName(_loc2_);
  475.       }
  476.       if(_loc2_ == null)
  477.       {
  478.          throw new mx.video.VideoError(mx.video.VideoError.INVALID_SEEK);
  479.       }
  480.       this.seek(_loc2_.time);
  481.    }
  482.    function seekToNextNavCuePoint(time)
  483.    {
  484.       if(this._vp[this._activeVP] == undefined)
  485.       {
  486.          return undefined;
  487.       }
  488.       if(isNaN(time) || time < 0)
  489.       {
  490.          time = this._vp[this._activeVP].playheadTime + 0.001;
  491.       }
  492.       var _loc3_ = undefined;
  493.       _loc3_ = this.findNearestCuePoint(time,mx.video.FLVPlayback.NAVIGATION);
  494.       if(_loc3_ == null)
  495.       {
  496.          this.seek(this._vp[this._activeVP].totalTime);
  497.          return undefined;
  498.       }
  499.       var _loc2_ = _loc3_.index;
  500.       if(_loc3_.time < time)
  501.       {
  502.          _loc2_ = _loc2_ + 1;
  503.       }
  504.       while(_loc2_ < _loc3_.array.length && !this.isFLVCuePointEnabled(_loc3_.array[_loc2_]))
  505.       {
  506.          _loc2_ = _loc2_ + 1;
  507.       }
  508.       if(_loc2_ >= _loc3_.array.length)
  509.       {
  510.          var _loc5_ = this._vp[this._activeVP].totalTime;
  511.          if(_loc3_.array[_loc3_.array.length - 1].time > _loc5_)
  512.          {
  513.             _loc5_ = _loc3_.array[_loc3_.array.length - 1];
  514.          }
  515.          this.seek(_loc5_);
  516.       }
  517.       else
  518.       {
  519.          this.seek(_loc3_.array[_loc2_].time);
  520.       }
  521.    }
  522.    function seekToPrevNavCuePoint(time)
  523.    {
  524.       if(this._vp[this._activeVP] == undefined)
  525.       {
  526.          return undefined;
  527.       }
  528.       if(isNaN(time) || time < 0)
  529.       {
  530.          time = this._vp[this._activeVP].playheadTime;
  531.       }
  532.       var _loc3_ = this.findNearestCuePoint(time,mx.video.FLVPlayback.NAVIGATION);
  533.       if(_loc3_ == null)
  534.       {
  535.          this.seek(0);
  536.          return undefined;
  537.       }
  538.       var _loc2_ = _loc3_.index;
  539.       while(_loc2_ >= 0 && (!this.isFLVCuePointEnabled(_loc3_.array[_loc2_]) || _loc3_.array[_loc2_].time >= time - this._seekToPrevOffset))
  540.       {
  541.          _loc2_ = _loc2_ - 1;
  542.       }
  543.       if(_loc2_ < 0)
  544.       {
  545.          this.seek(0);
  546.       }
  547.       else
  548.       {
  549.          this.seek(_loc3_.array[_loc2_].time);
  550.       }
  551.    }
  552.    function addASCuePoint(timeOrCuePoint, name, parameters)
  553.    {
  554.       return this._cpMgr[this._activeVP].addASCuePoint(timeOrCuePoint,name,parameters);
  555.    }
  556.    function removeASCuePoint(timeNameOrCuePoint)
  557.    {
  558.       return this._cpMgr[this._activeVP].removeASCuePoint(timeNameOrCuePoint);
  559.    }
  560.    function findCuePoint(timeNameOrCuePoint, type)
  561.    {
  562.       switch(type)
  563.       {
  564.          case "event":
  565.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].eventCuePoints,false,timeNameOrCuePoint);
  566.          case "navigation":
  567.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].navCuePoints,false,timeNameOrCuePoint);
  568.          case "flv":
  569.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].flvCuePoints,false,timeNameOrCuePoint);
  570.          case "actionscript":
  571.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].asCuePoints,false,timeNameOrCuePoint);
  572.          case "all":
  573.          default:
  574.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].allCuePoints,false,timeNameOrCuePoint);
  575.       }
  576.    }
  577.    function findNearestCuePoint(timeNameOrCuePoint, type)
  578.    {
  579.       switch(type)
  580.       {
  581.          case "event":
  582.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].eventCuePoints,true,timeNameOrCuePoint);
  583.          case "navigation":
  584.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].navCuePoints,true,timeNameOrCuePoint);
  585.          case "flv":
  586.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].flvCuePoints,true,timeNameOrCuePoint);
  587.          case "actionscript":
  588.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].asCuePoints,true,timeNameOrCuePoint);
  589.          case "all":
  590.          default:
  591.             return this._cpMgr[this._activeVP].getCuePoint(this._cpMgr[this._activeVP].allCuePoints,true,timeNameOrCuePoint);
  592.       }
  593.    }
  594.    function findNextCuePointWithName(cuePoint)
  595.    {
  596.       return this._cpMgr[this._activeVP].getNextCuePointWithName(cuePoint);
  597.    }
  598.    function setFLVCuePointEnabled(enabled, timeNameOrCuePoint)
  599.    {
  600.       return this._cpMgr[this._activeVP].setFLVCuePointEnabled(enabled,timeNameOrCuePoint);
  601.    }
  602.    function isFLVCuePointEnabled(timeNameOrCuePoint)
  603.    {
  604.       return this._cpMgr[this._activeVP].isFLVCuePointEnabled(timeNameOrCuePoint);
  605.    }
  606.    function getNextHighestDepth()
  607.    {
  608.       var _loc2_ = super.getNextHighestDepth();
  609.       return _loc2_ >= 1000 ? _loc2_ : 1000;
  610.    }
  611.    function bringVideoPlayerToFront(index)
  612.    {
  613.       if(index == this._topVP || this._vp[index] == undefined)
  614.       {
  615.          return undefined;
  616.       }
  617.       this._vp[this._topVP].swapDepths(this._vp[index].getDepth());
  618.       this._topVP = index;
  619.    }
  620.    function getVideoPlayer(index)
  621.    {
  622.       return this._vp[index];
  623.    }
  624.    function closeVideoPlayer(index)
  625.    {
  626.       if(this._vp[index] == undefined)
  627.       {
  628.          return undefined;
  629.       }
  630.       if(index == 0)
  631.       {
  632.          throw new mx.video.VideoError(mx.video.VideoError.DELETE_DEFAULT_PLAYER);
  633.       }
  634.       if(this._visibleVP == index)
  635.       {
  636.          this.visibleVideoPlayerIndex = 0;
  637.       }
  638.       if(this._activeVP == index)
  639.       {
  640.          this.activeVideoPlayerIndex = 0;
  641.       }
  642.       this._vp[index].close();
  643.       this._vp[index].unloadMovie();
  644.       delete this._vp[index];
  645.       this._vp[index] = undefined;
  646.    }
  647.    function get activeVideoPlayerIndex()
  648.    {
  649.       return this._activeVP;
  650.    }
  651.    function set activeVideoPlayerIndex(i)
  652.    {
  653.       if(this._activeVP == i)
  654.       {
  655.          return;
  656.       }
  657.       if(this._vp[this._activeVP].onEnterFrame != undefined)
  658.       {
  659.          this.doContentPathConnect();
  660.       }
  661.       this._activeVP = i;
  662.       if(this._vp[this._activeVP] == undefined)
  663.       {
  664.          this.createVideoPlayer(this._activeVP);
  665.          this._vp[this._activeVP].visible = false;
  666.          this._vp[this._activeVP].volume = 0;
  667.       }
  668.    }
  669.    function get autoPlay()
  670.    {
  671.       if(this._vpState[this._activeVP] == undefined)
  672.       {
  673.          return this._autoPlay;
  674.       }
  675.       return this._vpState[this._activeVP].autoPlay;
  676.    }
  677.    function set autoPlay(flag)
  678.    {
  679.       if(this._activeVP == 0 || this._activeVP == undefined)
  680.       {
  681.          this._autoPlay = flag;
  682.       }
  683.       this._vpState[this._activeVP].autoPlay = flag;
  684.    }
  685.    function get autoRewind()
  686.    {
  687.       if(this._vp[this._activeVP] == undefined)
  688.       {
  689.          return this._autoRewind;
  690.       }
  691.       return this._vp[this._activeVP].autoRewind;
  692.    }
  693.    function set autoRewind(flag)
  694.    {
  695.       if(this._activeVP == 0 || this._activeVP == undefined)
  696.       {
  697.          this._autoRewind = flag;
  698.       }
  699.       this._vp[this._activeVP].autoRewind = flag;
  700.    }
  701.    function get autoSize()
  702.    {
  703.       if(this._vp[this._activeVP] == undefined)
  704.       {
  705.          return this._autoSize;
  706.       }
  707.       return this._vp[this._activeVP].autoSize;
  708.    }
  709.    function set autoSize(flag)
  710.    {
  711.       if(this._activeVP == 0 || this._activeVP == undefined)
  712.       {
  713.          this._autoSize = flag;
  714.       }
  715.       this._vp[this._activeVP].autoSize = flag;
  716.    }
  717.    function get bitrate()
  718.    {
  719.       return this.ncMgr.getBitrate();
  720.    }
  721.    function set bitrate(b)
  722.    {
  723.       this.ncMgr.setBitrate(b);
  724.    }
  725.    function get buffering()
  726.    {
  727.       if(this._vp[this._activeVP] == undefined)
  728.       {
  729.          return false;
  730.       }
  731.       return this._vp[this._activeVP].state == mx.video.FLVPlayback.BUFFERING;
  732.    }
  733.    function get bufferingBar()
  734.    {
  735.       if(this._uiMgr != null && this._uiMgr != undefined)
  736.       {
  737.          this._bufferingBar = this._uiMgr.getControl(mx.video.UIManager.BUFFERING_BAR);
  738.       }
  739.       return this._bufferingBar;
  740.    }
  741.    function set bufferingBar(s)
  742.    {
  743.       this._bufferingBar = s;
  744.       if(this._uiMgr != null && this._uiMgr != undefined)
  745.       {
  746.          this._uiMgr.setControl(mx.video.UIManager.BUFFERING_BAR,s);
  747.       }
  748.    }
  749.    function get bufferingBarHidesAndDisablesOthers()
  750.    {
  751.       if(this._uiMgr != null && this._uiMgr != undefined)
  752.       {
  753.          this._bufferingBarHides = this._uiMgr.bufferingBarHidesAndDisablesOthers;
  754.       }
  755.       return this._bufferingBarHides;
  756.    }
  757.    function set bufferingBarHidesAndDisablesOthers(b)
  758.    {
  759.       this._bufferingBarHides = b;
  760.       if(this._uiMgr != null && this._uiMgr != undefined)
  761.       {
  762.          this._uiMgr.bufferingBarHidesAndDisablesOthers = b;
  763.       }
  764.    }
  765.    function get backButton()
  766.    {
  767.       if(this._uiMgr != null && this._uiMgr != undefined)
  768.       {
  769.          this._backButton = this._uiMgr.getControl(mx.video.UIManager.BACK_BUTTON);
  770.       }
  771.       return this._backButton;
  772.    }
  773.    function set backButton(s)
  774.    {
  775.       this._backButton = s;
  776.       if(this._uiMgr != null && this._uiMgr != undefined)
  777.       {
  778.          this._uiMgr.setControl(mx.video.UIManager.BACK_BUTTON,s);
  779.       }
  780.    }
  781.    function get bufferTime()
  782.    {
  783.       if(this._vp[this._activeVP] == undefined)
  784.       {
  785.          return this._bufferTime;
  786.       }
  787.       return this._vp[this._activeVP].bufferTime;
  788.    }
  789.    function set bufferTime(aTime)
  790.    {
  791.       if(this._activeVP == 0 || this._activeVP == undefined)
  792.       {
  793.          this._bufferTime = aTime;
  794.       }
  795.       this._vp[this._activeVP].bufferTime = aTime;
  796.    }
  797.    function get bytesLoaded()
  798.    {
  799.       return this._vp[this._activeVP].bytesLoaded;
  800.    }
  801.    function get bytesTotal()
  802.    {
  803.       return this._vp[this._activeVP].bytesTotal;
  804.    }
  805.    function get contentPath()
  806.    {
  807.       if(this._vp[this._activeVP] == undefined || this._vp[this._activeVP].onEnterFrame != undefined)
  808.       {
  809.          return this._contentPath;
  810.       }
  811.       return this._vp[this._activeVP].url;
  812.    }
  813.    function set contentPath(url)
  814.    {
  815.       if(_global.isLivePreview)
  816.       {
  817.          return;
  818.       }
  819.       if(this._vp[this._activeVP] == undefined)
  820.       {
  821.          if(url == this._contentPath)
  822.          {
  823.             return;
  824.          }
  825.          this._contentPath = url;
  826.       }
  827.       else
  828.       {
  829.          if(this._vp[this._activeVP].url == url)
  830.          {
  831.             return;
  832.          }
  833.          this._vpState[this._activeVP].minProgressPercent = undefined;
  834.          if(this._vp[this._activeVP].onEnterFrame != undefined)
  835.          {
  836.             delete this._vp[this._activeVP].onEnterFrame;
  837.             this._vp[this._activeVP].onEnterFrame = undefined;
  838.          }
  839.          this._cpMgr[this._activeVP].reset();
  840.          if(this._vpState[this._activeVP].autoPlay && this._firstStreamShown)
  841.          {
  842.             this._vp[this._activeVP].play(url,this._vpState[this._activeVP].isLive,this._vpState[this._activeVP].totalTime);
  843.          }
  844.          else
  845.          {
  846.             this._vp[this._activeVP].load(url,this._vpState[this._activeVP].isLive,this._vpState[this._activeVP].totalTime);
  847.          }
  848.          this._vpState[this._activeVP].isLiveSet = false;
  849.          this._vpState[this._activeVP].totalTimeSet = false;
  850.       }
  851.    }
  852.    function set cuePoints(cp)
  853.    {
  854.       if(this._cuePoints != undefined)
  855.       {
  856.          return;
  857.       }
  858.       this._cuePoints = cp;
  859.    }
  860.    function get forwardButton()
  861.    {
  862.       if(this._uiMgr != null && this._uiMgr != undefined)
  863.       {
  864.          this._forwardButton = this._uiMgr.getControl(mx.video.UIManager.FORWARD_BUTTON);
  865.       }
  866.       return this._forwardButton;
  867.    }
  868.    function set forwardButton(s)
  869.    {
  870.       this._forwardButton = s;
  871.       if(this._uiMgr != null && this._uiMgr != undefined)
  872.       {
  873.          this._uiMgr.setControl(mx.video.UIManager.FORWARD_BUTTON,s);
  874.       }
  875.    }
  876.    function get height()
  877.    {
  878.       if(_global.isLivePreview)
  879.       {
  880.          return this.__height;
  881.       }
  882.       if(this._vp[this._visibleVP] != undefined)
  883.       {
  884.          this.__height = this._vp[this._visibleVP].height;
  885.       }
  886.       return this.__height;
  887.    }
  888.    function set height(h)
  889.    {
  890.       this.setSize(this.width,h);
  891.    }
  892.    function get idleTimeout()
  893.    {
  894.       if(this._vp[this._activeVP] == undefined)
  895.       {
  896.          return this._idleTimeout;
  897.       }
  898.       return this._vp[this._activeVP].idleTimeout;
  899.    }
  900.    function set idleTimeout(aTime)
  901.    {
  902.       if(this._activeVP == 0 || this._activeVP == undefined)
  903.       {
  904.          this._idleTimeout = aTime;
  905.       }
  906.       this._vp[this._activeVP].idleTimeout = aTime;
  907.    }
  908.    function get isRTMP()
  909.    {
  910.       if(_global.isLivePreview)
  911.       {
  912.          return true;
  913.       }
  914.       if(this._vp[this._activeVP] == undefined)
  915.       {
  916.          return undefined;
  917.       }
  918.       return this._vp[this._activeVP].isRTMP;
  919.    }
  920.    function get isLive()
  921.    {
  922.       if(this._vp[this._activeVP] == undefined)
  923.       {
  924.          return this._isLive;
  925.       }
  926.       if(this._vpState[this._activeVP].isLiveSet)
  927.       {
  928.          return this._vpState[this._activeVP].isLive;
  929.       }
  930.       return this._vp[this._activeVP].isLive;
  931.    }
  932.    function set isLive(flag)
  933.    {
  934.       if(this._activeVP == 0 || this._activeVP == undefined)
  935.       {
  936.          this._isLive = flag;
  937.       }
  938.       this._vpState[this._activeVP].isLive = flag;
  939.       this._vpState[this._activeVP].isLiveSet = true;
  940.    }
  941.    function get maintainAspectRatio()
  942.    {
  943.       if(this._vp[this._activeVP] == undefined)
  944.       {
  945.          return this._aspectRatio;
  946.       }
  947.       return this._vp[this._activeVP].maintainAspectRatio;
  948.    }
  949.    function set maintainAspectRatio(flag)
  950.    {
  951.       if(this._activeVP == 0 || this._activeVP == undefined)
  952.       {
  953.          this._aspectRatio = flag;
  954.       }
  955.       this._vp[this._activeVP].maintainAspectRatio = flag;
  956.    }
  957.    function get metadata()
  958.    {
  959.       if(this._vp[this._activeVP] == undefined)
  960.       {
  961.          return null;
  962.       }
  963.       return this._vp[this._activeVP].metadata;
  964.    }
  965.    function get metadataLoaded()
  966.    {
  967.       if(this._vp[this._activeVP] == undefined)
  968.       {
  969.          return false;
  970.       }
  971.       return this._cpMgr[this._activeVP].metadataLoaded;
  972.    }
  973.    function get muteButton()
  974.    {
  975.       if(this._uiMgr != null && this._uiMgr != undefined)
  976.       {
  977.          this._muteButton = this._uiMgr.getControl(mx.video.UIManager.MUTE_BUTTON);
  978.       }
  979.       return this._muteButton;
  980.    }
  981.    function set muteButton(s)
  982.    {
  983.       this._muteButton = s;
  984.       if(this._uiMgr != null && this._uiMgr != undefined)
  985.       {
  986.          this._uiMgr.setControl(mx.video.UIManager.MUTE_BUTTON,s);
  987.       }
  988.    }
  989.    function get ncMgr()
  990.    {
  991.       if(this._vp[this._activeVP] == undefined)
  992.       {
  993.          return null;
  994.       }
  995.       return this._vp[this._activeVP].ncMgr;
  996.    }
  997.    function get pauseButton()
  998.    {
  999.       if(this._uiMgr != null && this._uiMgr != undefined)
  1000.       {
  1001.          this._pauseButton = this._uiMgr.getControl(mx.video.UIManager.PAUSE_BUTTON);
  1002.       }
  1003.       return this._pauseButton;
  1004.    }
  1005.    function set pauseButton(s)
  1006.    {
  1007.       this._pauseButton = s;
  1008.       if(this._uiMgr != null && this._uiMgr != undefined)
  1009.       {
  1010.          this._uiMgr.setControl(mx.video.UIManager.PAUSE_BUTTON,s);
  1011.       }
  1012.    }
  1013.    function get paused()
  1014.    {
  1015.       if(this._vp[this._activeVP] == undefined)
  1016.       {
  1017.          return false;
  1018.       }
  1019.       return this._vp[this._activeVP].state == mx.video.FLVPlayback.PAUSED;
  1020.    }
  1021.    function get playButton()
  1022.    {
  1023.       if(this._uiMgr != null && this._uiMgr != undefined)
  1024.       {
  1025.          this._playButton = this._uiMgr.getControl(mx.video.UIManager.PLAY_BUTTON);
  1026.       }
  1027.       return this._playButton;
  1028.    }
  1029.    function set playButton(s)
  1030.    {
  1031.       this._playButton = s;
  1032.       if(this._uiMgr != null && this._uiMgr != undefined)
  1033.       {
  1034.          this._uiMgr.setControl(mx.video.UIManager.PLAY_BUTTON,s);
  1035.       }
  1036.    }
  1037.    function get playheadTime()
  1038.    {
  1039.       if(this._vp[this._activeVP] == undefined)
  1040.       {
  1041.          return 0;
  1042.       }
  1043.       return this._vp[this._activeVP].playheadTime;
  1044.    }
  1045.    function set playheadTime(position)
  1046.    {
  1047.       this.seek(position);
  1048.    }
  1049.    function get playheadUpdateInterval()
  1050.    {
  1051.       if(this._vp[this._activeVP] == undefined)
  1052.       {
  1053.          return this._playheadUpdateInterval;
  1054.       }
  1055.       return this._vp[this._activeVP].playheadUpdateInterval;
  1056.    }
  1057.    function set playheadUpdateInterval(aTime)
  1058.    {
  1059.       if(this._activeVP == 0 || this._activeVP == undefined)
  1060.       {
  1061.          this._playheadUpdateInterval = aTime;
  1062.       }
  1063.       this._cpMgr[this._activeVP].playheadUpdateInterval = aTime;
  1064.       this._vp[this._activeVP].playheadUpdateInterval = aTime;
  1065.    }
  1066.    function get playing()
  1067.    {
  1068.       if(this._vp[this._activeVP] == undefined)
  1069.       {
  1070.          return false;
  1071.       }
  1072.       return this._vp[this._activeVP].state == mx.video.FLVPlayback.PLAYING;
  1073.    }
  1074.    function get playPauseButton()
  1075.    {
  1076.       if(this._uiMgr != null && this._uiMgr != undefined)
  1077.       {
  1078.          this._playPauseButton = this._uiMgr.getControl(mx.video.UIManager.PLAY_PAUSE_BUTTON);
  1079.       }
  1080.       return this._playPauseButton;
  1081.    }
  1082.    function set playPauseButton(s)
  1083.    {
  1084.       this._playPauseButton = s;
  1085.       if(this._uiMgr != null && this._uiMgr != undefined)
  1086.       {
  1087.          this._uiMgr.setControl(mx.video.UIManager.PLAY_PAUSE_BUTTON,s);
  1088.       }
  1089.    }
  1090.    function get preferredHeight()
  1091.    {
  1092.       if(this._vp[this._activeVP] == undefined)
  1093.       {
  1094.          return 0;
  1095.       }
  1096.       return this._vp[this._activeVP].videoHeight;
  1097.    }
  1098.    function get preferredWidth()
  1099.    {
  1100.       if(this._vp[this._activeVP] == undefined)
  1101.       {
  1102.          return 0;
  1103.       }
  1104.       return this._vp[this._activeVP].videoWidth;
  1105.    }
  1106.    function get progressInterval()
  1107.    {
  1108.       if(this._vp[this._activeVP] == undefined)
  1109.       {
  1110.          return this._progressInterval;
  1111.       }
  1112.       return this._vp[this._activeVP].progressInterval;
  1113.    }
  1114.    function set progressInterval(aTime)
  1115.    {
  1116.       if(this._activeVP == 0 || this._activeVP == undefined)
  1117.       {
  1118.          this._progressInterval = aTime;
  1119.       }
  1120.       this._vp[this._activeVP].progressInterval = aTime;
  1121.    }
  1122.    function get scaleX()
  1123.    {
  1124.       if(this._vp[this._visibleVP] != undefined)
  1125.       {
  1126.          this._scaleX = this._vp[this._visibleVP].width / this._origWidth * 100;
  1127.       }
  1128.       return this._scaleX;
  1129.    }
  1130.    function set scaleX(xs)
  1131.    {
  1132.       this.setScale(xs,this.scaleY);
  1133.    }
  1134.    function get scaleY()
  1135.    {
  1136.       if(this._vp[this._visibleVP] != undefined)
  1137.       {
  1138.          this._scaleY = this._vp[this._visibleVP].height / this._origHeight * 100;
  1139.       }
  1140.       return this._scaleY;
  1141.    }
  1142.    function set scaleY(ys)
  1143.    {
  1144.       this.setScale(this.scaleX,ys);
  1145.    }
  1146.    function get scrubbing()
  1147.    {
  1148.       var _loc2_ = this.seekBar;
  1149.       if(_loc2_ == undefined || _loc2_.isDragging == undefined)
  1150.       {
  1151.          return false;
  1152.       }
  1153.       return _loc2_.isDragging;
  1154.    }
  1155.    function get seekBar()
  1156.    {
  1157.       if(this._uiMgr != null && this._uiMgr != undefined)
  1158.       {
  1159.          this._seekBar = this._uiMgr.getControl(mx.video.UIManager.SEEK_BAR);
  1160.       }
  1161.       return this._seekBar;
  1162.    }
  1163.    function set seekBar(s)
  1164.    {
  1165.       this._seekBar = s;
  1166.       if(this._uiMgr != null && this._uiMgr != undefined)
  1167.       {
  1168.          this._uiMgr.setControl(mx.video.UIManager.SEEK_BAR,s);
  1169.       }
  1170.    }
  1171.    function get seekBarInterval()
  1172.    {
  1173.       if(this._uiMgr != null && this._uiMgr != undefined)
  1174.       {
  1175.          this._seekBarInterval = this._uiMgr.seekBarInterval;
  1176.       }
  1177.       return this._seekBarInterval;
  1178.    }
  1179.    function set seekBarInterval(s)
  1180.    {
  1181.       this._seekBarInterval = s;
  1182.       if(this._uiMgr != null && this._uiMgr != undefined)
  1183.       {
  1184.          this._uiMgr.seekBarInterval = this._seekBarInterval;
  1185.       }
  1186.    }
  1187.    function get seekBarScrubTolerance()
  1188.    {
  1189.       if(this._uiMgr != null && this._uiMgr != undefined)
  1190.       {
  1191.          this._seekBarScrubTolerance = this._uiMgr.seekBarScrubTolerance;
  1192.       }
  1193.       return this._seekBarScrubTolerance;
  1194.    }
  1195.    function set seekBarScrubTolerance(s)
  1196.    {
  1197.       this._seekBarScrubTolerance = s;
  1198.       if(this._uiMgr != null && this._uiMgr != undefined)
  1199.       {
  1200.          this._uiMgr.seekBarScrubTolerance = this._seekBarScrubTolerance;
  1201.       }
  1202.    }
  1203.    function get seekToPrevOffset()
  1204.    {
  1205.       return this._seekToPrevOffset;
  1206.    }
  1207.    function set seekToPrevOffset(s)
  1208.    {
  1209.       this._seekToPrevOffset = s;
  1210.    }
  1211.    function get skin()
  1212.    {
  1213.       if(this._uiMgr != null && this._uiMgr != undefined)
  1214.       {
  1215.          this._skin = this._uiMgr.skin;
  1216.       }
  1217.       return this._skin;
  1218.    }
  1219.    function set skin(s)
  1220.    {
  1221.       this._skin = s;
  1222.       if(this._uiMgr != null && this._uiMgr != undefined)
  1223.       {
  1224.          this._uiMgr.skin = s;
  1225.       }
  1226.    }
  1227.    function get skinAutoHide()
  1228.    {
  1229.       if(this._uiMgr != null && this._uiMgr != undefined)
  1230.       {
  1231.          this._skinAutoHide = this._uiMgr.skinAutoHide;
  1232.       }
  1233.       return this._skinAutoHide;
  1234.    }
  1235.    function set skinAutoHide(b)
  1236.    {
  1237.       if(_global.isLivePreview)
  1238.       {
  1239.          return;
  1240.       }
  1241.       this._skinAutoHide = b;
  1242.       if(this._uiMgr != null && this._uiMgr != undefined)
  1243.       {
  1244.          this._uiMgr.skinAutoHide = b;
  1245.       }
  1246.    }
  1247.    function get transform()
  1248.    {
  1249.       return this._transform;
  1250.    }
  1251.    function set transform(s)
  1252.    {
  1253.       this._transform = s;
  1254.       if(this._vp[this._activeVP] != undefined)
  1255.       {
  1256.          this._vp[this._activeVP].transform = this._transform;
  1257.       }
  1258.    }
  1259.    function get state()
  1260.    {
  1261.       if(_global.isLivePreview)
  1262.       {
  1263.          return mx.video.FLVPlayback.STOPPED;
  1264.       }
  1265.       if(this._vp[this._activeVP] == undefined)
  1266.       {
  1267.          return mx.video.FLVPlayback.DISCONNECTED;
  1268.       }
  1269.       if(this._activeVP == this._visibleVP && this.scrubbing)
  1270.       {
  1271.          return mx.video.FLVPlayback.SEEKING;
  1272.       }
  1273.       var _loc3_ = this._vp[this._activeVP].state;
  1274.       if(_loc3_ == mx.video.VideoPlayer.RESIZING)
  1275.       {
  1276.          return mx.video.FLVPlayback.LOADING;
  1277.       }
  1278.       if(this._vpState[this._activeVP].prevState == mx.video.FLVPlayback.LOADING && this._vpState[this._activeVP].autoPlay && _loc3_ == mx.video.FLVPlayback.STOPPED)
  1279.       {
  1280.          return mx.video.FLVPlayback.LOADING;
  1281.       }
  1282.       return _loc3_;
  1283.    }
  1284.    function get stateResponsive()
  1285.    {
  1286.       if(this._vp[this._activeVP] == undefined)
  1287.       {
  1288.          return false;
  1289.       }
  1290.       return this._vp[this._activeVP].stateResponsive;
  1291.    }
  1292.    function get stopButton()
  1293.    {
  1294.       if(this._uiMgr != null && this._uiMgr != undefined)
  1295.       {
  1296.          this._stopButton = this._uiMgr.getControl(mx.video.UIManager.STOP_BUTTON);
  1297.       }
  1298.       return this._stopButton;
  1299.    }
  1300.    function set stopButton(s)
  1301.    {
  1302.       this._stopButton = s;
  1303.       if(this._uiMgr != null && this._uiMgr != undefined)
  1304.       {
  1305.          this._uiMgr.setControl(mx.video.UIManager.STOP_BUTTON,s);
  1306.       }
  1307.    }
  1308.    function get stopped()
  1309.    {
  1310.       if(this._vp[this._activeVP] == undefined)
  1311.       {
  1312.          return false;
  1313.       }
  1314.       return this._vp[this._activeVP].state == mx.video.FLVPlayback.STOPPED;
  1315.    }
  1316.    function get totalTime()
  1317.    {
  1318.       if(_global.isLivePreview)
  1319.       {
  1320.          return 1;
  1321.       }
  1322.       if(this._vp[this._activeVP] == undefined)
  1323.       {
  1324.          return this._totalTime;
  1325.       }
  1326.       if(this._vpState[this._activeVP].totalTimeSet)
  1327.       {
  1328.          return this._vpState[this._activeVP].totalTime;
  1329.       }
  1330.       return this._vp[this._activeVP].totalTime;
  1331.    }
  1332.    function set totalTime(aTime)
  1333.    {
  1334.       if(this._activeVP == 0 || this._activeVP == undefined)
  1335.       {
  1336.          this._totalTime = aTime;
  1337.       }
  1338.       this._vpState[this._activeVP].totalTime = aTime;
  1339.       this._vpState[this._activeVP].totalTimeSet = true;
  1340.    }
  1341.    function get visible()
  1342.    {
  1343.       return this._visible;
  1344.    }
  1345.    function set visible(v)
  1346.    {
  1347.       this._visible = v;
  1348.    }
  1349.    function get visibleVideoPlayerIndex()
  1350.    {
  1351.       return this._visibleVP;
  1352.    }
  1353.    function set visibleVideoPlayerIndex(i)
  1354.    {
  1355.       if(this._visibleVP == i)
  1356.       {
  1357.          return;
  1358.       }
  1359.       var _loc2_ = this._visibleVP;
  1360.       if(this._vp[i] == undefined)
  1361.       {
  1362.          this.createVideoPlayer(i);
  1363.       }
  1364.       var _loc5_ = this._vp[i].height != this._vp[this._visibleVP].height || this._vp[i].width != this._vp[this._visibleVP].width;
  1365.       this._vp[this._visibleVP].visible = false;
  1366.       this._vp[this._visibleVP].volume = 0;
  1367.       this._visibleVP = i;
  1368.       if(this._firstStreamShown)
  1369.       {
  1370.          this._uiMgr.setupSkinAutoHide(_loc2_);
  1371.          this._vp[this._visibleVP].visible = true;
  1372.          if(!this.scrubbing)
  1373.          {
  1374.             this._vp[this._visibleVP].volume = this._volume;
  1375.          }
  1376.       }
  1377.       else if(this._vp[this._visibleVP].stateResponsive && this._vp[this._visibleVP].state != mx.video.FLVPlayback.DISCONNECTED && this._uiMgr.skinReady)
  1378.       {
  1379.          this._uiMgr.visible = true;
  1380.          this._uiMgr.setupSkinAutoHide(_loc2_);
  1381.          this._firstStreamReady = true;
  1382.          this.showFirstStream();
  1383.       }
  1384.       if(this._vp[_loc2_].height != this._vp[this._visibleVP].height || this._vp[_loc2_].width != this._vp[this._visibleVP].width)
  1385.       {
  1386.          this.dispatchEvent({type:"resize",x:this.x,y:this.y,width:this.width,height:this.height,auto:false,vp:this._visibleVP});
  1387.       }
  1388.       this._uiMgr.handleEvent({type:"stateChange",state:this._vp[this._visibleVP].state,vp:this._visibleVP});
  1389.       this._uiMgr.handleEvent({type:"playheadUpdate",playheadTime:this._vp[this._visibleVP].playheadTime,vp:this._visibleVP});
  1390.       if(this._vp[this._visibleVP].isRTMP)
  1391.       {
  1392.          this._uiMgr.handleEvent({type:"ready",vp:this._visibleVP});
  1393.       }
  1394.       else
  1395.       {
  1396.          this._uiMgr.handleEvent({type:"progress",bytesLoaded:this._vp[this._visibleVP].bytesLoaded,bytesTotal:this._vp[this._visibleVP].bytesTotal,vp:this._visibleVP});
  1397.       }
  1398.    }
  1399.    function get volume()
  1400.    {
  1401.       return this._volume;
  1402.    }
  1403.    function set volume(aVol)
  1404.    {
  1405.       if(this._volume == aVol)
  1406.       {
  1407.          return;
  1408.       }
  1409.       this._volume = aVol;
  1410.       if(!this.scrubbing)
  1411.       {
  1412.          this._vp[this._visibleVP].volume = this._volume;
  1413.       }
  1414.       this.dispatchEvent({type:"volumeUpdate",volume:aVol});
  1415.    }
  1416.    function get volumeBar()
  1417.    {
  1418.       if(this._uiMgr != null && this._uiMgr != undefined)
  1419.       {
  1420.          this._volumeBar = this._uiMgr.getControl(mx.video.UIManager.VOLUME_BAR);
  1421.       }
  1422.       return this._volumeBar;
  1423.    }
  1424.    function set volumeBar(s)
  1425.    {
  1426.       this._volumeBar = s;
  1427.       if(this._uiMgr != null && this._uiMgr != undefined)
  1428.       {
  1429.          this._uiMgr.setControl(mx.video.UIManager.VOLUME_BAR,s);
  1430.       }
  1431.    }
  1432.    function get volumeBarInterval()
  1433.    {
  1434.       if(this._uiMgr != null && this._uiMgr != undefined)
  1435.       {
  1436.          this._volumeBarInterval = this._uiMgr.volumeBarInterval;
  1437.       }
  1438.       return this._volumeBarInterval;
  1439.    }
  1440.    function set volumeBarInterval(s)
  1441.    {
  1442.       this._volumeBarInterval = s;
  1443.       if(this._uiMgr != null && this._uiMgr != undefined)
  1444.       {
  1445.          this._uiMgr.volumeBarInterval = this._volumeBarInterval;
  1446.       }
  1447.    }
  1448.    function get volumeBarScrubTolerance()
  1449.    {
  1450.       if(this._uiMgr != null && this._uiMgr != undefined)
  1451.       {
  1452.          this._volumeBarScrubTolerance = this._uiMgr.volumeBarScrubTolerance;
  1453.       }
  1454.       return this._volumeBarScrubTolerance;
  1455.    }
  1456.    function set volumeBarScrubTolerance(s)
  1457.    {
  1458.       this._volumeBarScrubTolerance = s;
  1459.       if(this._uiMgr != null && this._uiMgr != undefined)
  1460.       {
  1461.          this._uiMgr.volumeBarScrubTolerance = this._volumeBarScrubTolerance;
  1462.       }
  1463.    }
  1464.    function get width()
  1465.    {
  1466.       if(_global.isLivePreview)
  1467.       {
  1468.          return this.__width;
  1469.       }
  1470.       if(this._vp[this._visibleVP] != undefined)
  1471.       {
  1472.          this.__width = this._vp[this._visibleVP].width;
  1473.       }
  1474.       return this.__width;
  1475.    }
  1476.    function set width(w)
  1477.    {
  1478.       this.setSize(w,this.height);
  1479.    }
  1480.    function get x()
  1481.    {
  1482.       return this._x;
  1483.    }
  1484.    function set x(xpos)
  1485.    {
  1486.       this._x = xpos;
  1487.    }
  1488.    function get y()
  1489.    {
  1490.       return this._y;
  1491.    }
  1492.    function set y(ypos)
  1493.    {
  1494.       this._y = ypos;
  1495.    }
  1496.    function createVideoPlayer(index)
  1497.    {
  1498.       if(_global.isLivePreview)
  1499.       {
  1500.          return undefined;
  1501.       }
  1502.       var _loc4_ = this.width;
  1503.       var _loc5_ = this.height;
  1504.       this._vp[index] = mx.video.VideoPlayer(this.attachMovie("VideoPlayer",String(index),mx.video.FLVPlayback.VP_DEPTH_OFFSET + index));
  1505.       this._vp[index].setSize(_loc4_,_loc5_);
  1506.       this._topVP = index;
  1507.       this._vp[index].autoRewind = this._autoRewind;
  1508.       this._vp[index].autoSize = this._autoSize;
  1509.       this._vp[index].bufferTime = this._bufferTime;
  1510.       this._vp[index].idleTimeout = this._idleTimeout;
  1511.       this._vp[index].maintainAspectRatio = this._aspectRatio;
  1512.       this._vp[index].playheadUpdateInterval = this._playheadUpdateInterval;
  1513.       this._vp[index].progressInterval = this._progressInterval;
  1514.       this._vp[index].transform = this._transform;
  1515.       this._vp[index].volume = this._volume;
  1516.       if(index == 0)
  1517.       {
  1518.          this._vpState[index] = {id:index,isLive:this._isLive,isLiveSet:true,totalTime:this._totalTime,totalTimeSet:true,autoPlay:this._autoPlay};
  1519.          if(this._contentPath != null && this._contentPath != undefined && this._contentPath != "")
  1520.          {
  1521.             this._vp[index].onEnterFrame = mx.utils.Delegate.create(this,this.doContentPathConnect);
  1522.          }
  1523.       }
  1524.       else
  1525.       {
  1526.          this._vpState[index] = {id:index,isLive:false,isLiveSet:true,totalTime:0,totalTimeSet:true,autoPlay:false};
  1527.       }
  1528.       this._vp[index].addEventListener("resize",this);
  1529.       this._vp[index].addEventListener("close",this);
  1530.       this._vp[index].addEventListener("complete",this);
  1531.       this._vp[index].addEventListener("cuePoint",this);
  1532.       this._vp[index].addEventListener("playheadUpdate",this);
  1533.       this._vp[index].addEventListener("progress",this);
  1534.       this._vp[index].addEventListener("metadataReceived",this);
  1535.       this._vp[index].addEventListener("stateChange",this);
  1536.       this._vp[index].addEventListener("ready",this);
  1537.       this._vp[index].addEventListener("rewind",this);
  1538.       this._cpMgr[index] = new mx.video.CuePointManager(this,index);
  1539.       this._cpMgr[index].playheadUpdateInterval = this._playheadUpdateInterval;
  1540.    }
  1541.    function createUIManager()
  1542.    {
  1543.       this._uiMgr = new mx.video.UIManager(this);
  1544.       this._uiMgr.visible = false;
  1545.       if(this._backButton != undefined && this._backButton != null)
  1546.       {
  1547.          this._uiMgr.setControl(mx.video.UIManager.BACK_BUTTON,this._backButton);
  1548.       }
  1549.       if(this._bufferingBar != undefined && this._bufferingBar != null)
  1550.       {
  1551.          this._uiMgr.setControl(mx.video.UIManager.BUFFERING_BAR,this._bufferingBar);
  1552.       }
  1553.       this._uiMgr.bufferingBarHidesAndDisablesOthers = this._bufferingBarHides;
  1554.       if(this._forwardButton != undefined && this._forwardButton != null)
  1555.       {
  1556.          this._uiMgr.setControl(mx.video.UIManager.FORWARD_BUTTON,this._forwardButton);
  1557.       }
  1558.       if(this._pauseButton != undefined && this._pauseButton != null)
  1559.       {
  1560.          this._uiMgr.setControl(mx.video.UIManager.PAUSE_BUTTON,this._pauseButton);
  1561.       }
  1562.       if(this._playButton != undefined && this._playButton != null)
  1563.       {
  1564.          this._uiMgr.setControl(mx.video.UIManager.PLAY_BUTTON,this._playButton);
  1565.       }
  1566.       if(this._playPauseButton != undefined && this._playPauseButton != null)
  1567.       {
  1568.          this._uiMgr.setControl(mx.video.UIManager.PLAY_PAUSE_BUTTON,this._playPauseButton);
  1569.       }
  1570.       if(this._stopButton != undefined && this._stopButton != null)
  1571.       {
  1572.          this._uiMgr.setControl(mx.video.UIManager.STOP_BUTTON,this._stopButton);
  1573.       }
  1574.       if(this._seekBar != undefined && this._seekBar != null)
  1575.       {
  1576.          this._uiMgr.setControl(mx.video.UIManager.SEEK_BAR,this._seekBar);
  1577.       }
  1578.       if(this._seekBarInterval != undefined && this._seekBarInterval != null)
  1579.       {
  1580.          this._uiMgr.seekBarInterval = this._seekBarInterval;
  1581.       }
  1582.       if(this._seekBarScrubTolerance != undefined && this._seekBarScrubTolerance != null)
  1583.       {
  1584.          this._uiMgr.seekBarScrubTolerance = this._seekBarScrubTolerance;
  1585.       }
  1586.       if(this._skin != undefined && this._skin != null)
  1587.       {
  1588.          this._uiMgr.skin = this._skin;
  1589.       }
  1590.       if(this._skinAutoHide != undefined && this._skinAutoHide != null)
  1591.       {
  1592.          this._uiMgr.skinAutoHide = this._skinAutoHide;
  1593.       }
  1594.       if(this._muteButton != undefined && this._muteButton != null)
  1595.       {
  1596.          this._uiMgr.setControl(mx.video.UIManager.MUTE_BUTTON,this._muteButton);
  1597.       }
  1598.       if(this._volumeBar != undefined && this._volumeBar != null)
  1599.       {
  1600.          this._uiMgr.setControl(mx.video.UIManager.VOLUME_BAR,this._volumeBar);
  1601.       }
  1602.       if(this._volumeBarInterval != undefined && this._volumeBarInterval != null)
  1603.       {
  1604.          this._uiMgr.volumeBarInterval = this._volumeBarInterval;
  1605.       }
  1606.       if(this._volumeBarScrubTolerance != undefined && this._volumeBarScrubTolerance != null)
  1607.       {
  1608.          this._uiMgr.volumeBarScrubTolerance = this._volumeBarScrubTolerance;
  1609.       }
  1610.    }
  1611.    function createLivePreviewMovieClip()
  1612.    {
  1613.       this.preview_mc = this.createEmptyMovieClip("preview_mc",10);
  1614.       this.preview_mc.createEmptyMovieClip("box_mc",10);
  1615.       this.preview_mc.box_mc.beginFill(0);
  1616.       this.preview_mc.box_mc.moveTo(0,0);
  1617.       this.preview_mc.box_mc.lineTo(0,100);
  1618.       this.preview_mc.box_mc.lineTo(100,100);
  1619.       this.preview_mc.box_mc.lineTo(100,0);
  1620.       this.preview_mc.box_mc.lineTo(0,0);
  1621.       this.preview_mc.box_mc.endFill();
  1622.       this.preview_mc.attachMovie("Icon","icon_mc",20);
  1623.    }
  1624.    function doContentPathConnect()
  1625.    {
  1626.       delete this._vp[0].onEnterFrame;
  1627.       this._vp[0].onEnterFrame = undefined;
  1628.       if(_global.isLivePreview)
  1629.       {
  1630.          return undefined;
  1631.       }
  1632.       if(this._vpState[0].autoPlay && this._firstStreamShown)
  1633.       {
  1634.          this._vp[0].play(this._contentPath,this._isLive,this._totalTime);
  1635.       }
  1636.       else
  1637.       {
  1638.          this._vp[0].load(this._contentPath,this._isLive,this._totalTime);
  1639.       }
  1640.       this._vpState[0].isLiveSet = false;
  1641.       this._vpState[0].totalTimeSet = false;
  1642.    }
  1643.    function showFirstStream()
  1644.    {
  1645.       this._firstStreamShown = true;
  1646.       this._vp[this._visibleVP].visible = true;
  1647.       if(!this.scrubbing)
  1648.       {
  1649.          this._vp[this._visibleVP].volume = this._volume;
  1650.       }
  1651.       var _loc2_ = 0;
  1652.       while(_loc2_ < this._vp.length)
  1653.       {
  1654.          if(this._vp[_loc2_] != undefined && this._vp[_loc2_].state == mx.video.FLVPlayback.STOPPED && this._vpState[_loc2_].autoPlay)
  1655.          {
  1656.             this._vp[_loc2_].play();
  1657.          }
  1658.          _loc2_ = _loc2_ + 1;
  1659.       }
  1660.    }
  1661.    function _scrubStart()
  1662.    {
  1663.       var _loc2_ = this.playheadTime;
  1664.       this._vp[this._visibleVP].volume = 0;
  1665.       this.dispatchEvent({type:"stateChange",state:mx.video.FLVPlayback.SEEKING,playheadTime:_loc2_,vp:this._visibleVP});
  1666.       this.dispatchEvent({type:"scrubStart",state:mx.video.FLVPlayback.SEEKING,playheadTime:_loc2_});
  1667.    }
  1668.    function _scrubFinish()
  1669.    {
  1670.       var _loc3_ = this.playheadTime;
  1671.       var _loc2_ = this.state;
  1672.       this._vp[this._visibleVP].volume = this._volume;
  1673.       if(_loc2_ != mx.video.FLVPlayback.SEEKING)
  1674.       {
  1675.          this.dispatchEvent({type:"stateChange",state:_loc2_,playheadTime:_loc3_,vp:this._visibleVP});
  1676.       }
  1677.       this.dispatchEvent({type:"scrubFinish",state:_loc2_,playheadTime:_loc3_});
  1678.    }
  1679.    function skinError(message)
  1680.    {
  1681.       if(this._firstStreamReady && !this._firstStreamShown)
  1682.       {
  1683.          this.showFirstStream();
  1684.       }
  1685.       this.dispatchEvent({type:"skinError",message:message});
  1686.    }
  1687.    function skinLoaded()
  1688.    {
  1689.       if(this._firstStreamReady)
  1690.       {
  1691.          this._uiMgr.visible = true;
  1692.          if(!this._firstStreamShown)
  1693.          {
  1694.             this.showFirstStream();
  1695.          }
  1696.       }
  1697.       else if(this._contentPath == undefined || this._contentPath == null || this._contentPath == "")
  1698.       {
  1699.          this._uiMgr.visible = true;
  1700.       }
  1701.       this.dispatchEvent({type:"skinLoaded"});
  1702.    }
  1703. }
  1704.