home *** CD-ROM | disk | FTP | other *** search
/ csi.uticak12.org / csi.uticak12.org.tar / csi.uticak12.org / flashVideo / ArtProject.swf / scripts / __Packages / mx / video / FLVPlayback.as < prev    next >
Text File  |  2010-12-15  |  50KB  |  1,665 lines

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