|
@@ -53,6 +53,7 @@ import {
|
53
|
53
|
updateDeviceList
|
54
|
54
|
} from './react/features/base/devices';
|
55
|
55
|
import {
|
|
56
|
+ browser,
|
56
|
57
|
isFatalJitsiConnectionError,
|
57
|
58
|
JitsiConferenceErrors,
|
58
|
59
|
JitsiConferenceEvents,
|
|
@@ -493,9 +494,9 @@ export default {
|
493
|
494
|
|
494
|
495
|
JitsiMeetJS.mediaDevices.addEventListener(
|
495
|
496
|
JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN,
|
496
|
|
- browser =>
|
|
497
|
+ browserName =>
|
497
|
498
|
APP.store.dispatch(
|
498
|
|
- mediaPermissionPromptVisibilityChanged(true, browser))
|
|
499
|
+ mediaPermissionPromptVisibilityChanged(true, browserName))
|
499
|
500
|
);
|
500
|
501
|
|
501
|
502
|
let tryCreateLocalTracks;
|
|
@@ -1605,8 +1606,10 @@ export default {
|
1605
|
1606
|
*/
|
1606
|
1607
|
async _createPresenterStreamEffect(height = null, cameraDeviceId = null) {
|
1607
|
1608
|
if (!this.localPresenterVideo) {
|
|
1609
|
+ const camera = cameraDeviceId ?? getUserSelectedCameraDeviceId(APP.store.getState());
|
|
1610
|
+
|
1608
|
1611
|
try {
|
1609
|
|
- this.localPresenterVideo = await createLocalPresenterTrack({ cameraDeviceId }, height);
|
|
1612
|
+ this.localPresenterVideo = await createLocalPresenterTrack({ cameraDeviceId: camera }, height);
|
1610
|
1613
|
} catch (err) {
|
1611
|
1614
|
logger.error('Failed to create a camera track for presenter', err);
|
1612
|
1615
|
|
|
@@ -1647,37 +1650,39 @@ export default {
|
1647
|
1650
|
|
1648
|
1651
|
// Create a new presenter track and apply the presenter effect.
|
1649
|
1652
|
if (!this.localPresenterVideo && !mute) {
|
1650
|
|
- let { aspectRatio, height } = this.localVideo.track.getSettings();
|
1651
|
|
- const { width } = this.localVideo.track.getSettings();
|
|
1653
|
+ const { height, width } = this.localVideo.track.getSettings() ?? this.localVideo.track.getConstraints();
|
1652
|
1654
|
let desktopResizeConstraints = {};
|
1653
|
1655
|
let resizeDesktopStream = false;
|
1654
|
1656
|
const DESKTOP_STREAM_CAP = 720;
|
1655
|
1657
|
|
1656
|
|
- // Determine the constraints if the desktop track needs to be resized.
|
1657
|
|
- // Resizing is needed when the resolution cannot be determined or when
|
1658
|
|
- // the window is bigger than 720p.
|
1659
|
|
- if (height && width) {
|
1660
|
|
- aspectRatio = aspectRatio ?? (width / height).toPrecision(4);
|
1661
|
|
- const advancedConstraints = [ { aspectRatio } ];
|
1662
|
|
- const isPortrait = height >= width;
|
1663
|
|
-
|
1664
|
|
- // Determine which dimension needs resizing and resize only that side
|
1665
|
|
- // keeping the aspect ratio same as before.
|
1666
|
|
- if (isPortrait && width > DESKTOP_STREAM_CAP) {
|
1667
|
|
- resizeDesktopStream = true;
|
1668
|
|
- advancedConstraints.push({ width: DESKTOP_STREAM_CAP });
|
1669
|
|
- } else if (!isPortrait && height > DESKTOP_STREAM_CAP) {
|
|
1658
|
+ // Resizing the desktop track for presenter is causing blurriness of the desktop share.
|
|
1659
|
+ // Disable this behavior for now until it is fixed in Chrome. The stream needs to be resized
|
|
1660
|
+ // Firefox always.
|
|
1661
|
+ if ((config.videoQuality && config.videoQuality.resizeDesktopForPresenter) || browser.isFirefox()) {
|
|
1662
|
+ // Resizing is needed when the window is bigger than 720p.
|
|
1663
|
+ if (height && width) {
|
|
1664
|
+ const advancedConstraints = [ { aspectRatio: (width / height).toPrecision(4) } ];
|
|
1665
|
+ const isPortrait = height >= width;
|
|
1666
|
+
|
|
1667
|
+ // Determine which dimension needs resizing and resize only that side
|
|
1668
|
+ // keeping the aspect ratio same as before.
|
|
1669
|
+ if (isPortrait && width > DESKTOP_STREAM_CAP) {
|
|
1670
|
+ resizeDesktopStream = true;
|
|
1671
|
+ advancedConstraints.push({ width: DESKTOP_STREAM_CAP });
|
|
1672
|
+ } else if (!isPortrait && height > DESKTOP_STREAM_CAP) {
|
|
1673
|
+ resizeDesktopStream = true;
|
|
1674
|
+ advancedConstraints.push({ height: DESKTOP_STREAM_CAP });
|
|
1675
|
+ }
|
|
1676
|
+ desktopResizeConstraints.advanced = advancedConstraints;
|
|
1677
|
+ } else {
|
1670
|
1678
|
resizeDesktopStream = true;
|
1671
|
|
- advancedConstraints.push({ height: DESKTOP_STREAM_CAP });
|
|
1679
|
+ desktopResizeConstraints = {
|
|
1680
|
+ width: 1280,
|
|
1681
|
+ height: 720
|
|
1682
|
+ };
|
1672
|
1683
|
}
|
1673
|
|
- desktopResizeConstraints.advanced = advancedConstraints;
|
1674
|
|
- } else {
|
1675
|
|
- resizeDesktopStream = true;
|
1676
|
|
- desktopResizeConstraints = {
|
1677
|
|
- width: 1280,
|
1678
|
|
- height: 720
|
1679
|
|
- };
|
1680
|
1684
|
}
|
|
1685
|
+
|
1681
|
1686
|
if (resizeDesktopStream) {
|
1682
|
1687
|
try {
|
1683
|
1688
|
await this.localVideo.track.applyConstraints(desktopResizeConstraints);
|
|
@@ -1686,14 +1691,15 @@ export default {
|
1686
|
1691
|
|
1687
|
1692
|
return;
|
1688
|
1693
|
}
|
1689
|
|
- height = this.localVideo.track.getSettings().height ?? DESKTOP_STREAM_CAP;
|
1690
|
1694
|
}
|
|
1695
|
+ const trackHeight = resizeDesktopStream
|
|
1696
|
+ ? this.localVideo.track.getSettings().height ?? DESKTOP_STREAM_CAP
|
|
1697
|
+ : height;
|
1691
|
1698
|
const defaultCamera = getUserSelectedCameraDeviceId(APP.store.getState());
|
1692
|
1699
|
let effect;
|
1693
|
1700
|
|
1694
|
1701
|
try {
|
1695
|
|
- effect = await this._createPresenterStreamEffect(height,
|
1696
|
|
- defaultCamera);
|
|
1702
|
+ effect = await this._createPresenterStreamEffect(trackHeight, defaultCamera);
|
1697
|
1703
|
} catch (err) {
|
1698
|
1704
|
logger.error('Failed to unmute Presenter Video');
|
1699
|
1705
|
maybeShowErrorDialog(err);
|