Sfoglia il codice sorgente

Simplifies code, reduces the scope of "try".

j8
Boris Grozev 8 anni fa
parent
commit
adefa40dcc
1 ha cambiato i file con 12 aggiunte e 13 eliminazioni
  1. 12
    13
      conference.js

+ 12
- 13
conference.js Vedi File

1294
 
1294
 
1295
         APP.UI.addListener(UIEvents.PINNED_ENDPOINT, (smallVideo, isPinned) => {
1295
         APP.UI.addListener(UIEvents.PINNED_ENDPOINT, (smallVideo, isPinned) => {
1296
             var smallVideoId = smallVideo.getId();
1296
             var smallVideoId = smallVideo.getId();
1297
-            try {
1298
-                if (smallVideo.getVideoType() === VIDEO_CONTAINER_TYPE
1299
-                    && !APP.conference.isLocalId(smallVideoId))
1300
-                    if (isPinned)
1301
-                            room.pinParticipant(smallVideoId);
1302
-                    // When the library starts supporting multiple pins we would
1303
-                    // pass the isPinned parameter together with the identifier,
1304
-                    // but currently we send null to indicate that we unpin the
1305
-                    // last pinned.
1306
-                    else
1307
-                        room.pinParticipant(null);
1308
-            } catch (e) {
1309
-                reportError(e);
1297
+            if (smallVideo.getVideoType() === VIDEO_CONTAINER_TYPE
1298
+                && !APP.conference.isLocalId(smallVideoId)) {
1299
+
1300
+                // When the library starts supporting multiple pins we would
1301
+                // pass the isPinned parameter together with the identifier,
1302
+                // but currently we send null to indicate that we unpin the
1303
+                // last pinned.
1304
+                try {
1305
+                    room.pinParticipant(isPinned ? smallVideoId : null);
1306
+                } catch (e) {
1307
+                    reportError(e);
1308
+                }
1310
             }
1309
             }
1311
         });
1310
         });
1312
 
1311
 

Loading…
Annulla
Salva