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