浏览代码

Simplifies code, reduces the scope of "try".

j8
Boris Grozev 8 年前
父节点
当前提交
adefa40dcc
共有 1 个文件被更改,包括 12 次插入13 次删除
  1. 12
    13
      conference.js

+ 12
- 13
conference.js 查看文件

@@ -1294,19 +1294,18 @@ export default {
1294 1294
 
1295 1295
         APP.UI.addListener(UIEvents.PINNED_ENDPOINT, (smallVideo, isPinned) => {
1296 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
 

正在加载...
取消
保存