feat(iframeAPI): implement avatar change commands

This commit is contained in:
hristoterezov
2017-01-12 15:53:17 -06:00
parent 85e5b0fc31
commit f7ce8d028d
4 changed files with 61 additions and 35 deletions
+4 -2
View File
@@ -54,10 +54,12 @@ function initCommands() {
"toggle-contact-list": APP.UI.toggleContactList,
"toggle-share-screen":
APP.conference.toggleScreenSharing.bind(APP.conference),
"video-hangup": () => APP.conference.hangup()
"video-hangup": () => APP.conference.hangup(),
"email": APP.conference.changeLocalEmail,
"avatar-url": APP.conference.changeLocalAvatarUrl
};
Object.keys(commands).forEach(function (key) {
postis.listen(key, commands[key]);
postis.listen(key, args => commands[key](...args));
});
}
+6 -6
View File
@@ -36,7 +36,9 @@ var commands = {
"toggleChat": "toggle-chat",
"toggleContactList": "toggle-contact-list",
"toggleShareScreen": "toggle-share-screen",
"hangup": "video-hangup"
"hangup": "video-hangup",
"email": "email",
"avatarUrl": "avatar-url"
};
/**
@@ -174,15 +176,13 @@ function JitsiMeetExternalAPI(domain, room_name, width, height, parentNode,
* @param name the name of the command
* @param arguments array of arguments
*/
JitsiMeetExternalAPI.prototype.executeCommand = function(name, argumentsList) {
JitsiMeetExternalAPI.prototype.executeCommand
= function(name, ...argumentsList) {
if(!(name in commands)) {
logger.error("Not supported command name.");
return;
}
var argumentsArray = argumentsList;
if (!argumentsArray)
argumentsArray = [];
sendMessage(this.postis, {method: commands[name], params: argumentsArray});
sendMessage(this.postis, {method: commands[name], params: argumentsList});
};
/**