Browse Source

[RN] Fix video in audion-only mode

When entering audio-only mode, VideoBridge is instructed to stop sending
remote videos. However, if the instruction fails because DataChannels do
not work, for example, then the app continues to display the remote
videos. Even though they're received in the case of such a failure, no
videos are to be displayed in audio-only mode.
master
Lyubo Marinov 8 years ago
parent
commit
718de31e04

+ 13
- 1
react/features/base/participants/components/ParticipantView.native.js View File

27
      * @static
27
      * @static
28
      */
28
      */
29
     static propTypes = {
29
     static propTypes = {
30
+        /**
31
+         * The indicator which determines whether conferencing is in audio-only
32
+         * mode.
33
+         *
34
+         * @private
35
+         */
36
+        _audioOnly: React.PropTypes.bool,
37
+
30
         /**
38
         /**
31
          * The source (e.g. URI, URL) of the avatar image of the participant
39
          * The source (e.g. URI, URL) of the avatar image of the participant
32
          * with {@link #participantId}.
40
          * with {@link #participantId}.
107
         // updated only after videoTrack is rendered.
115
         // updated only after videoTrack is rendered.
108
         const waitForVideoStarted = false;
116
         const waitForVideoStarted = false;
109
         const renderVideo
117
         const renderVideo
110
-            = (connectionStatus === JitsiParticipantConnectionStatus.ACTIVE)
118
+            = !this.props._audioOnly
119
+                && (connectionStatus
120
+                    === JitsiParticipantConnectionStatus.ACTIVE)
111
                 && shouldRenderVideoTrack(videoTrack, waitForVideoStarted);
121
                 && shouldRenderVideoTrack(videoTrack, waitForVideoStarted);
112
 
122
 
113
         // Is the avatar to be rendered?
123
         // Is the avatar to be rendered?
170
  * (instance of) ParticipantView.
180
  * (instance of) ParticipantView.
171
  * @private
181
  * @private
172
  * @returns {{
182
  * @returns {{
183
+ *     _audioOnly: boolean,
173
  *     _avatar: string,
184
  *     _avatar: string,
174
  *     _connectionStatus: string,
185
  *     _connectionStatus: string,
175
  *     _videoTrack: Track
186
  *     _videoTrack: Track
190
     }
201
     }
191
 
202
 
192
     return {
203
     return {
204
+        _audioOnly: state['features/base/conference'].audioOnly,
193
         _avatar: avatar,
205
         _avatar: avatar,
194
         _connectionStatus:
206
         _connectionStatus:
195
             connectionStatus
207
             connectionStatus

Loading…
Cancel
Save