Sfoglia il codice sorgente

Merge branch 'master' into reloads

j8
hristoterezov 9 anni fa
parent
commit
2f202deedf

+ 1
- 1
Makefile Vedi File

@@ -13,7 +13,7 @@ IFRAME_API_DIR = ./modules/API/external
13 13
 all: update-deps compile compile-iframe-api uglify uglify-iframe-api deploy clean
14 14
 
15 15
 update-deps:
16
-	$(NPM) install
16
+	$(NPM) update
17 17
 
18 18
 compile:
19 19
 	$(BROWSERIFY) $(BROWSERIFY_FLAGS) -e app.js -s APP | $(EXORCIST) $(OUTPUT_DIR)/app.bundle.js.map > $(OUTPUT_DIR)/app.bundle.js

+ 1
- 0
README.md Vedi File

@@ -66,6 +66,7 @@ npm link lib-jitsi-meet
66 66
 ```
67 67
 
68 68
 So now after changes in local `lib-jitsi-meet` repository you can rebuild it with `npm run install` and your `jitsi-meet` repository will use that modified library.
69
+Note: when using node version 4.x, the make file of jitsi-meet do npm update which will delete the link, no longer the case with version 6.x.
69 70
 
70 71
 If you do not want to use local repository anymore you should run
71 72
 ```bash

+ 6
- 0
conference.js Vedi File

@@ -1232,6 +1232,12 @@ export default {
1232 1232
             room.dial(sipNumber);
1233 1233
         });
1234 1234
 
1235
+        APP.UI.addListener(UIEvents.RESOLUTION_CHANGED,
1236
+            (id, oldResolution, newResolution, delay) => {
1237
+            room.sendApplicationLog("Resolution change id=" + id
1238
+                + " old=" + oldResolution + " new=" + newResolution
1239
+                + " delay=" + delay);
1240
+        });
1235 1241
 
1236 1242
         // Starts or stops the recording for the conference.
1237 1243
         APP.UI.addListener(UIEvents.RECORDING_TOGGLED, (options) => {

+ 44
- 0
modules/UI/videolayout/SmallVideo.js Vedi File

@@ -2,6 +2,7 @@
2 2
 /* jshint -W101 */
3 3
 import Avatar from "../avatar/Avatar";
4 4
 import UIUtil from "../util/UIUtil";
5
+import UIEvents from "../../../service/UI/UIEvents";
5 6
 
6 7
 const RTCUIHelper = JitsiMeetJS.util.RTCUIHelper;
7 8
 
@@ -333,6 +334,16 @@ SmallVideo.prototype.removeModeratorIndicatorElement = function () {
333 334
     $('#' + this.videoSpanId + ' .focusindicator').remove();
334 335
 };
335 336
 
337
+/**
338
+ * This is an especially interesting function. A naive reader might think that
339
+ * it returns this SmallVideo's "video" element. But it is much more exciting.
340
+ * It first finds this video's parent element using jquery, then uses a utility
341
+ * from lib-jitsi-meet to extract the video element from it (with two more
342
+ * jquery calls), and finally uses jquery again to encapsulate the video element
343
+ * in an array. This last step allows (some might prefer "forces") users of
344
+ * this function to access the video element via the 0th element of the returned
345
+ * array (after checking its length of course!).
346
+ */
336 347
 SmallVideo.prototype.selectVideoElement = function () {
337 348
     return $(RTCUIHelper.findVideoElement($('#' + this.videoSpanId)[0]));
338 349
 };
@@ -490,4 +501,37 @@ SmallVideo.prototype.getIndicatorSpan = function(id) {
490 501
     return indicatorSpan;
491 502
 };
492 503
 
504
+/**
505
+ * Adds a listener for onresize events for this video, which will monitor for
506
+ * resolution changes, will calculate the delay since the moment the listened
507
+ * is added, and will fire a RESOLUTION_CHANGED event.
508
+ */
509
+SmallVideo.prototype.waitForResolutionChange = function() {
510
+    let self = this;
511
+    let beforeChange = window.performance.now();
512
+    let videos = this.selectVideoElement();
513
+    if (!videos || !videos.length || videos.length <= 0)
514
+        return;
515
+    let video = videos[0];
516
+    let oldWidth = video.videoWidth;
517
+    let oldHeight = video.videoHeight;
518
+    video.onresize = (event) => {
519
+        if (video.videoWidth != oldWidth || video.videoHeight != oldHeight) {
520
+            // Only run once.
521
+            video.onresize = null;
522
+
523
+            let delay = window.performance.now() - beforeChange;
524
+            let emitter = self.VideoLayout.getEventEmitter();
525
+            if (emitter) {
526
+                emitter.emit(
527
+                        UIEvents.RESOLUTION_CHANGED,
528
+                        self.getId(),
529
+                        oldWidth + "x" + oldHeight,
530
+                        video.videoWidth + "x" + video.videoHeight,
531
+                        delay);
532
+            }
533
+        }
534
+    };
535
+};
536
+
493 537
 export default SmallVideo;

+ 10
- 3
modules/UI/videolayout/VideoLayout.js Vedi File

@@ -1012,11 +1012,16 @@ var VideoLayout = {
1012 1012
             if (id !== currentId && videoType === VIDEO_CONTAINER_TYPE) {
1013 1013
                 eventEmitter.emit(UIEvents.SELECTED_ENDPOINT, id);
1014 1014
             }
1015
+
1016
+            let smallVideo = this.getSmallVideo(id);
1017
+            let oldSmallVideo;
1015 1018
             if (currentId) {
1016
-                var oldSmallVideo = this.getSmallVideo(currentId);
1019
+                oldSmallVideo = this.getSmallVideo(currentId);
1017 1020
             }
1018 1021
 
1019
-            let smallVideo = this.getSmallVideo(id);
1022
+            smallVideo.waitForResolutionChange();
1023
+            if (oldSmallVideo)
1024
+                oldSmallVideo.waitForResolutionChange();
1020 1025
 
1021 1026
             largeVideo.updateLargeVideo(
1022 1027
                 id,
@@ -1120,7 +1125,9 @@ var VideoLayout = {
1120 1125
     setLocalFlipX: function (val) {
1121 1126
         this.localFlipX = val;
1122 1127
 
1123
-    }
1128
+    },
1129
+
1130
+    getEventEmitter: () => {return eventEmitter;}
1124 1131
 };
1125 1132
 
1126 1133
 export default VideoLayout;

+ 1
- 1
package.json Vedi File

@@ -25,7 +25,7 @@
25 25
     "jQuery-Impromptu": "git+https://github.com/trentrichardson/jQuery-Impromptu.git#v6.0.0",
26 26
     "lib-jitsi-meet": "jitsi/lib-jitsi-meet",
27 27
     "jquery-contextmenu": "*",
28
-    "jquery-ui": "^1.10.5",
28
+    "jquery-ui": "1.10.5",
29 29
     "jssha": "1.5.0",
30 30
     "retry": "0.6.1",
31 31
     "strophe": "^1.2.2",

+ 4
- 1
service/UI/UIEvents.js Vedi File

@@ -80,5 +80,8 @@ export default {
80 80
     /**
81 81
      * Notifies that flipX property of the local video is changed.
82 82
      */
83
-    LOCAL_FLIPX_CHANGED: "UI.local_flipx_changed"
83
+    LOCAL_FLIPX_CHANGED: "UI.local_flipx_changed",
84
+    // An event which indicates that the resolution of a remote video has
85
+    // changed.
86
+    RESOLUTION_CHANGED: "UI.resolution_changed"
84 87
 };

Loading…
Annulla
Salva