|
@@ -1,6 +1,6 @@
|
1
|
1
|
/* @flow */
|
2
|
2
|
/* eslint-disable no-invalid-this */
|
3
|
|
-
|
|
3
|
+import Logger from 'jitsi-meet-logger';
|
4
|
4
|
import throttle from 'lodash/throttle';
|
5
|
5
|
import { Component } from 'react';
|
6
|
6
|
|
|
@@ -9,16 +9,18 @@ import { getCurrentConference } from '../../../base/conference';
|
9
|
9
|
import { MEDIA_TYPE } from '../../../base/media';
|
10
|
10
|
import { getLocalParticipant } from '../../../base/participants';
|
11
|
11
|
import { isLocalTrackMuted } from '../../../base/tracks';
|
|
12
|
+import { showWarningNotification } from '../../../notifications/actions';
|
12
|
13
|
import { dockToolbox } from '../../../toolbox/actions.web';
|
13
|
14
|
import { muteLocal } from '../../../video-menu/actions.any';
|
14
|
|
-import { setSharedVideoStatus } from '../../actions.any';
|
15
|
|
-
|
|
15
|
+import { setSharedVideoStatus, stopSharedVideo } from '../../actions.any';
|
16
|
16
|
export const PLAYBACK_STATES = {
|
17
|
17
|
PLAYING: 'playing',
|
18
|
18
|
PAUSED: 'pause',
|
19
|
19
|
STOPPED: 'stop'
|
20
|
20
|
};
|
21
|
21
|
|
|
22
|
+const logger = Logger.getLogger(__filename);
|
|
23
|
+
|
22
|
24
|
/**
|
23
|
25
|
* Return true if the diffenrece between the two timees is larger than 5.
|
24
|
26
|
*
|
|
@@ -41,11 +43,21 @@ export type Props = {
|
41
|
43
|
*/
|
42
|
44
|
_conference: Object,
|
43
|
45
|
|
|
46
|
+ /**
|
|
47
|
+ * Warning that indicates an incorect video url
|
|
48
|
+ */
|
|
49
|
+ _displayWarning: Function,
|
|
50
|
+
|
44
|
51
|
/**
|
45
|
52
|
* Docks the toolbox
|
46
|
53
|
*/
|
47
|
54
|
_dockToolbox: Function,
|
48
|
55
|
|
|
56
|
+ /**
|
|
57
|
+ * Action to stop video sharing
|
|
58
|
+ */
|
|
59
|
+ _stopSharedVideo: Function,
|
|
60
|
+
|
49
|
61
|
/**
|
50
|
62
|
* Indicates whether the local audio is muted
|
51
|
63
|
*/
|
|
@@ -197,6 +209,17 @@ class AbstractVideoManager extends Component<Props> {
|
197
|
209
|
}
|
198
|
210
|
}
|
199
|
211
|
|
|
212
|
+ /**
|
|
213
|
+ * Handle video error.
|
|
214
|
+ *
|
|
215
|
+ * @returns {void}
|
|
216
|
+ */
|
|
217
|
+ onError() {
|
|
218
|
+ logger.error('Error in the video player');
|
|
219
|
+ this.props._stopSharedVideo();
|
|
220
|
+ this.props._displayWarning();
|
|
221
|
+ }
|
|
222
|
+
|
200
|
223
|
/**
|
201
|
224
|
* Handle video playing.
|
202
|
225
|
*
|
|
@@ -406,9 +429,17 @@ export function _mapStateToProps(state: Object): $Shape<Props> {
|
406
|
429
|
*/
|
407
|
430
|
export function _mapDispatchToProps(dispatch: Function): $Shape<Props> {
|
408
|
431
|
return {
|
|
432
|
+ _displayWarning: () => {
|
|
433
|
+ dispatch(showWarningNotification({
|
|
434
|
+ titleKey: 'dialog.shareVideoLinkError'
|
|
435
|
+ }));
|
|
436
|
+ },
|
409
|
437
|
_dockToolbox: value => {
|
410
|
438
|
dispatch(dockToolbox(value));
|
411
|
439
|
},
|
|
440
|
+ _stopSharedVideo: () => {
|
|
441
|
+ dispatch(stopSharedVideo());
|
|
442
|
+ },
|
412
|
443
|
_muteLocal: value => {
|
413
|
444
|
dispatch(muteLocal(value, MEDIA_TYPE.AUDIO));
|
414
|
445
|
},
|