Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix: Workaround on FF for getting the resolution of the desktop track

Jaya Allamsettya3cd33136956
diff --git a/conference.js b/conference.js
index e9afc4dd19..ae024ffe4c 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 {