|
@@ -1,6 +1,5 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
|
-import PropTypes from 'prop-types';
|
4
|
3
|
import React, { Component } from 'react';
|
5
|
4
|
|
6
|
5
|
import { Popover } from '../../base/popover';
|
|
@@ -16,58 +15,70 @@ import {
|
16
|
15
|
declare var $: Object;
|
17
|
16
|
declare var interfaceConfig: Object;
|
18
|
17
|
|
|
18
|
+/**
|
|
19
|
+ * The type of the React {@code Component} props of
|
|
20
|
+ * {@link RemoteVideoMenuTriggerButton}.
|
|
21
|
+ */
|
|
22
|
+type Props = {
|
|
23
|
+
|
|
24
|
+ /**
|
|
25
|
+ * A value between 0 and 1 indicating the volume of the participant's
|
|
26
|
+ * audio element.
|
|
27
|
+ */
|
|
28
|
+ initialVolumeValue: number,
|
|
29
|
+
|
|
30
|
+ /**
|
|
31
|
+ * Whether or not the participant is currently muted.
|
|
32
|
+ */
|
|
33
|
+ isAudioMuted: boolean,
|
|
34
|
+
|
|
35
|
+ /**
|
|
36
|
+ * Whether or not the participant is a conference moderator.
|
|
37
|
+ */
|
|
38
|
+ isModerator: boolean,
|
|
39
|
+
|
|
40
|
+ /**
|
|
41
|
+ * Callback to invoke when the popover has been displayed.
|
|
42
|
+ */
|
|
43
|
+ onMenuDisplay: Function,
|
|
44
|
+
|
|
45
|
+ /**
|
|
46
|
+ * Callback to invoke choosing to start a remote control session with
|
|
47
|
+ * the participant.
|
|
48
|
+ */
|
|
49
|
+ onRemoteControlToggle: Function,
|
|
50
|
+
|
|
51
|
+ /**
|
|
52
|
+ * Callback to invoke when changing the level of the participant's
|
|
53
|
+ * audio element.
|
|
54
|
+ */
|
|
55
|
+ onVolumeChange: Function,
|
|
56
|
+
|
|
57
|
+ /**
|
|
58
|
+ * The position relative to the trigger the remote menu should display
|
|
59
|
+ * from. Valid values are those supported by AtlasKit
|
|
60
|
+ * {@code InlineDialog}.
|
|
61
|
+ */
|
|
62
|
+ menuPosition: string,
|
|
63
|
+
|
|
64
|
+ /**
|
|
65
|
+ * The ID for the participant on which the remote video menu will act.
|
|
66
|
+ */
|
|
67
|
+ participantID: string,
|
|
68
|
+
|
|
69
|
+ /**
|
|
70
|
+ * The current state of the participant's remote control session.
|
|
71
|
+ */
|
|
72
|
+ remoteControlState: number
|
|
73
|
+};
|
|
74
|
+
|
19
|
75
|
/**
|
20
|
76
|
* React {@code Component} for displaying an icon associated with opening the
|
21
|
77
|
* the {@code RemoteVideoMenu}.
|
22
|
78
|
*
|
23
|
79
|
* @extends {Component}
|
24
|
80
|
*/
|
25
|
|
-class RemoteVideoMenuTriggerButton extends Component<*> {
|
26
|
|
- static propTypes = {
|
27
|
|
- /**
|
28
|
|
- * A value between 0 and 1 indicating the volume of the participant's
|
29
|
|
- * audio element.
|
30
|
|
- */
|
31
|
|
- initialVolumeValue: PropTypes.number,
|
32
|
|
-
|
33
|
|
- /**
|
34
|
|
- * Whether or not the participant is currently muted.
|
35
|
|
- */
|
36
|
|
- isAudioMuted: PropTypes.bool,
|
37
|
|
-
|
38
|
|
- /**
|
39
|
|
- * Whether or not the participant is a conference moderator.
|
40
|
|
- */
|
41
|
|
- isModerator: PropTypes.bool,
|
42
|
|
-
|
43
|
|
- /**
|
44
|
|
- * Callback to invoke when the popover has been displayed.
|
45
|
|
- */
|
46
|
|
- onMenuDisplay: PropTypes.func,
|
47
|
|
-
|
48
|
|
- /**
|
49
|
|
- * Callback to invoke choosing to start a remote control session with
|
50
|
|
- * the participant.
|
51
|
|
- */
|
52
|
|
- onRemoteControlToggle: PropTypes.func,
|
53
|
|
-
|
54
|
|
- /**
|
55
|
|
- * Callback to invoke when changing the level of the participant's
|
56
|
|
- * audio element.
|
57
|
|
- */
|
58
|
|
- onVolumeChange: PropTypes.func,
|
59
|
|
-
|
60
|
|
- /**
|
61
|
|
- * The ID for the participant on which the remote video menu will act.
|
62
|
|
- */
|
63
|
|
- participantID: PropTypes.string,
|
64
|
|
-
|
65
|
|
- /**
|
66
|
|
- * The current state of the participant's remote control session.
|
67
|
|
- */
|
68
|
|
- remoteControlState: PropTypes.number
|
69
|
|
- };
|
70
|
|
-
|
|
81
|
+class RemoteVideoMenuTriggerButton extends Component<Props> {
|
71
|
82
|
/**
|
72
|
83
|
* The internal reference to topmost DOM/HTML element backing the React
|
73
|
84
|
* {@code Component}. Accessed directly for associating an element as
|
|
@@ -108,8 +119,7 @@ class RemoteVideoMenuTriggerButton extends Component<*> {
|
108
|
119
|
<Popover
|
109
|
120
|
content = { content }
|
110
|
121
|
onPopoverOpen = { this._onShowRemoteMenu }
|
111
|
|
- position = { interfaceConfig.VERTICAL_FILMSTRIP
|
112
|
|
- ? 'left bottom' : 'top center' }>
|
|
122
|
+ position = { this.props.menuPosition }>
|
113
|
123
|
<span
|
114
|
124
|
className = 'popover-trigger remote-video-menu-trigger'>
|
115
|
125
|
<i
|