浏览代码

Turning video thumbnails into squares. Changes the size of the dominant speaker avatar and fixes some minor thing around those two.

j8
yanas 9 年前
父节点
当前提交
64d8cb2db2

+ 3
- 3
css/main.css 查看文件

9
     color: #424242;
9
     color: #424242;
10
     font-family:'Helvetica Neue', Helvetica, sans-serif;
10
     font-family:'Helvetica Neue', Helvetica, sans-serif;
11
     font-weight: 400;
11
     font-weight: 400;
12
-    background: #000000;
12
+    background: #4E4E4E;
13
     overflow: hidden;
13
     overflow: hidden;
14
 }
14
 }
15
 
15
 
263
     width: 29px;
263
     width: 29px;
264
     border-radius: 1px;
264
     border-radius: 1px;
265
     color: #FFF;
265
     color: #FFF;
266
-    background: rgba(0,0,0,0.8);
266
+    background: rgba(0,0,0,0.5);
267
     z-index: 6; /*+1 from #remoteVideos*/
267
     z-index: 6; /*+1 from #remoteVideos*/
268
 }
268
 }
269
 
269
 
337
 }
337
 }
338
 
338
 
339
 #toast-container.notification-bottom-right {
339
 #toast-container.notification-bottom-right {
340
-    bottom: 120px;
340
+    bottom: 140px;
341
     right: 5px;
341
     right: 5px;
342
 }
342
 }
343
 
343
 

+ 11
- 9
css/videolayout_default.css 查看文件

85
 #remoteVideos .videocontainer>object {
85
 #remoteVideos .videocontainer>object {
86
     cursor: hand;
86
     cursor: hand;
87
     border-radius:1px;
87
     border-radius:1px;
88
+    object-fit: cover;
88
 }
89
 }
89
 
90
 
90
 .flipVideoX {
91
 .flipVideoX {
98
 #localVideoWrapper>object {
99
 #localVideoWrapper>object {
99
     cursor: hand;
100
     cursor: hand;
100
     border-radius:1px !important;
101
     border-radius:1px !important;
102
+    object-fit: cover;
101
 }
103
 }
102
 
104
 
103
 #largeVideo,
105
 #largeVideo,
371
     padding-right:2px;
373
     padding-right:2px;
372
     height:38px;
374
     height:38px;
373
     width:auto;
375
     width:auto;
374
-    background-color: rgba(0,0,0,0.8);
376
+    background-color: rgba(0,0,0,0.5);
375
     border-radius: 1px;
377
     border-radius: 1px;
376
     pointer-events: auto;
378
     pointer-events: auto;
377
 }
379
 }
401
 
403
 
402
 #dominantSpeaker {
404
 #dominantSpeaker {
403
     visibility: hidden;
405
     visibility: hidden;
404
-    width: 150px;
405
-    height: 150px;
406
+    width: 300px;
407
+    height: 300px;
406
     margin: auto;
408
     margin: auto;
407
     overflow: hidden;
409
     overflow: hidden;
408
     position: relative;
410
     position: relative;
421
 }
423
 }
422
 
424
 
423
 #dominantSpeakerAvatar {
425
 #dominantSpeakerAvatar {
424
-    width: 100px;
425
-    height: 100px;
426
-    top: 25px;
426
+    width: 200px;
427
+    height: 200px;
428
+    top: 50px;
427
     margin: auto;
429
     margin: auto;
428
     position: relative;
430
     position: relative;
429
-    border-radius: 50px;
431
+    border-radius: 100px;
430
     z-index: 3;
432
     z-index: 3;
431
     visibility: inherit;
433
     visibility: inherit;
432
 }
434
 }
434
 .userAvatar {
436
 .userAvatar {
435
     height: 100%;
437
     height: 100%;
436
     position: absolute;
438
     position: absolute;
437
-    left: 35px;
438
-    border-radius: 200px;
439
+    left: 0;
440
+    border-radius: 2px;
439
 }
441
 }
440
 
442
 
