Просмотр исходного кода

Merge pull request #891 from jitsi/video-thumbnail-toolbar-fixes

Video thumbnail toolbar fixes
master
Paweł Domas 8 лет назад
Родитель
Сommit
a07858cc72
12 измененных файлов: 219 добавлений и 151 удалений
  1. 6
    0
      css/_font.scss
  2. 1
    0
      css/_variables.scss
  3. 50
    58
      css/_videolayout_default.scss
  4. Двоичные данные
      fonts/jitsi.eot
  5. 2
    0
      fonts/jitsi.svg
  6. Двоичные данные
      fonts/jitsi.ttf
  7. Двоичные данные
      fonts/jitsi.woff
  8. 52
    0
      fonts/selection.json
  9. 1
    1
      lang/main.json
  10. 8
    4
      modules/UI/videolayout/LocalVideo.js
  11. 14
    8
      modules/UI/videolayout/RemoteVideo.js
  12. 85
    80
      modules/UI/videolayout/SmallVideo.js

+ 6
- 0
css/_font.scss Просмотреть файл

57
 .icon-kick:before {
57
 .icon-kick:before {
58
   content: "\e904";
58
   content: "\e904";
59
 }
59
 }
60
+.icon-menu-up:before {
61
+  content: "\e91f";
62
+}
63
+.icon-menu-down:before {
64
+  content: "\e920";
65
+}
60
 .icon-full-screen:before {
66
 .icon-full-screen:before {
61
   content: "\e90b";
67
   content: "\e90b";
62
 }
68
 }

+ 1
- 0
css/_variables.scss Просмотреть файл

14
 $thumbnailIndicatorSize: 23px;
14
 $thumbnailIndicatorSize: 23px;
15
 $thumbnailIndicatorBorder: 0px;
15
 $thumbnailIndicatorBorder: 0px;
16
 $thumbnailVideoMargin: 2px;
16
 $thumbnailVideoMargin: 2px;
17
+$thumbnailToolbarHeight: 25px;
17
 
18
 
18
 /**
19
 /**
19
  * Color variables.
20
  * Color variables.

+ 50
- 58
css/_videolayout_default.scss Просмотреть файл

51
     border: 1px solid $defaultDarkColor;
51
     border: 1px solid $defaultDarkColor;
52
 }
52
 }
53
 
53
 
54
+/**
55
+ * The toolbar of the video thumbnail.
56
+ */
54
 .videocontainer__toolbar {
57
 .videocontainer__toolbar {
55
     position: absolute;
58
     position: absolute;
56
     bottom: 0;
59
     bottom: 0;
57
     left: 0;
60
     left: 0;
58
     z-index: 1;
61
     z-index: 1;
59
     width: 100%;
62
     width: 100%;
60
-    height: 25px;
63
+    box-sizing: border-box; // Includes the padding in the 100% width.
64
+    height: $thumbnailToolbarHeight;
61
     max-height: 100%;
65
     max-height: 100%;
62
     background-color: rgba(0, 0, 0, 0.5);
66
     background-color: rgba(0, 0, 0, 0.5);
67
+    padding: 0 5px 0 5px;
63
 }
68
 }
64
 
69
 
70
+/**
71
+ * Focused video thumbnail.
72
+ */
65
 #remoteVideos .videocontainer.videoContainerFocused {
73
 #remoteVideos .videocontainer.videoContainerFocused {
66
     cursor: hand;
74
     cursor: hand;
67
     transition-duration: 0.5s;
75
     transition-duration: 0.5s;
69
     -webkit-animation-name: greyPulse;
77
     -webkit-animation-name: greyPulse;
70
     -webkit-animation-duration: 2s;
78
     -webkit-animation-duration: 2s;
71
     -webkit-animation-iteration-count: 1;
79
     -webkit-animation-iteration-count: 1;
72
-}
73
-
74
-#remoteVideos .videocontainer.videoContainerFocused {
75
     border: 1px solid $videoThumbnailSelected;
80
     border: 1px solid $videoThumbnailSelected;
76
 }
81
 }
77
 
