ソースを参照

style(isVideoPlayable): improve readability.

master
Hristo Terezov 4年前
コミット
9f321c988e
1個のファイルの変更5行の追加4行の削除
  1. 5
    4
      react/features/filmstrip/functions.web.js

+ 5
- 4
react/features/filmstrip/functions.web.js ファイルの表示

@@ -86,7 +86,6 @@ export function isVideoPlayable(stateful: Object | Function, id: String) {
86 86
     const state = toState(stateful);
87 87
     const tracks = state['features/base/tracks'];
88 88
     const participant = id ? getParticipantById(state, id) : getLocalParticipant(state);
89
-    let isVideoMuted = true;
90 89
     const isLocal = participant?.local ?? true;
91 90
     const { connectionStatus } = participant || {};
92 91
     const videoTrack
@@ -94,11 +93,13 @@ export function isVideoPlayable(stateful: Object | Function, id: String) {
94 93
     const isAudioOnly = Boolean(state['features/base/audio-only'].enabled);
95 94
     let isPlayable = false;
96 95
 
97
-    if (participant?.local) {
98
-        isVideoMuted = isLocalTrackMuted(tracks, MEDIA_TYPE.VIDEO);
96
+    if (isLocal) {
97
+        const isVideoMuted = isLocalTrackMuted(tracks, MEDIA_TYPE.VIDEO);
98
+
99 99
         isPlayable = Boolean(videoTrack) && !isVideoMuted && !isAudioOnly;
100 100
     } else if (!participant?.isFakeParticipant) { // remote participants excluding shared video
101
-        isVideoMuted = isRemoteTrackMuted(tracks, MEDIA_TYPE.VIDEO, id);
101
+        const isVideoMuted = isRemoteTrackMuted(tracks, MEDIA_TYPE.VIDEO, id);
102
+
102 103
         isPlayable = Boolean(videoTrack) && !isVideoMuted && !isAudioOnly
103 104
             && connectionStatus === JitsiParticipantConnectionStatus.ACTIVE;
104 105
     }

読み込み中…
キャンセル
保存