441
 .sharedVideoAvatar {
443
 .sharedVideoAvatar {

+ 2
- 3
interface_config.js 查看文件

1
 var interfaceConfig = {
1
 var interfaceConfig = {
2
     CANVAS_EXTRA: 104,
2
     CANVAS_EXTRA: 104,
3
-    CANVAS_RADIUS: 1,
3
+    CANVAS_RADIUS: 0,
4
     SHADOW_COLOR: '#ffffff',
4
     SHADOW_COLOR: '#ffffff',
5
     INITIAL_TOOLBAR_TIMEOUT: 20000,
5
     INITIAL_TOOLBAR_TIMEOUT: 20000,
6
     TOOLBAR_TIMEOUT: 4000,
6
     TOOLBAR_TIMEOUT: 4000,
14
     GENERATE_ROOMNAMES_ON_WELCOME_PAGE: true,
14
     GENERATE_ROOMNAMES_ON_WELCOME_PAGE: true,
15
     APP_NAME: "Jitsi Meet",
15
     APP_NAME: "Jitsi Meet",
16
     INVITATION_POWERED_BY: true,
16
     INVITATION_POWERED_BY: true,
17
-    DOMINANT_SPEAKER_AVATAR_SIZE: 100,
18
     TOOLBAR_BUTTONS: ['authentication', 'microphone', 'camera', 'desktop',
17
     TOOLBAR_BUTTONS: ['authentication', 'microphone', 'camera', 'desktop',
19
         'recording', 'security', 'invite', 'chat', 'etherpad', 'sharedvideo',
18
         'recording', 'security', 'invite', 'chat', 'etherpad', 'sharedvideo',
20
         'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip',
19
         'fullscreen', 'sip', 'dialpad', 'settings', 'hangup', 'filmstrip',
30
     filmStripOnly: false,
29
     filmStripOnly: false,
31
     RANDOM_AVATAR_URL_PREFIX: "http://abotars.hipch.at/meeple/",
30
     RANDOM_AVATAR_URL_PREFIX: "http://abotars.hipch.at/meeple/",
32
     RANDOM_AVATAR_URL_SUFFIX: ".png",
31
     RANDOM_AVATAR_URL_SUFFIX: ".png",
33
-    FILM_STRIP_MAX_HEIGHT: 160
32
+    FILM_STRIP_MAX_HEIGHT: 120
34
 };
33
 };

+ 32
- 14
modules/UI/audio_levels/AudioLevels.js 查看文件

8
 
8
 
9
 let ASDrawContext = null;
9
 let ASDrawContext = null;
10
 let audioLevelCanvasCache = {};
10
 let audioLevelCanvasCache = {};
11
+let dominantSpeakerAudioElement = null;
11
 
12
 
12
-function initDominantSpeakerAudioLevels() {
13
-    let ASRadius = interfaceConfig.DOMINANT_SPEAKER_AVATAR_SIZE / 2;
14
-    let ASCenter = (interfaceConfig.DOMINANT_SPEAKER_AVATAR_SIZE + ASRadius) / 2;
13
+function initDominantSpeakerAudioLevels(dominantSpeakerAvatarSize) {
14
+    let ASRadius = dominantSpeakerAvatarSize / 2;
15
+    let ASCenter = (dominantSpeakerAvatarSize + ASRadius) / 2;
15
 
16
 
16
     // Draw a circle.
17
     // Draw a circle.
18
+    ASDrawContext.beginPath();
17
     ASDrawContext.arc(ASCenter, ASCenter, ASRadius, 0, 2 * Math.PI);
19
     ASDrawContext.arc(ASCenter, ASCenter, ASRadius, 0, 2 * Math.PI);
20
+    ASDrawContext.closePath();
18
 
21
 
19
     // Add a shadow around the circle
22
     // Add a shadow around the circle
20
     ASDrawContext.shadowColor = interfaceConfig.SHADOW_COLOR;
23
     ASDrawContext.shadowColor = interfaceConfig.SHADOW_COLOR;
90
     let shadowLevel = 0;
93
     let shadowLevel = 0;
91
 
94
 
92
     if (audioLevel <= 0.3) {
95
     if (audioLevel <= 0.3) {
93
-        shadowLevel
94
-            = Math.round(interfaceConfig.CANVAS_EXTRA/2*(audioLevel/0.3));
96
+        shadowLevel = Math.round(
97
+            interfaceConfig.CANVAS_EXTRA/2*(audioLevel/0.3));
95
     } else if (audioLevel <= 0.6) {
98
     } else if (audioLevel <= 0.6) {
96
-        shadowLevel
97
-            = Math.round(interfaceConfig.CANVAS_EXTRA/2*((audioLevel - 0.3) / 0.3));
99
+        shadowLevel = Math.round(
100
+            interfaceConfig.CANVAS_EXTRA/2*((audioLevel - 0.3) / 0.3));
98
     } else {
101
     } else {
99
-        shadowLevel
100
-            = Math.round(interfaceConfig.CANVAS_EXTRA/2*((audioLevel - 0.6) / 0.4));
102
+        shadowLevel = Math.round(
103
+            interfaceConfig.CANVAS_EXTRA/2*((audioLevel - 0.6) / 0.4));
101
     }
104
     }
102
 
105
 
103
     return shadowLevel;
106
     return shadowLevel;
124
 const AudioLevels = {
127
 const AudioLevels = {
125
 
128
 
126
     init () {
129
     init () {
127
-        ASDrawContext = $('#dominantSpeakerAudioLevel')[0].getContext('2d');
128
-        initDominantSpeakerAudioLevels();
130
+        dominantSpeakerAudioElement =  $('#dominantSpeakerAudioLevel')[0];
131
+        ASDrawContext = dominantSpeakerAudioElement.getContext('2d');
132
+
133
+        let parentContainer = $("#dominantSpeaker");
134
+        let dominantSpeakerWidth = parentContainer.width();
135
+        let dominantSpeakerHeight = parentContainer.height();
136
+
137
+        dominantSpeakerAudioElement.width = dominantSpeakerWidth;
138
+        dominantSpeakerAudioElement.height = dominantSpeakerHeight;
139
+
140
+        let dominantSpeakerAvatar = $("#dominantSpeakerAvatar");
141
+        initDominantSpeakerAudioLevels(dominantSpeakerAvatar.width());
129
     },
142
     },
130
 
143
 
131
     /**
144
     /**
155
 
168
 
156
             audioLevelCanvas = document.createElement('canvas');
169
             audioLevelCanvas = document.createElement('canvas');
157
             audioLevelCanvas.className = "audiolevel";
170
             audioLevelCanvas.className = "audiolevel";
158
-            audioLevelCanvas.style.bottom = `-${interfaceConfig.CANVAS_EXTRA/2}px`;
159
-            audioLevelCanvas.style.left = `-${interfaceConfig.CANVAS_EXTRA/2}px`;
171
+            audioLevelCanvas.style.bottom
172
+                = `-${interfaceConfig.CANVAS_EXTRA/2}px`;
173
+            audioLevelCanvas.style.left
174
+                = `-${interfaceConfig.CANVAS_EXTRA/2}px`;
160
             resizeAudioLevelCanvas(audioLevelCanvas, thumbWidth, thumbHeight);
175
             resizeAudioLevelCanvas(audioLevelCanvas, thumbWidth, thumbHeight);
161
 
176
 
162
             videoSpan.appendChild(audioLevelCanvas);
177
             videoSpan.appendChild(audioLevelCanvas);
213
             return;
228
             return;
214
         }
229
         }
215
 
230
 
216
-        ASDrawContext.clearRect(0, 0, 300, 300);
231
+        ASDrawContext.clearRect(0, 0,
232
+            dominantSpeakerAudioElement.width,
233
+            dominantSpeakerAudioElement.height);
234
+
217
         if (!audioLevel) {
235
         if (!audioLevel) {
218
             return;
236
             return;
219
         }
237
         }

+ 7
- 11
modules/UI/videolayout/FilmStrip.js 查看文件

2
 
2
 
3
 import UIUtil from "../util/UIUtil";
3
 import UIUtil from "../util/UIUtil";
4
 
4
 
5
-const thumbAspectRatio = 16.0 / 9.0;
5
+const thumbAspectRatio = 1 / 1;
6
 
6
 
7
 const FilmStrip = {
7
 const FilmStrip = {
8
     init () {
8
     init () {
44
      * that we want to take into account when calculating the film strip width.
44
      * that we want to take into account when calculating the film strip width.
45
      */
45
      */
46
      calculateThumbnailSize (isSideBarVisible) {
46
      calculateThumbnailSize (isSideBarVisible) {
47
-        // Calculate the available height, which is the inner window height
48
-        // minus 39px for the header minus 2px for the delimiter lines on the
49
-        // top and bottom of the large video, minus the 36px space inside the
50
-        // remoteVideos container used for highlighting shadow.
51
-        let availableHeight = 100;
47
+        let availableHeight = interfaceConfig.FILM_STRIP_MAX_HEIGHT;
52
 
48
 
53
         let numvids = this.getThumbs(true).length;
49
         let numvids = this.getThumbs(true).length;
54
 
50
 
84
                         availableHeight);
80
                         availableHeight);
85
 
81
 
86
         availableHeight
82
         availableHeight
87
-            = Math.min( maxHeight,
88
-            availableWidth / thumbAspectRatio,
89
-            window.innerHeight - 18);
83
+            = Math.min( maxHeight, window.innerHeight - 18);
90
 
84
 
91
-        if (availableHeight < availableWidth / thumbAspectRatio) {
92
-            availableWidth = Math.floor(availableHeight * thumbAspectRatio);
85
+        if (availableHeight < availableWidth) {
86
+            availableWidth = availableHeight;
93
         }
87
         }
88
+        else
89
+            availableHeight = availableWidth;
94
 
90
 
95
         return {
91
         return {
96
             thumbWidth: availableWidth,
92
             thumbWidth: availableWidth,

+ 14
- 7
modules/UI/videolayout/LargeVideo.js 查看文件

8
 import Avatar from "../avatar/Avatar";
8
 import Avatar from "../avatar/Avatar";
9
 import {createDeferred} from '../../util/helpers';
9
 import {createDeferred} from '../../util/helpers';
10
 
10
 
11
-const avatarSize = interfaceConfig.DOMINANT_SPEAKER_AVATAR_SIZE;
12
 const FADE_DURATION_MS = 300;
11
 const FADE_DURATION_MS = 300;
13
 
12
 
14
 export const VIDEO_CONTAINER_TYPE = "camera";
13
 export const VIDEO_CONTAINER_TYPE = "camera";
175
         this.$avatar = $('#dominantSpeaker');
174
         this.$avatar = $('#dominantSpeaker');
176
         this.$wrapper = $('#largeVideoWrapper');
175
         this.$wrapper = $('#largeVideoWrapper');
177
 
176
 
177
+        this.avatarHeight = $("#dominantSpeakerAvatar").height();
178
+
178
         // This does not work with Temasys plugin - has to be a property to be
179
         // This does not work with Temasys plugin - has to be a property to be
179
         // copied between new <object> elements
180
         // copied between new <object> elements
180
         //this.$video.on('play', onPlay);
181
         //this.$video.on('play', onPlay);
245
                                     containerWidth, containerHeight);
246
                                     containerWidth, containerHeight);
246
 
247
 
247
         // update avatar position
248
         // update avatar position
248
-        let top = containerHeight / 2 - avatarSize / 4 * 3;
249
+        let top = containerHeight / 2 - this.avatarHeight / 4 * 3;
249
 
250
 
250
         this.$avatar.css('top', top);
251
         this.$avatar.css('top', top);
251
 
252
 
369
         this.videoContainer = new VideoContainer(
370
         this.videoContainer = new VideoContainer(
370
             () => this.resizeContainer(VIDEO_CONTAINER_TYPE));
371
             () => this.resizeContainer(VIDEO_CONTAINER_TYPE));
371
         this.addContainer(VIDEO_CONTAINER_TYPE, this.videoContainer);
372
         this.addContainer(VIDEO_CONTAINER_TYPE, this.videoContainer);
373
+
372
         // use the same video container to handle and desktop tracks
374
         // use the same video container to handle and desktop tracks
373
         this.addContainer("desktop", this.videoContainer);
375
         this.addContainer("desktop", this.videoContainer);
374
 
376
 
382
         });
384
         });
383
 
385
 
384
         if (interfaceConfig.SHOW_JITSI_WATERMARK) {
386
         if (interfaceConfig.SHOW_JITSI_WATERMARK) {
385
-            let leftWatermarkDiv = this.$container.find("div.watermark.leftwatermark");
387
+            let leftWatermarkDiv
388
+                = this.$container.find("div.watermark.leftwatermark");
386
 
389
 
387
             leftWatermarkDiv.css({display: 'block'});
390
             leftWatermarkDiv.css({display: 'block'});
388
 
391
 
389
-            leftWatermarkDiv.parent().attr('href', interfaceConfig.JITSI_WATERMARK_LINK);
392
+            leftWatermarkDiv.parent().attr(
393
+                'href', interfaceConfig.JITSI_WATERMARK_LINK);
390
         }
394
         }
391
 
395
 
392
         if (interfaceConfig.SHOW_BRAND_WATERMARK) {
396
         if (interfaceConfig.SHOW_BRAND_WATERMARK) {
393
-            let rightWatermarkDiv = this.$container.find("div.watermark.rightwatermark");
397
+            let rightWatermarkDiv
398
+                = this.$container.find("div.watermark.rightwatermark");
394
 
399
 
395
             rightWatermarkDiv.css({
400
             rightWatermarkDiv.css({
396
                 display: 'block',
401
                 display: 'block',
397
                 backgroundImage: 'url(images/rightwatermark.png)'
402
                 backgroundImage: 'url(images/rightwatermark.png)'
398
             });
403
             });
399
 
404
 
400
-            rightWatermarkDiv.parent().attr('href', interfaceConfig.BRAND_WATERMARK_LINK);
405
+            rightWatermarkDiv.parent().attr(
406
+                'href', interfaceConfig.BRAND_WATERMARK_LINK);
401
         }
407
         }
402
 
408
 
403
         if (interfaceConfig.SHOW_POWERED_BY) {
409
         if (interfaceConfig.SHOW_POWERED_BY) {
478
 
484
 
479
             return promise;
485
             return promise;
480
         }).then(() => {
486
         }).then(() => {
481
-            // after everything is done check again if there are any pending new streams.
487
+            // after everything is done check again if there are any pending
488
+            // new streams.
482
             this.updateInProcess = false;
489
             this.updateInProcess = false;
483
             this.scheduleLargeVideoUpdate();
490
             this.scheduleLargeVideoUpdate();
484
         });
491
         });

正在加载...
取消
保存