|
@@ -2,8 +2,7 @@
|
2
|
2
|
|
3
|
3
|
import { SET_ROOM } from '../conference';
|
4
|
4
|
import { JitsiConnectionErrors } from '../lib-jitsi-meet';
|
5
|
|
-import { assign, ReducerRegistry } from '../redux';
|
6
|
|
-import { parseURIString } from '../util';
|
|
5
|
+import { assign, set, ReducerRegistry } from '../redux';
|
7
|
6
|
|
8
|
7
|
import {
|
9
|
8
|
CONNECTION_DISCONNECTED,
|
|
@@ -153,50 +152,6 @@ function _connectionWillConnect(
|
153
|
152
|
});
|
154
|
153
|
}
|
155
|
154
|
|
156
|
|
-/**
|
157
|
|
- * Constructs options to be passed to the constructor of {@code JitsiConnection}
|
158
|
|
- * based on a specific location URL.
|
159
|
|
- *
|
160
|
|
- * @param {string} locationURL - The location URL with which the returned
|
161
|
|
- * options are to be constructed.
|
162
|
|
- * @private
|
163
|
|
- * @returns {Object} The options to be passed to the constructor of
|
164
|
|
- * {@code JitsiConnection} based on the location URL.
|
165
|
|
- */
|
166
|
|
-function _constructOptions(locationURL: URL) {
|
167
|
|
- const locationURI = parseURIString(locationURL.href);
|
168
|
|
-
|
169
|
|
- // FIXME The HTTPS scheme for the BOSH URL works with meet.jit.si on both
|
170
|
|
- // mobile & Web. It also works with beta.meet.jit.si on Web. Unfortunately,
|
171
|
|
- // it doesn't work with beta.meet.jit.si on mobile. Temporarily, use the
|
172
|
|
- // HTTP scheme for the BOSH URL with beta.meet.jit.si on mobile.
|
173
|
|
- let { protocol } = locationURI;
|
174
|
|
- const domain = locationURI.hostname;
|
175
|
|
-
|
176
|
|
- if (!protocol && domain === 'beta.meet.jit.si') {
|
177
|
|
- const windowLocation = window.location;
|
178
|
|
-
|
179
|
|
- windowLocation && (protocol = windowLocation.protocol);
|
180
|
|
- protocol || (protocol = 'http:');
|
181
|
|
- }
|
182
|
|
-
|
183
|
|
- // Default to the HTTPS scheme for the BOSH URL.
|
184
|
|
- protocol || (protocol = 'https:');
|
185
|
|
-
|
186
|
|
- return {
|
187
|
|
- bosh:
|
188
|
|
- `${String(protocol)}//${domain}${
|
189
|
|
- locationURI.contextRoot || '/'}http-bind`,
|
190
|
|
- hosts: {
|
191
|
|
- domain,
|
192
|
|
-
|
193
|
|
- // Required by:
|
194
|
|
- // - lib-jitsi-meet/modules/xmpp/xmpp.js
|
195
|
|
- muc: `conference.${domain}`
|
196
|
|
- }
|
197
|
|
- };
|
198
|
|
-}
|
199
|
|
-
|
200
|
155
|
/**
|
201
|
156
|
* The current (similar to getCurrentConference in base/conference/functions.js)
|
202
|
157
|
* connection which is {@code connection} or {@code connecting}.
|
|
@@ -223,10 +178,7 @@ function _getCurrentConnection(baseConnectionState: Object): ?Object {
|
223
|
178
|
function _setLocationURL(
|
224
|
179
|
state: Object,
|
225
|
180
|
{ locationURL }: { locationURL: ?URL }) {
|
226
|
|
- return assign(state, {
|
227
|
|
- locationURL,
|
228
|
|
- options: locationURL ? _constructOptions(locationURL) : undefined
|
229
|
|
- });
|
|
181
|
+ return set(state, 'locationURL', locationURL);
|
230
|
182
|
}
|
231
|
183
|
|
232
|
184
|
/**
|