Add connect method for index.js.
@@ -80,9 +80,9 @@ export default class SFU extends EventEmitter {
constructor (roomId) {
super()
+ this.roomId = roomId;
this.room = new Room(roomId)
-
// bind event callbaks.
this.room.on('onRoomConnect', this.onRoomConnect)
this.room.on('onRoomDisconnect',this.onRoomDisconnect);
@@ -90,6 +90,10 @@ export default class SFU extends EventEmitter {
this.room.on('onRtcLeaveRecver', this.onRtcLeaveRecver)
}
+ connect() {
+ console.log('Connect to [' + this.roomId + ']')
+ }
+
close () {
console.log('Force close.')
this.room.close()
