|
@@ -3,6 +3,7 @@ import { setVideoMuted } from '../base/media';
|
3
|
3
|
import {
|
4
|
4
|
_SET_APP_STATE_LISTENER,
|
5
|
5
|
_SET_BACKGROUND_VIDEO_MUTED,
|
|
6
|
+ _SET_LASTN,
|
6
|
7
|
APP_STATE_CHANGED
|
7
|
8
|
} from './actionTypes';
|
8
|
9
|
|
|
@@ -54,6 +55,23 @@ export function _setAppStateListener(listener: ?Function) {
|
54
|
55
|
*/
|
55
|
56
|
export function _setBackgroundVideoMuted(muted: boolean) {
|
56
|
57
|
return (dispatch, getState) => {
|
|
58
|
+ // Disable remote video when we mute by setting lastN to 0.
|
|
59
|
+ // Skip it if the conference is in audio only mode, as it's
|
|
60
|
+ // already configured to have no video.
|
|
61
|
+ const { audioOnly } = getState()['features/base/conference'];
|
|
62
|
+
|
|
63
|
+ if (!audioOnly) {
|
|
64
|
+ const { config } = getState()['features/base/lib-jitsi-meet'];
|
|
65
|
+ const defaultLastN
|
|
66
|
+ = typeof config.channelLastN === 'undefined'
|
|
67
|
+ ? -1 : config.channelLastN;
|
|
68
|
+
|
|
69
|
+ dispatch({
|
|
70
|
+ type: _SET_LASTN,
|
|
71
|
+ lastN: muted ? 0 : defaultLastN
|
|
72
|
+ });
|
|
73
|
+ }
|
|
74
|
+
|
57
|
75
|
if (muted) {
|
58
|
76
|
const mediaState = getState()['features/base/media'];
|
59
|
77
|
|
|
@@ -62,16 +80,16 @@ export function _setBackgroundVideoMuted(muted: boolean) {
|
62
|
80
|
return;
|
63
|
81
|
}
|
64
|
82
|
} else {
|
65
|
|
- const bgState = getState()['features/background'];
|
|
83
|
+ const { videoMuted } = getState()['features/background'];
|
66
|
84
|
|
67
|
|
- if (!bgState.videoMuted) {
|
|
85
|
+ if (!videoMuted) {
|
68
|
86
|
// We didn't mute video, do nothing.
|
69
|
87
|
return;
|
70
|
88
|
}
|
71
|
89
|
}
|
72
|
90
|
|
73
|
|
- // Remember that video was muted due to the app going to the background
|
74
|
|
- // vs user's choice.
|
|
91
|
+ // Remember that local video was muted due to the app going to the
|
|
92
|
+ // background vs user's choice.
|
75
|
93
|
dispatch({
|
76
|
94
|
type: _SET_BACKGROUND_VIDEO_MUTED,
|
77
|
95
|
muted
|