Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
84 lines (74 sloc) 2.77 KB
/*** RED5 Open Source Flash Server - http://www.osflash.org/red5** Copyright (c) 2006-2009 by respective authors (see below). All rights reserved.** This library is free software; you can redistribute it and/or modify it under the* terms of the GNU Lesser General Public License as published by the Free Software* Foundation; either version 2.1 of the License, or (at your option) any later* version.** This library is distributed in the hope that it will be useful, but WITHOUT ANY* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.** You should have received a copy of the GNU Lesser General Public License along* with this library; if not, write to the Free Software Foundation, Inc.,* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*/import org.red5.samples.livestream.videoconference.Connection;import org.red5.utils.Delegate;import com.gskinner.events.GDispatcher;class org.red5.samples.livestream.videoconference.Connector extends MovieClip {// Constants: public static var CLASS_REF = org.red5.samples.livestream.videoconference.Connector; public static var LINKAGE_ID:String = "org.red5.samples.livestream.videoconference.Connector"; public static var red5URI:String = "rtmp://192.168.0.5/fitcDemo";// Public Properties: public var addEventListener:Function; public var removeEventListener:Function; public var connection:Connection; public var connected:Boolean;// Private Properties: private var dispatchEvent:Function;// Initialization: private function Connector() {GDispatcher.initialize(this);} private function onLoad():Void {}// Public Methods: public function configUI():Void { // instantiate the con qnection connection = new Connection(); // add listener for connection changes connection.addEventListener("success", Delegate.create(this, manageButtons)); connection.addEventListener("onSetID", this); // FITC VIDEO CONFERENCE connection.addEventListener("newStream", this); connection.addEventListener("close", Delegate.create(this, manageButtons)); connected = connection.connect(red5URI, getTimer()); dispatchEvent({type:"connectionChange", connected: connected}); } // FITC VIDEO CONFERENCE private function newStream(evtObj:Object):Void { dispatchEvent({type:"newStream", newStream:evtObj.newStream}); } // FITC VIDEO CONFERENCE private function onSetID(evtObj:Object):Void { dispatchEvent({type:"onSetID", id:evtObj.id}) } public function closeConnection(evtObj:Object):Void { if(connection.connected) { connected = false; connection.close(); } } private function manageButtons(evtObj:Object):Void { dispatchEvent({type:"connectionChange", connected: evtObj.connected}); }}