From cf7f2dabfb0762f5294c4cadb40c329c70987ff2 Mon Sep 17 00:00:00 2001 From: Christophe HAMERLING Date: Mon, 20 Apr 2020 14:14:47 +0200 Subject: [PATCH] Add support for URL query parameters --- app/features/conference/components/Conference.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/features/conference/components/Conference.js b/app/features/conference/components/Conference.js index 30d6139..0b8b798 100644 --- a/app/features/conference/components/Conference.js +++ b/app/features/conference/components/Conference.js @@ -241,19 +241,27 @@ class Conference extends Component { */ _onScriptLoad(parentNode: Object) { const JitsiMeetExternalAPI = window.JitsiMeetExternalAPI; - + const url = new URL(this._conference.room, this._conference.serverURL); + const roomName = url.pathname.split('/').pop(); const host = this._conference.serverURL.replace(/https?:\/\//, ''); + const searchParameters = Object.fromEntries(url.searchParams); + const urlParameters = Object.keys(searchParameters).length ? searchParameters : {}; const configOverwrite = { startWithAudioMuted: this.props._startWithAudioMuted, startWithVideoMuted: this.props._startWithVideoMuted }; - this._api = new JitsiMeetExternalAPI(host, { + const options = { configOverwrite, onload: this._onIframeLoad, parentNode, - roomName: this._conference.room + roomName + }; + + this._api = new JitsiMeetExternalAPI(host, { + ...options, + ...urlParameters }); const { RemoteControl,