82
 
149
     z-index: 0;
154
     z-index: 0;
150
 }
155
 }
151
 
156
 
152
-#remoteVideos .videocontainer>span.focusindicator,
153
-#remoteVideos .videocontainer>div.remotevideomenu {
154
-    position: absolute;
155
-    color: #FFFFFF;
156
-    bottom: 0;
157
-    right: 0;
158
-    padding: 5px 0px;
159
-    width: 25px;
160
-    font-size: 9pt;
161
-    text-shadow: 0px 1px 0px rgba(255,255,255,.3), 0px -1px 0px rgba(0,0,0,.7);
162
-    border: 0px;
163
-    z-index: 2;
164
-    text-align: center;
165
-}
166
-
167
-#remoteVideos .videocontainer>span.focusindicator {
168
-    display: inline-block;
169
-}
170
-
171
-#remoteVideos .videocontainer>div.remotevideomenu {
172
-    display: block;
173
-}
174
-
175
-.videocontainer>span.displayname,
176
-.videocontainer>input.displayname {
157
+/**
158
+ * Positions video thumbnail display name and editor.
159
+ */
160
+.videocontainer .displayname,
161
+.videocontainer .editdisplayname {
177
     display: inline-block;
162
     display: inline-block;
178
     position: absolute;
163
     position: absolute;
179
-    bottom: 4px;
180
-    left: 25%;
164
+    left: 30%;
165
+    width: 40%;
181
     color: $participantNameColor;
166
     color: $participantNameColor;
182
     text-align: center;
167
     text-align: center;
183
     text-overflow: ellipsis;
168
     text-overflow: ellipsis;
184
-    width: 50%;
185
     font-size: 12px;
169
     font-size: 12px;
186
     font-weight: 100;
170
     font-weight: 100;
187
     letter-spacing: 1px;
171
     letter-spacing: 1px;
188
     overflow: hidden;
172
     overflow: hidden;
189
     white-space: nowrap;
173
     white-space: nowrap;
174
+    line-height: $thumbnailToolbarHeight;
190
     z-index: 2;
175
     z-index: 2;
191
 }
176
 }
192
 
177
 
193
-.videocontainer>input.displayname {
178
+/**
179
+ * Positions video thumbnail display name editor.
180
+ */
181
+.videocontainer .editdisplayname {
194
     outline: none;
182
     outline: none;
195
     border: none;
183
     border: none;
196
     background: none;
184
     background: none;
271
 }
259
 }
272
 
260
 
273
 #localVideoContainer>span.status:hover,
261
 #localVideoContainer>span.status:hover,
274
-#localVideoContainer>span.displayname:hover {
262
+#localVideoContainer .displayname:hover {
275
     cursor: text;
263
     cursor: text;
276
 }
264
 }
277
 
265
 
278
 .videocontainer>span.status,
266
 .videocontainer>span.status,
279
-.videocontainer>span.displayname {
267
+.videocontainer .displayname {
280
     pointer-events: none;
268
     pointer-events: none;
281
 }
269
 }
282
 
270
 
283
-.videocontainer>input.displayname {
271
+.videocontainer .editdisplayname {
284
     height: auto;
272
     height: auto;
285
 }
273
 }
286
 
274
 
301
     z-index: 2;
289
     z-index: 2;
302
 }
290
 }
303
 
291
 
304
-.videocontainer>span.audioMuted {
305
-    display: inline-block;
306
-    position: absolute;
307
-    color: #FFFFFF;
308
-    bottom: 0;
309
-    left: 0;
310
-    padding: 8px 5px;
311
-    width: 25px;
292
+/**
293
+ * Video thumbnail toolbar icon.
294
+ */
295
+.videocontainer .toolbar-icon {
312
     font-size: 8pt;
296
     font-size: 8pt;
313
-    text-shadow: 0px 1px 0px rgba(255,255,255,.3), 0px -1px 0px rgba(0,0,0,.7);
314
-    border: 0px;
315
-    z-index: 3;
316
     text-align: center;
297
     text-align: center;
298
+    text-shadow: 0px 1px 0px rgba(255,255,255,.3), 0px -1px 0px rgba(0,0,0,.7);
299
+    color: #FFFFFF;
300
+    width: 12px;
301
+    line-height: $thumbnailToolbarHeight;
302
+    height: $thumbnailToolbarHeight;
303
+    padding: 0;
304
+    border: 0;
305
+    margin: 0px 5px 0px 0px;
306
+    float: left;
317
 }
307
 }
