|
@@ -0,0 +1,81 @@
|
|
1
|
+// @flow
|
|
2
|
+import React, { Component } from 'react';
|
|
3
|
+import { View } from 'react-native';
|
|
4
|
+import { connect } from 'react-redux';
|
|
5
|
+
|
|
6
|
+import { JitsiRecordingConstants } from '../../base/lib-jitsi-meet';
|
|
7
|
+import {
|
|
8
|
+ isNarrowAspectRatio,
|
|
9
|
+ makeAspectRatioAware
|
|
10
|
+} from '../../base/responsive-ui';
|
|
11
|
+import { RecordingLabel } from '../../recording';
|
|
12
|
+import { VideoQualityLabel } from '../../video-quality';
|
|
13
|
+
|
|
14
|
+import styles from './styles';
|
|
15
|
+
|
|
16
|
+type Props = {
|
|
17
|
+
|
|
18
|
+ /**
|
|
19
|
+ * The indicator which determines whether the filmstrip is visible.
|
|
20
|
+ */
|
|
21
|
+ _filmstripVisible: boolean
|
|
22
|
+};
|
|
23
|
+
|
|
24
|
+/**
|
|
25
|
+ * A container that renders the conference indicators, if any.
|
|
26
|
+ */
|
|
27
|
+class ConferenceIndicators extends Component<Props> {
|
|
28
|
+ /**
|
|
29
|
+ * Implements React {@code Component}'s render.
|
|
30
|
+ *
|
|
31
|
+ * @inheritdoc
|
|
32
|
+ */
|
|
33
|
+ render() {
|
|
34
|
+ const _wide = !isNarrowAspectRatio(this);
|
|
35
|
+ const { _filmstripVisible } = this.props;
|
|
36
|
+
|
|
37
|
+ return (
|
|
38
|
+ <View
|
|
39
|
+ style = { [
|
|
40
|
+ styles.indicatorContainer,
|
|
41
|
+ _wide && _filmstripVisible && styles.indicatorContainerWide
|
|
42
|
+ ] }>
|
|
43
|
+ <RecordingLabel
|
|
44
|
+ mode = { JitsiRecordingConstants.mode.FILE } />
|
|
45
|
+ <RecordingLabel
|
|
46
|
+ mode = { JitsiRecordingConstants.mode.STREAM } />
|
|
47
|
+ <VideoQualityLabel />
|
|
48
|
+ </View>
|
|
49
|
+ );
|
|
50
|
+ }
|
|
51
|
+
|
|
52
|
+}
|
|
53
|
+
|
|
54
|
+/**
|
|
55
|
+ * Maps (parts of) the redux state to the associated
|
|
56
|
+ * {@code ConferenceIndicators}'s props.
|
|
57
|
+ *
|
|
58
|
+ * @param {Object} state - The redux state.
|
|
59
|
+ * @private
|
|
60
|
+ * @returns {{
|
|
61
|
+ * _filmstripVisible: boolean
|
|
62
|
+ * }}
|
|
63
|
+ */
|
|
64
|
+function _mapStateToProps(state) {
|
|
65
|
+ const { length: participantCount } = state['features/base/participants'];
|
|
66
|
+ const { visible } = state['features/filmstrip'];
|
|
67
|
+
|
|
68
|
+ return {
|
|
69
|
+ /**
|
|
70
|
+ * The indicator which determines whether the filmstrip is visible.
|
|
71
|
+ *
|
|
72
|
+ * @private
|
|
73
|
+ * @type {boolean}
|
|
74
|
+ */
|
|
75
|
+ _filmstripVisible: visible && participantCount > 1
|
|
76
|
+ };
|
|
77
|
+}
|
|
78
|
+
|
|
79
|
+export default connect(_mapStateToProps)(
|
|
80
|
+ makeAspectRatioAware(ConferenceIndicators)
|
|
81
|
+);
|