feat: support config overwrite via URL parameters (#594)

Signed-off-by: Christoph Settgast <csett86@web.de>
This commit is contained in:
csett86 2021-06-27 20:57:44 +02:00 committed by GitHub
parent 2baa4b5282
commit e5d5bcc1db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 0 deletions

View File

@ -209,6 +209,15 @@ class Conference extends Component<Props, State> {
const roomName = url.pathname.split('/').pop();
const host = this._conference.serverURL.replace(/https?:\/\//, '');
const searchParameters = Object.fromEntries(url.searchParams);
const hashParameters = url.hash.substring(1).split('&')
.reduce((res, item) => {
const parts = item.split('=');
res[parts[0]] = parts[1];
return res;
}, {});
const locale = { lng: i18n.language };
const urlParameters = {
...searchParameters,
@ -221,6 +230,14 @@ class Conference extends Component<Props, State> {
startWithVideoMuted: this.props._startWithVideoMuted
};
Object.entries(hashParameters).forEach(([ key, value ]) => {
if (key.startsWith('config.')) {
const configKey = key.substring('config.'.length);
configOverwrite[configKey] = value;
}
});
const options = {
configOverwrite,
onload: this._onIframeLoad,