|
|
|
|
@ -1,4 +1,6 @@ |
|
|
|
|
/* global $, APP, JitsiMeetJS, config, interfaceConfig */ |
|
|
|
|
const logger = require("jitsi-meet-logger").getLogger(__filename); |
|
|
|
|
|
|
|
|
|
import {openConnection} from './connection'; |
|
|
|
|
import Invite from './modules/UI/invite/Invite'; |
|
|
|
|
import ContactList from './modules/UI/side_pannels/contactlist/ContactList'; |
|
|
|
|
@ -166,7 +168,7 @@ function muteLocalMedia(localMedia, muted, localMediaTypeString) { |
|
|
|
|
const method = muted ? 'mute' : 'unmute'; |
|
|
|
|
|
|
|
|
|
localMedia[method]().catch(reason => { |
|
|
|
|
console.warn(`${localMediaTypeString} ${method} was rejected:`, reason); |
|
|
|
|
logger.warn(`${localMediaTypeString} ${method} was rejected:`, reason); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -254,7 +256,7 @@ function createLocalTracks (options, checkForPermissionPrompt) { |
|
|
|
|
}); |
|
|
|
|
return tracks; |
|
|
|
|
}).catch(function (err) { |
|
|
|
|
console.error( |
|
|
|
|
logger.error( |
|
|
|
|
'failed to create local tracks', options.devices, err); |
|
|
|
|
return Promise.reject(err); |
|
|
|
|
}); |
|
|
|
|
@ -310,7 +312,7 @@ class ConferenceConnector { |
|
|
|
|
this._reject(err); |
|
|
|
|
} |
|
|
|
|
_onConferenceFailed(err, ...params) { |
|
|
|
|
console.error('CONFERENCE FAILED:', err, ...params); |
|
|
|
|
logger.error('CONFERENCE FAILED:', err, ...params); |
|
|
|
|
APP.UI.hideRingOverLay(); |
|
|
|
|
switch (err) { |
|
|
|
|
// room is locked by the password
|
|
|
|
|
@ -398,7 +400,7 @@ class ConferenceConnector { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
_onConferenceError(err, ...params) { |
|
|
|
|
console.error('CONFERENCE Error:', err, params); |
|
|
|
|
logger.error('CONFERENCE Error:', err, params); |
|
|
|
|
switch (err) { |
|
|
|
|
case ConferenceErrors.CHAT_ERROR: |
|
|
|
|
{ |
|
|
|
|
@ -407,7 +409,7 @@ class ConferenceConnector { |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
console.error("Unknown error."); |
|
|
|
|
logger.error("Unknown error.", err); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
_unsubscribe() { |
|
|
|
|
@ -493,7 +495,7 @@ export default { |
|
|
|
|
analytics.init(); |
|
|
|
|
return createInitialLocalTracksAndConnect(options.roomName); |
|
|
|
|
}).then(([tracks, con]) => { |
|
|
|
|
console.log('initialized with %s local tracks', tracks.length); |
|
|
|
|
logger.log('initialized with %s local tracks', tracks.length); |
|
|
|
|
APP.connection = connection = con; |
|
|
|
|
this._bindConnectionFailedHandler(con); |
|
|
|
|
this._createRoom(tracks); |
|
|
|
|
@ -546,7 +548,7 @@ export default { |
|
|
|
|
// - item-not-found
|
|
|
|
|
// - connection dropped(closed by Strophe unexpectedly
|
|
|
|
|
// possible due too many transport errors)
|
|
|
|
|
console.error("XMPP connection error: " + errMsg); |
|
|
|
|
logger.error("XMPP connection error: " + errMsg); |
|
|
|
|
APP.UI.showPageReloadOverlay(); |
|
|
|
|
connection.removeEventListener( |
|
|
|
|
ConnectionEvents.CONNECTION_FAILED, handler); |
|
|
|
|
@ -876,7 +878,7 @@ export default { |
|
|
|
|
} else if (track.isVideoTrack()) { |
|
|
|
|
return this.useVideoStream(track); |
|
|
|
|
} else { |
|
|
|
|
console.error( |
|
|
|
|
logger.error( |
|
|
|
|
"Ignored not an audio nor a video track: ", track); |
|
|
|
|
return Promise.resolve(); |
|
|
|
|
} |
|
|
|
|
@ -968,11 +970,11 @@ export default { |
|
|
|
|
videoSwitchInProgress: false, |
|
|
|
|
toggleScreenSharing (shareScreen = !this.isSharingScreen) { |
|
|
|
|
if (this.videoSwitchInProgress) { |
|
|
|
|
console.warn("Switch in progress."); |
|
|
|
|
logger.warn("Switch in progress."); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (!this.isDesktopSharingEnabled) { |
|
|
|
|
console.warn("Cannot toggle screen sharing: not supported."); |
|
|
|
|
logger.warn("Cannot toggle screen sharing: not supported."); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -1026,7 +1028,7 @@ export default { |
|
|
|
|
this.videoSwitchInProgress = false; |
|
|
|
|
JitsiMeetJS.analytics.sendEvent( |
|
|
|
|
'conference.sharingDesktop.start'); |
|
|
|
|
console.log('sharing local desktop'); |
|
|
|
|
logger.log('sharing local desktop'); |
|
|
|
|
}).catch((err) => { |
|
|
|
|
// close external installation dialog to show the error.
|
|
|
|
|
if(externalInstallation) |
|
|
|
|
@ -1038,7 +1040,7 @@ export default { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
console.error('failed to share local desktop', err); |
|
|
|
|
logger.error('failed to share local desktop', err); |
|
|
|
|
|
|
|
|
|
if (err.name === TrackErrors.FIREFOX_EXTENSION_NEEDED) { |
|
|
|
|
APP.UI.showExtensionRequiredDialog( |
|
|
|
|
@ -1075,11 +1077,11 @@ export default { |
|
|
|
|
this.videoSwitchInProgress = false; |
|
|
|
|
JitsiMeetJS.analytics.sendEvent( |
|
|
|
|
'conference.sharingDesktop.stop'); |
|
|
|
|
console.log('sharing local video'); |
|
|
|
|
logger.log('sharing local video'); |
|
|
|
|
}).catch((err) => { |
|
|
|
|
this.useVideoStream(null); |
|
|
|
|
this.videoSwitchInProgress = false; |
|
|
|
|
console.error('failed to share local video', err); |
|
|
|
|
logger.error('failed to share local video', err); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
@ -1105,7 +1107,7 @@ export default { |
|
|
|
|
if (user.isHidden()) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
console.log('USER %s connnected', id, user); |
|
|
|
|
logger.log('USER %s connnected', id, user); |
|
|
|
|
APP.API.notifyUserJoined(id); |
|
|
|
|
APP.UI.addUser(user); |
|
|
|
|
|
|
|
|
|
@ -1113,7 +1115,7 @@ export default { |
|
|
|
|
APP.UI.updateUserRole(user); |
|
|
|
|
}); |
|
|
|
|
room.on(ConferenceEvents.USER_LEFT, (id, user) => { |
|
|
|
|
console.log('USER %s LEFT', id, user); |
|
|
|
|
logger.log('USER %s LEFT', id, user); |
|
|
|
|
APP.API.notifyUserLeft(id); |
|
|
|
|
APP.UI.removeUser(id, user.getDisplayName()); |
|
|
|
|
APP.UI.onSharedVideoStop(id); |
|
|
|
|
@ -1122,7 +1124,7 @@ export default { |
|
|
|
|
|
|
|
|
|
room.on(ConferenceEvents.USER_ROLE_CHANGED, (id, role) => { |
|
|
|
|
if (this.isLocalId(id)) { |
|
|
|
|
console.info(`My role changed, new role: ${role}`); |
|
|
|
|
logger.info(`My role changed, new role: ${role}`); |
|
|
|
|
if (this.isModerator !== room.isModerator()) { |
|
|
|
|
this.isModerator = room.isModerator(); |
|
|
|
|
APP.UI.updateLocalRole(room.isModerator()); |
|
|
|
|
@ -1180,7 +1182,7 @@ export default { |
|
|
|
|
{ |
|
|
|
|
this.audioLevelsMap[id] = lvl; |
|
|
|
|
if(config.debugAudioLevels) |
|
|
|
|
console.log("AudioLevel:" + id + "/" + lvl); |
|
|
|
|
logger.log("AudioLevel:" + id + "/" + lvl); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
APP.UI.setAudioLevel(id, lvl); |
|
|
|
|
@ -1261,7 +1263,7 @@ export default { |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
room.on(ConferenceEvents.RECORDER_STATE_CHANGED, (status, error) => { |
|
|
|
|
console.log("Received recorder status change: ", status, error); |
|
|
|
|
logger.log("Received recorder status change: ", status, error); |
|
|
|
|
APP.UI.updateRecordingState(status); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
@ -1497,7 +1499,7 @@ export default { |
|
|
|
|
}) |
|
|
|
|
.then(([stream]) => { |
|
|
|
|
this.useVideoStream(stream); |
|
|
|
|
console.log('switched local video device'); |
|
|
|
|
logger.log('switched local video device'); |
|
|
|
|
APP.settings.setCameraDeviceId(cameraDeviceId, true); |
|
|
|
|
}) |
|
|
|
|
.catch((err) => { |
|
|
|
|
@ -1519,7 +1521,7 @@ export default { |
|
|
|
|
}) |
|
|
|
|
.then(([stream]) => { |
|
|
|
|
this.useAudioStream(stream); |
|
|
|
|
console.log('switched local audio device'); |
|
|
|
|
logger.log('switched local audio device'); |
|
|
|
|
APP.settings.setMicDeviceId(micDeviceId, true); |
|
|
|
|
}) |
|
|
|
|
.catch((err) => { |
|
|
|
|
@ -1535,9 +1537,9 @@ export default { |
|
|
|
|
JitsiMeetJS.analytics.sendEvent( |
|
|
|
|
'settings.changeDevice.audioOut'); |
|
|
|
|
APP.settings.setAudioOutputDeviceId(audioOutputDeviceId) |
|
|
|
|
.then(() => console.log('changed audio output device')) |
|
|
|
|
.then(() => logger.log('changed audio output device')) |
|
|
|
|
.catch((err) => { |
|
|
|
|
console.warn('Failed to change audio output device. ' + |
|
|
|
|
logger.warn('Failed to change audio output device. ' + |
|
|
|
|
'Default or previously set audio output device ' + |
|
|
|
|
'will be used instead.', err); |
|
|
|
|
APP.UI.setSelectedAudioOutputFromSettings(); |
|
|
|
|
|