|
@@ -244,11 +244,20 @@ JitsiConference.prototype._init = function(options = {}) {
|
244
|
244
|
this.participantConnectionStatus.init();
|
245
|
245
|
|
246
|
246
|
if (!this.statistics) {
|
|
247
|
+ // XXX The property location on the global variable window is not
|
|
248
|
+ // defined in all execution environments (e.g. react-native). While
|
|
249
|
+ // jitsi-meet may polyfill it when executing on react-native, it is
|
|
250
|
+ // better for the cross-platform support to not require window.location
|
|
251
|
+ // especially when there is a worthy alternative (as demonstrated
|
|
252
|
+ // bellow).
|
|
253
|
+ const windowLocation = window.location;
|
|
254
|
+
|
247
|
255
|
this.statistics = new Statistics(this.xmpp, {
|
248
|
256
|
callStatsAliasName: this.myUserId(),
|
249
|
257
|
callStatsConfIDNamespace:
|
250
|
258
|
config.callStatsConfIDNamespace
|
251
|
|
- || window.location.hostname,
|
|
259
|
+ || (windowLocation && windowLocation.hostname)
|
|
260
|
+ || (config.hosts && config.hosts.domain),
|
252
|
261
|
callStatsCustomScriptUrl: config.callStatsCustomScriptUrl,
|
253
|
262
|
callStatsID: config.callStatsID,
|
254
|
263
|
callStatsSecret: config.callStatsSecret,
|