diff --git a/conference.js b/conference.js index e9afc4dd1..ae024ffe4 100644 --- a/conference.js +++ b/conference.js @@ -1637,9 +1637,27 @@ export default { if (!this.localPresenterVideo && !mute) { // create a new presenter track and apply the presenter effect. - const { height } = this.localVideo.track.getSettings(); - const defaultCamera - = getUserSelectedCameraDeviceId(APP.store.getState()); + let { height } = this.localVideo.track.getSettings(); + + // Workaround for Firefox since it doesn't return the correct width/height of the desktop stream + // that is being currently shared. + if (!height || height === 0) { + const desktopResizeConstraints = { + width: 1280, + height: 720, + resizeMode: 'crop-and-scale' + }; + + try { + await this.localVideo.track.applyConstraints(desktopResizeConstraints); + } catch (err) { + logger.error('Failed to apply constraints on the desktop stream for presenter mode', err); + + return; + } + height = desktopResizeConstraints.height; + } + const defaultCamera = getUserSelectedCameraDeviceId(APP.store.getState()); let effect; try {