home *** CD-ROM | disk | FTP | other *** search
- class mx.controls.streamingmedia.RTMPConnection extends NetConnection
- {
- var _player;
- var _targetURI;
- var _streamName;
- static var _connectFlag;
- static var _connectorQueue = new Array();
- function RTMPConnection(player)
- {
- super();
- this._player = player;
- }
- function onMetaData(info)
- {
- this._player.setTotalTime(info.duration);
- }
- function connect(targetURI, streamName)
- {
- if(mx.controls.streamingmedia.RTMPConnection._connectFlag == true)
- {
- this.pushConnection(targetURI,streamName);
- return undefined;
- }
- mx.controls.streamingmedia.RTMPConnection._connectFlag = true;
- super.connect(targetURI,streamName);
- this.popConnection();
- }
- function pushConnection(targetURI, streamName)
- {
- this._targetURI = targetURI;
- this._streamName = streamName;
- mx.controls.streamingmedia.RTMPConnection._connectorQueue.push(this);
- }
- function popConnection()
- {
- mx.controls.streamingmedia.RTMPConnection._connectFlag = false;
- if(mx.controls.streamingmedia.RTMPConnection._connectorQueue.length != 0)
- {
- var _loc1_ = mx.controls.streamingmedia.RTMPConnection._connectorQueue.pop();
- _loc1_.connect(_loc1_._targetURI,_loc1_._streamName);
- }
- }
- }
-