Browse Source

feat(prejoin) cache media start options when on prejoin screen

master
Tudor-Ovidiu Avram 5 years ago
parent
commit
f376542441
1 changed files with 20 additions and 0 deletions
  1. 20
    0
      react/features/prejoin/middleware.js

+ 20
- 0
react/features/prejoin/middleware.js View File

1
 // @flow
1
 // @flow
2
 
2
 
3
+import { SET_AUDIO_MUTED, SET_VIDEO_MUTED } from '../base/media';
3
 import { MiddlewareRegistry } from '../base/redux';
4
 import { MiddlewareRegistry } from '../base/redux';
4
 import { updateSettings } from '../base/settings';
5
 import { updateSettings } from '../base/settings';
5
 import { getLocalVideoTrack, replaceLocalTrack } from '../base/tracks';
6
 import { getLocalVideoTrack, replaceLocalTrack } from '../base/tracks';
6
 
7
 
7
 import { PREJOIN_START_CONFERENCE } from './actionTypes';
8
 import { PREJOIN_START_CONFERENCE } from './actionTypes';
8
 import { setPrejoinPageVisibility } from './actions';
9
 import { setPrejoinPageVisibility } from './actions';
10
+import { isPrejoinPageVisible } from './functions';
9
 
11
 
10
 declare var APP: Object;
12
 declare var APP: Object;
11
 
13
 
38
 
40
 
39
         break;
41
         break;
40
     }
42
     }
43
+
44
+    case SET_AUDIO_MUTED: {
45
+        if (isPrejoinPageVisible(store.getState())) {
46
+            store.dispatch(updateSettings({
47
+                startWithAudioMuted: Boolean(action.muted)
48
+            }));
49
+        }
50
+        break;
51
+    }
52
+
53
+    case SET_VIDEO_MUTED: {
54
+        if (isPrejoinPageVisible(store.getState())) {
55
+            store.dispatch(updateSettings({
56
+                startWithVideoMuted: Boolean(action.muted)
57
+            }));
58
+        }
59
+        break;
41
     }
60
     }
42
 
61
 
62
+    }
43
 
63
 
44
     return next(action);
64
     return next(action);
45
 });
65
 });

Loading…
Cancel
Save