318
 
308
 
319
-.videocontainer>span.videoMuted {
320
-    display: inline-block;
321
-    position: absolute;
322
-    color: #FFFFFF;
323
-    bottom: 0;
324
-    padding: 8px 5px;
325
-    width: 25px;
326
-    font-size: 8pt;
327
-    text-shadow: 0px 1px 0px rgba(255,255,255,.3), 0px -1px 0px rgba(0,0,0,.7);
328
-    border: 0px;
329
-    z-index: 3;
309
+/**
310
+ * Toolbar icon internal i elements (font icons).
311
+ */
312
+.toolbar-icon>i {
313
+    line-height: $thumbnailToolbarHeight;
314
+}
315
+
316
+/**
317
+ * Toolbar icons positioned on the right.
318
+ */
319
+.toolbar-icon.right {
320
+  float: right;
321
+  margin: 0px 0px 0px 5px;
330
 }
322
 }
331
 
323
 
332
 .videocontainer>span.indicator {
324
 .videocontainer>span.indicator {

Двоичные данные
fonts/jitsi.eot Просмотреть файл


+ 2
- 0
fonts/jitsi.svg Просмотреть файл

42
 <glyph unicode="&#xe91c;" glyph-name="toggle-filmstrip" d="M896 896h-768c-46.933 0-85.333-38.4-85.333-85.333v-597.333c0-46.933 38.4-85.333 85.333-85.333h768c46.933 0 85.333 38.4 85.333 85.333v597.333c0 46.933-38.4 85.333-85.333 85.333zM896 213.333h-768v128h768v-128z" />
42
 <glyph unicode="&#xe91c;" glyph-name="toggle-filmstrip" d="M896 896h-768c-46.933 0-85.333-38.4-85.333-85.333v-597.333c0-46.933 38.4-85.333 85.333-85.333h768c46.933 0 85.333 38.4 85.333 85.333v597.333c0 46.933-38.4 85.333-85.333 85.333zM896 213.333h-768v128h768v-128z" />
43
 <glyph unicode="&#xe91d;" glyph-name="feedback" d="M42.667 128h170.667v512h-170.667v-512zM981.333 597.333c0 46.933-38.4 85.333-85.333 85.333h-269.227l40.533 194.987 1.28 13.653c0 17.493-7.253 33.707-18.773 45.227l-45.227 44.8-280.747-281.173c-15.787-15.36-25.173-36.693-25.173-60.16v-426.667c0-46.933 38.4-85.333 85.333-85.333h384c35.413 0 65.707 21.333 78.507 52.053l128.853 300.8c3.84 9.813 5.973 20.053 5.973 31.147v81.493l-0.427 0.427 0.427 3.413z" />
43
 <glyph unicode="&#xe91d;" glyph-name="feedback" d="M42.667 128h170.667v512h-170.667v-512zM981.333 597.333c0 46.933-38.4 85.333-85.333 85.333h-269.227l40.533 194.987 1.28 13.653c0 17.493-7.253 33.707-18.773 45.227l-45.227 44.8-280.747-281.173c-15.787-15.36-25.173-36.693-25.173-60.16v-426.667c0-46.933 38.4-85.333 85.333-85.333h384c35.413 0 65.707 21.333 78.507 52.053l128.853 300.8c3.84 9.813 5.973 20.053 5.973 31.147v81.493l-0.427 0.427 0.427 3.413z" />
44
 <glyph unicode="&#xe91e;" glyph-name="raised-hand" d="M982 790v-620c0-94-78-170-172-170h-310c-46 0-90 18-122 50l-336 342s54 52 56 52c10 8 22 12 34 12 10 0 18-2 26-6 2 0 184-104 184-104v508c0 36 28 64 64 64s64-28 64-64v-300h42v406c0 36 28 64 64 64s64-28 64-64v-406h42v364c0 36 28 64 64 64s64-28 64-64v-364h44v236c0 36 28 64 64 64s64-28 64-64z" />
44
 <glyph unicode="&#xe91e;" glyph-name="raised-hand" d="M982 790v-620c0-94-78-170-172-170h-310c-46 0-90 18-122 50l-336 342s54 52 56 52c10 8 22 12 34 12 10 0 18-2 26-6 2 0 184-104 184-104v508c0 36 28 64 64 64s64-28 64-64v-300h42v406c0 36 28 64 64 64s64-28 64-64v-406h42v364c0 36 28 64 64 64s64-28 64-64v-364h44v236c0 36 28 64 64 64s64-28 64-64z" />
45
+<glyph unicode="&#xe91f;" glyph-name="menu-up" d="M512 682l256-256-60-60-196 196-196-196-60 60z" />
46
+<glyph unicode="&#xe920;" glyph-name="menu-down" d="M708 658l60-60-256-256-256 256 60 60 196-196z" />
45
 </font></defs></svg>
47
 </font></defs></svg>

Двоичные данные
fonts/jitsi.ttf Просмотреть файл


Двоичные данные
fonts/jitsi.woff Просмотреть файл


+ 52
- 0
fonts/selection.json Просмотреть файл

293
       "setId": 2,
293
       "setId": 2,
294
       "iconIdx": 243
294
       "iconIdx": 243
295
     },
295
     },
