From 3561204bb52418dbd9356cb0ba29faefeba6047f Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Thu, 20 Aug 2015 14:35:16 -0500 Subject: [PATCH] Allows to overwrite config and interfaceConfig options through the external API. --- external_api.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/external_api.js b/external_api.js index bb8301b8d..78fbb6f5c 100644 --- a/external_api.js +++ b/external_api.js @@ -28,7 +28,7 @@ var JitsiMeetExternalAPI = (function() * @constructor */ function JitsiMeetExternalAPI(domain, room_name, width, height, parentNode, - filmStripOnly) { + configOverwrite, interfaceConfigOverwrite) { if((!width || width < MIN_WIDTH) && !filmStripOnly) width = MIN_WIDTH; if((!height || height < MIN_HEIGHT) && !filmStripOnly) @@ -54,8 +54,25 @@ var JitsiMeetExternalAPI = (function() if(room_name) this.url += room_name; this.url += "#external=true"; - if(filmStripOnly) - this.url += "&interfaceConfig.filmStripOnly=true"; + + var key; + if (configOverwrite) { + for (key in configOverwrite) { + if (!configOverwrite.hasOwnProperty(key) || + typeof key !== 'string') + continue; + this.url += "&config." + key + "=" + configOverwrite[key]; + } + } + + if (interfaceConfigOverwrite) { + for (key in interfaceConfigOverwrite) { + if (!interfaceConfigOverwrite.hasOwnProperty(key) || + typeof key !== 'string') + continue; + this.url += "&interfaceConfig." + key + "=" + interfaceConfigOverwrite[key]; + } + } JitsiMeetExternalAPI.id++;