webrtc connector working

This commit is contained in:
Kevin Jahns
2015-07-14 22:39:01 +02:00
parent 6b153896dd
commit 9b3fe2f197
8 changed files with 37 additions and 12 deletions

View File

@@ -1,12 +1,14 @@
class WebRTC extends AbstractConnector {
constructor (options) {
constructor (y, options) {
if(options === undefined){
throw new Error("Options must not be undefined!");
}
super({
role: "slave"
});
if(options.room == null) {
throw new Error("You must define a room name!");
}
options.role = "slave";
super(y, options);
var room = options.room;
@@ -25,12 +27,13 @@ class WebRTC extends AbstractConnector {
swr.once("joinedRoom", function(){
self.setUserId(userId);
/*
var i;
// notify the connector class about all the users that already
// joined the session
for(i in self.swr.webrtc.peers){
self.userJoined(self.swr.webrtc.peers[i].id, "master");
}
}*/
swr.on("channelMessage", function(peer, room_, message){
// The client received a message
// Check if the connector is already initialized,