296
+    {
297
+      "icon": {
298
+        "paths": [
299
+          "M512 342l256 256-60 60-196-196-196 196-60-60z"
300
+        ],
301
+        "isMulticolor": false,
302
+        "isMulticolor2": false,
303
+        "tags": [
304
+          "expand_less"
305
+        ],
306
+        "grid": 0,
307
+        "attrs": []
308
+      },
309
+      "attrs": [],
310
+      "properties": {
311
+        "id": 256,
312
+        "order": 106,
313
+        "ligatures": "expand_less",
314
+        "prevSize": 32,
315
+        "code": 59679,
316
+        "name": "menu-up"
317
+      },
318
+      "setIdx": 0,
319
+      "setId": 2,
320
+      "iconIdx": 257
321
+    },
322
+    {
323
+      "icon": {
324
+        "paths": [
325
+          "M708 366l60 60-256 256-256-256 60-60 196 196z"
326
+        ],
327
+        "isMulticolor": false,
328
+        "isMulticolor2": false,
329
+        "tags": [
330
+          "expand_more"
331
+        ],
332
+        "grid": 0,
333
+        "attrs": []
334
+      },
335
+      "attrs": [],
336
+      "properties": {
337
+        "id": 257,
338
+        "order": 107,
339
+        "ligatures": "expand_more",
340
+        "prevSize": 32,
341
+        "code": 59680,
342
+        "name": "menu-down"
343
+      },
344
+      "setIdx": 0,
345
+      "setId": 2,
346
+      "iconIdx": 258
347
+    },
296
     {
348
     {
297
       "icon": {
349
       "icon": {
298
         "paths": [
350
         "paths": [

+ 1
- 1
lang/main.json Просмотреть файл

136
     {
136
     {
137
         "editnickname": "Click to edit your<br/>display name",
137
         "editnickname": "Click to edit your<br/>display name",
138
         "moderator": "The owner of<br/>this conference",
138
         "moderator": "The owner of<br/>this conference",
139
-        "videomute": "Participant has<br/>stopped the camera.",
139
+        "videomute": "Participant has<br/>stopped the camera",
140
         "mute": "Participant is muted",
140
         "mute": "Participant is muted",
141
         "kick": "Kick out",
141
         "kick": "Kick out",
142
         "muted": "Muted",
142
         "muted": "Muted",

+ 8
- 4
modules/UI/videolayout/LocalVideo.js Просмотреть файл

60
         return;
60
         return;
61
     }
61
     }
62
 
62
 
63
-    var nameSpan = $('#' + this.videoSpanId + '>span.displayname');
63
+    var nameSpan = $('#' + this.videoSpanId + ' .displayname');
64
     var defaultLocalDisplayName = APP.translation.generateTranslationHTML(
64
     var defaultLocalDisplayName = APP.translation.generateTranslationHTML(
65
         interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME);
65
         interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME);
66
 
66
 
81
     } else {
81
     } else {
82
         nameSpan = document.createElement('span');
82
         nameSpan = document.createElement('span');
83
         nameSpan.className = 'displayname';
83
         nameSpan.className = 'displayname';
84
-        document.getElementById(this.videoSpanId).appendChild(nameSpan);
84
+        document.getElementById(this.videoSpanId)
85
+            .querySelector('.videocontainer__toolbar')
86
+            .appendChild(nameSpan);
85
 
87
 
86
 
88
 
87
         if (displayName && displayName.length > 0) {
89
         if (displayName && displayName.length > 0) {
98
         APP.translation.translateElement($("a.displayname"));
100
         APP.translation.translateElement($("a.displayname"));
99
 
101
 
100
         var editableText = document.createElement('input');
102
         var editableText = document.createElement('input');
101
-        editableText.className = 'displayname';
103
+        editableText.className = 'editdisplayname';
102
         editableText.type = 'text';
104
         editableText.type = 'text';
103
         editableText.id = 'editDisplayName';
105
         editableText.id = 'editDisplayName';
104
 
106
 
115
             JSON.stringify({name: "Jane Pink"}));
117
             JSON.stringify({name: "Jane Pink"}));
116
         editableText.setAttribute("placeholder", defaultNickname);
118
         editableText.setAttribute("placeholder", defaultNickname);
117
 
119
 
118
-        this.container.appendChild(editableText);
120
+        this.container
121
+            .querySelector('.videocontainer__toolbar')
122
+            .appendChild(editableText);
119
 
123
 
120
         var self = this;
124
         var self = this;
121
         $('#localVideoContainer .displayname')
125
         $('#localVideoContainer .displayname')

+ 14
- 8
modules/UI/videolayout/RemoteVideo.js Просмотреть файл

51
  */
51
  */
52
 RemoteVideo.prototype._initPopupMenu = function (popupMenuElement) {
52
 RemoteVideo.prototype._initPopupMenu = function (popupMenuElement) {
53
     this.popover = new JitsiPopover(
53
     this.popover = new JitsiPopover(
54
-        $("#" + this.videoSpanId + " > .remotevideomenu"),
54
+        $("#" + this.videoSpanId + " .remotevideomenu"),
55
         {   content: popupMenuElement.outerHTML,
55
         {   content: popupMenuElement.outerHTML,
56
             skin: "black"});
56
             skin: "black"});
57
 
57
 
171
  */
171
  */
172
 if (!interfaceConfig.filmStripOnly) {
172
 if (!interfaceConfig.filmStripOnly) {
173
     RemoteVideo.prototype.addRemoteVideoMenu = function () {
173
     RemoteVideo.prototype.addRemoteVideoMenu = function () {
174
-        var spanElement = document.createElement('div');
175
-        spanElement.className = 'remotevideomenu';
176
-        this.container.appendChild(spanElement);
174
+
175
+        var spanElement = document.createElement('span');
176
+        spanElement.className = 'remotevideomenu toolbar-icon right';
177
+
178
+        this.container
179
+            .querySelector('.videocontainer__toolbar')
180
+            .appendChild(spanElement);
177
 
181
 
178
         var menuElement = document.createElement('i');
182
         var menuElement = document.createElement('i');
179
-        menuElement.className = 'fa fa-angle-down';
183
+        menuElement.className = 'icon-menu-up';
180
         menuElement.title = 'Remote user controls';
184
         menuElement.title = 'Remote user controls';
181
         spanElement.appendChild(menuElement);
185
         spanElement.appendChild(menuElement);
182
 
186
 
382
         return;
386
         return;
383
     }
387
     }
384
 
388
 
385
-    var nameSpan = $('#' + this.videoSpanId + '>span.displayname');
389
+    var nameSpan = $('#' + this.videoSpanId + ' .displayname');
386
 
390
 
387
     // If we already have a display name for this video.
391
     // If we already have a display name for this video.
388
     if (nameSpan.length > 0) {
392
     if (nameSpan.length > 0) {
401
     } else {
405
     } else {
402
         nameSpan = document.createElement('span');
406
         nameSpan = document.createElement('span');
403
         nameSpan.className = 'displayname';
407
         nameSpan.className = 'displayname';
404
-        $('#' + this.videoSpanId)[0].appendChild(nameSpan);
408
+        $('#' + this.videoSpanId)[0]
409
+            .querySelector('.videocontainer__toolbar')
410
+            .appendChild(nameSpan);
405
 
411
 
406
         if (displayName && displayName.length > 0) {
412
         if (displayName && displayName.length > 0) {
407
             $(nameSpan).text(displayName);
413
             $(nameSpan).text(displayName);
419
  * @param videoElementId the id of local or remote video element.
425
  * @param videoElementId the id of local or remote video element.
420
  */
426
  */
421
 RemoteVideo.prototype.removeRemoteVideoMenu = function() {
427
 RemoteVideo.prototype.removeRemoteVideoMenu = function() {
422
-    var menuSpan = $('#' + this.videoSpanId + '>span.remotevideomenu');
428
+    var menuSpan = $('#' + this.videoSpanId + '> .remotevideomenu');
423
     if (menuSpan.length) {
429
     if (menuSpan.length) {
424
         this.popover.forceHide();
430
         this.popover.forceHide();
425
         menuSpan.remove();
431
         menuSpan.remove();

+ 85
- 80
modules/UI/videolayout/SmallVideo.js Просмотреть файл

40
 };
40
 };
41
 
41
 
42
 SmallVideo.prototype.showDisplayName = function(isShow) {
42
 SmallVideo.prototype.showDisplayName = function(isShow) {
43
-    var nameSpan = $('#' + this.videoSpanId + '>span.displayname').get(0);
43
+    var nameSpan = $('#' + this.videoSpanId + ' .displayname').get(0);
44
     if (isShow) {
44
     if (isShow) {
45
         if (nameSpan && nameSpan.innerHTML && nameSpan.innerHTML.length)
45
         if (nameSpan && nameSpan.innerHTML && nameSpan.innerHTML.length)
46
             nameSpan.setAttribute("style", "display:inline-block;");
46
             nameSpan.setAttribute("style", "display:inline-block;");
189
 
189
 
190
 
190
 
191
 /**
191
 /**
192
- * Shows audio muted indicator over small videos.
193
- * @param {string} isMuted
192
+ * Shows / hides the audio muted indicator over small videos.
193
+ *
194
+ * @param {boolean} isMuted indicates if the muted element should be shown
195
+ * or hidden
194
  */
196
  */
195
 SmallVideo.prototype.showAudioIndicator = function(isMuted) {
197
 SmallVideo.prototype.showAudioIndicator = function(isMuted) {
196
-    var audioMutedSpan = $('#' + this.videoSpanId + '>span.audioMuted');
198
+
199
+    var audioMutedIndicator = this.getAudioMutedIndicator();
197
 
200
 
198
     if (!isMuted) {
201
     if (!isMuted) {
199
-        if (audioMutedSpan.length > 0) {
200
-            audioMutedSpan.remove();
201
-            this.updateIconPositions();
202
-        }
202
+        audioMutedIndicator.hide();
203
     }
203
     }
204
     else {
204
     else {
205
-        if (!audioMutedSpan.length) {
206
-            audioMutedSpan = document.createElement('span');
207
-            audioMutedSpan.className = 'audioMuted';
208
-            UIUtil.setTooltip(audioMutedSpan,
209
-                "videothumbnail.mute",
210
-                "top");
211
-
212
-            this.container.appendChild(audioMutedSpan);
213
-            APP.translation
214
-                .translateElement($('#' + this.videoSpanId + " > span"));
215
-            var mutedIndicator = document.createElement('i');
216
-            mutedIndicator.className = 'icon-mic-disabled';
217
-            audioMutedSpan.appendChild(mutedIndicator);
205
+        audioMutedIndicator.show();
206
+    }
207
+    this.isMuted = isMuted;
208
+};
218
 
209
 
219
-        }
210
+/**
211
+ * Returns the audio muted indicator jquery object. If it doesn't exists -
212
+ * creates it.
213
+ *
214
+ * @returns {jQuery|HTMLElement} the audio muted indicator
215
+ */
216
+SmallVideo.prototype.getAudioMutedIndicator = function () {
217
+    var audioMutedSpan = $('#' + this.videoSpanId + ' .audioMuted');
220
 
218
 
221
-        this.updateIconPositions();
219
+    if (audioMutedSpan.length) {
220
+        return audioMutedSpan;
222
     }
221
     }
223
-    this.isMuted = isMuted;
222
+
223
+    audioMutedSpan = document.createElement('span');
224
+    audioMutedSpan.className = 'audioMuted toolbar-icon';
225
+    
226
+    UIUtil.setTooltip(audioMutedSpan,
227
+        "videothumbnail.mute",
228
+        "top");
229
+
230
+    this.container
231
+        .querySelector('.videocontainer__toolbar')
232
+        .appendChild(audioMutedSpan);
233
+
234
+
235
+    var mutedIndicator = document.createElement('i');
236
+    mutedIndicator.className = 'icon-mic-disabled';
237
+    audioMutedSpan.appendChild(mutedIndicator);
238
+
239
+    return $('#' + this.videoSpanId + ' .audioMuted');
224
 };
240
 };
225
 
241
 
226
 /**
242
 /**
227
  * Shows video muted indicator over small videos and disables/enables avatar
243
  * Shows video muted indicator over small videos and disables/enables avatar
228
  * if video muted.
244
  * if video muted.
245
+ *
246
+ * @param {boolean} isMuted indicates if we should set the view to muted view
247
+ * or not
229
  */
248
  */
230
 SmallVideo.prototype.setMutedView = function(isMuted) {
249
 SmallVideo.prototype.setMutedView = function(isMuted) {
231
     this.isVideoMuted = isMuted;
250
     this.isVideoMuted = isMuted;
232
     this.updateView();
251
     this.updateView();
233
 
252
 
234
-    var videoMutedSpan = $('#' + this.videoSpanId + '>span.videoMuted');
235
-
236
-    if (isMuted === false) {
237
-        if (videoMutedSpan.length > 0) {
238
-            videoMutedSpan.remove();
239
-            this.updateIconPositions();
240
-        }
241
-    }
242
-    else {
243
-        if (!videoMutedSpan.length) {
244
-            videoMutedSpan = document.createElement('span');
245
-            videoMutedSpan.className = 'videoMuted';
246
-
247
-            this.container.appendChild(videoMutedSpan);
248
-
249
-            var mutedIndicator = document.createElement('i');
250
-            mutedIndicator.className = 'icon-camera-disabled';
251
-            UIUtil.setTooltip(mutedIndicator,
252
-                "videothumbnail.videomute",
253
-                "top");
254
-            videoMutedSpan.appendChild(mutedIndicator);
255
-            //translate texts for muted indicator
256
-            APP.translation
257
-                .translateElement($('#' + this.videoSpanId  + " > span > i"));
258
-        }
253
+    var videoMutedSpan = this.getVideoMutedIndicator();
259
 
254
 
260
-        this.updateIconPositions();
261
-    }
255
+    videoMutedSpan[isMuted ? 'show' : 'hide']();
262
 };
256
 };
263
 
257
 
264
-SmallVideo.prototype.updateIconPositions = function () {
265
-    let audioMutedSpan = $('#' + this.videoSpanId + '>span.audioMuted');
266
-    let videoMutedSpan = $('#' + this.videoSpanId + '>span.videoMuted');
267
-    audioMutedSpan.css({left: "0px"});
268
-    videoMutedSpan.css({left: (audioMutedSpan.length > 0? 25 : 0) + "px"});
269
-
270
-    var connectionIndicator
271
-        = $('#' + this.videoSpanId + '>div.connectionindicator');
272
-    if(connectionIndicator.length > 0 &&
273
-        connectionIndicator[0].style.display != "none") {
274
-        audioMutedSpan.css({right: "23px"});
275
-        videoMutedSpan.css({right:
276
-            ((audioMutedSpan.length > 0? 23 : 0) + 30) + "px"});
277
-    } else {
278
-        audioMutedSpan.css({right: "0px"});
279
-        videoMutedSpan.css({right: (audioMutedSpan.length > 0? 30 : 0) + "px"});
258
+/**
259
+ * Returns the video muted indicator jquery object. If it doesn't exists -
260
+ * creates it.
261
+ *
262
+ * @returns {jQuery|HTMLElement} the video muted indicator
263
+ */
264
+SmallVideo.prototype.getVideoMutedIndicator = function () {
265
+    var videoMutedSpan = $('#' + this.videoSpanId + ' .videoMuted');
266
+
267
+    if (videoMutedSpan.length) {
268
+        return videoMutedSpan;
280
     }
269
     }
270
+
271
+    videoMutedSpan = document.createElement('span');
272
+    videoMutedSpan.className = 'videoMuted toolbar-icon';
273
+
274
+    this.container
275
+        .querySelector('.videocontainer__toolbar')
276
+        .appendChild(videoMutedSpan);
277
+
278
+    var mutedIndicator = document.createElement('i');
279
+    mutedIndicator.className = 'icon-camera-disabled';
280
+    
281
+    UIUtil.setTooltip(mutedIndicator,
282
+        "videothumbnail.videomute",
283
+        "top");
284
+    
285
+    videoMutedSpan.appendChild(mutedIndicator);
286
+
287
+    return $('#' + this.videoSpanId + ' .videoMuted');
281
 };
288
 };
282
 
289
 
283
 /**
290
 /**
287
     // Show moderator indicator
294
     // Show moderator indicator
288
     var indicatorSpan = $('#' + this.videoSpanId + ' .focusindicator');
295
     var indicatorSpan = $('#' + this.videoSpanId + ' .focusindicator');
289
 
296
 
290
-    if (!indicatorSpan || indicatorSpan.length === 0) {
291
-        indicatorSpan = document.createElement('span');
292
-        indicatorSpan.className = 'focusindicator';
293
-
294
-        this.container.appendChild(indicatorSpan);
295
-        indicatorSpan = $('#' + this.videoSpanId + ' .focusindicator');
297
+    if (indicatorSpan.length) {
298
+        return;
296
     }
299
     }
297
 
300
 
298
-    if (indicatorSpan.children().length !== 0)
299
-        return;
301
+    indicatorSpan = document.createElement('span');
302
+    indicatorSpan.className = 'focusindicator toolbar-icon right';
303
+
304
+    this.container
305
+        .querySelector('.videocontainer__toolbar')
306
+        .appendChild(indicatorSpan);
307
+
300
     var moderatorIndicator = document.createElement('i');
308
     var moderatorIndicator = document.createElement('i');
301
     moderatorIndicator.className = 'icon-star';
309
     moderatorIndicator.className = 'icon-star';
302
-    indicatorSpan[0].appendChild(moderatorIndicator);
303
 
310
 
304
-    UIUtil.setTooltip(indicatorSpan[0],
311
+    UIUtil.setTooltip(moderatorIndicator,
305
         "videothumbnail.moderator",
312
         "videothumbnail.moderator",
306
         "top-left");
313
         "top-left");
307
 
314
 
308
-    //translates text in focus indicators
309
-    APP.translation
310
-        .translateElement($('#' + this.videoSpanId + ' .focusindicator'));
315
+    indicatorSpan.appendChild(moderatorIndicator);
311
 };
316
 };
312
 
317
 
313
 /**
318
 /**

Загрузка…
Отмена
Сохранить