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

This commit is contained in:
Jaya Allamsetty 2019-12-09 16:48:53 -05:00 committed by Jaya Allamsetty
parent 9c77ab7f4d
commit a3cd331369
1 changed files with 21 additions and 3 deletions

View File

@ -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 {