|
@@ -16,6 +16,8 @@ import { openDisplayNamePrompt } from '../../display-name/actions';
|
16
|
16
|
import { readyToClose } from '../../mobile/external-api/actions';
|
17
|
17
|
import { showErrorNotification, showWarningNotification } from '../../notifications/actions';
|
18
|
18
|
import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants';
|
|
19
|
+import { stopLocalVideoRecording } from '../../recording/actions.any';
|
|
20
|
+import LocalRecordingManager from '../../recording/components/Recording/LocalRecordingManager';
|
19
|
21
|
import { setIAmVisitor } from '../../visitors/actions';
|
20
|
22
|
import { iAmVisitor } from '../../visitors/functions';
|
21
|
23
|
import { overwriteConfig } from '../config/actions';
|
|
@@ -71,7 +73,7 @@ import logger from './logger';
|
71
|
73
|
/**
|
72
|
74
|
* Handler for before unload event.
|
73
|
75
|
*/
|
74
|
|
-let beforeUnloadHandler: (() => void) | undefined;
|
|
76
|
+let beforeUnloadHandler: ((e?: any) => void) | undefined;
|
75
|
77
|
|
76
|
78
|
/**
|
77
|
79
|
* Implements the middleware of the feature base/conference.
|
|
@@ -295,7 +297,14 @@ function _conferenceJoined({ dispatch, getState }: IStore, next: Function, actio
|
295
|
297
|
// handles the process of leaving the conference. This is temporary solution
|
296
|
298
|
// that should cover the described use case as part of the effort to
|
297
|
299
|
// implement the conferenceWillLeave action for web.
|
298
|
|
- beforeUnloadHandler = () => {
|
|
300
|
+ beforeUnloadHandler = (e?: any) => {
|
|
301
|
+ if (LocalRecordingManager.isRecordingLocally()) {
|
|
302
|
+ dispatch(stopLocalVideoRecording());
|
|
303
|
+ if (e) {
|
|
304
|
+ e.preventDefault();
|
|
305
|
+ e.returnValue = null;
|
|
306
|
+ }
|
|
307
|
+ }
|
299
|
308
|
dispatch(conferenceWillLeave(conference));
|
300
|
309
|
};
|
301
|
310
|
|