Commit f1b133e1 authored by Tom Jorquera's avatar Tom Jorquera
Browse files

client: Update controller API

Update controller API according to #1

Fixes #5
parent dd944083
......@@ -7,7 +7,6 @@
/* exported robotController */
const room = arguments[0];
const name = arguments[1];
robotController = {
$scope: angular.element(document.body).scope().$root,
......@@ -38,20 +37,21 @@ robotController = {
}
}
return res;
}
},
onAttendeePush: () => {},
onAttendeeRemove: () => {},
onAttendeeUpdate: () => {}
};
robotController.$scope.$on('conferencestate:attendees:push', (event, data) => {
console.log('### someone connected %j %j', event, data);
console.log('RemoteMediaStream %j', robotController.getRemoteStream(data.easyrtcid));
robotController.chatService.sendMessage({author: name, displayName: name, message: 'Hello!'});
robotController.onAttendeePush(event, data);
});
robotController.$scope.$on('conferencestate:attendees:remove', (event, data) => {
console.log('### someone leaved %j %j', event, data);
robotController.chatService.sendMessage({author: name, displayName: name, message: 'Goodbye!'});
robotController.onAttendeeRemove(event, data);
});
robotController.$scope.$on('attendee:update', (event, data) => {
console.log('### received update %j %j', event, data);
robotController.$scope.$on('conferencestate:attendees:update', (event, data) => {
robotController.onAttendeeUpdate(event, data);
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment