1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
|
<!--
- @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@pm.me>
-
- @author Marco Ambrosini <marcoambrosini@pm.me>
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<template>
<div id="call-container">
<EmptyCallView v-if="!remoteParticipantsCount && !screenSharingActive && !isGrid"
:is-sidebar="isSidebar" />
<div id="videos">
<template v-if="!isGrid">
<!-- Selected video override mode -->
<div v-if="showSelectedVideo"
ref="videoContainer"
class="video__promoted selected-video"
:class="{'full-page': isOneToOne}">
<template v-for="callParticipantModel in reversedCallParticipantModels">
<Video v-if="callParticipantModel.attributes.peerId === selectedVideoPeerId"
:key="callParticipantModel.attributes.selectedVideoPeerId"
:token="token"
:model="callParticipantModel"
:shared-data="sharedDatas[selectedVideoPeerId]"
:show-talking-highlight="false"
:is-grid="true"
:is-big="true"
:fit-video="true" />
</template>
</div>
<!-- Screens -->
<div v-else-if="!isSidebar && (showLocalScreen || showRemoteScreen || showSelectedScreen)" id="screens">
<!-- local screen -->
<Screen v-if="showLocalScreen"
:token="token"
:local-media-model="localMediaModel"
:shared-data="localSharedData"
:is-big="true" />
<!-- remote screen -->
<template v-else>
<template v-for="callParticipantModel in reversedCallParticipantModels">
<Screen v-if="callParticipantModel.attributes.peerId === shownRemoteScreenPeerId"
:key="'screen-' + callParticipantModel.attributes.peerId"
:token="token"
:call-participant-model="callParticipantModel"
:shared-data="sharedDatas[shownRemoteScreenPeerId]"
:is-big="true" />
</template>
</template>
</div>
<!-- Local Video Override mode (following own video) -->
<div v-else-if="showLocalVideo"
ref="videoContainer"
class="video__promoted selected-video--local"
:class="{'full-page': isOneToOne}">
<LocalVideo ref="localVideo"
:fit-video="true"
:is-stripe="false"
:show-controls="false"
:is-big="true"
:token="token"
:local-media-model="localMediaModel"
:video-container-aspect-ratio="videoContainerAspectRatio"
:local-call-participant-model="localCallParticipantModel"
:is-sidebar="false" />
</div>
<!-- Promoted "autopilot" mode -->
<div v-else
ref="videoContainer"
class="video__promoted autopilot"
:class="{'full-page': isOneToOne}">
<template v-for="callParticipantModel in reversedCallParticipantModels">
<Video v-if="sharedDatas[callParticipantModel.attributes.peerId].promoted"
:key="callParticipantModel.attributes.peerId"
:token="token"
:model="callParticipantModel"
:shared-data="sharedDatas[callParticipantModel.attributes.peerId]"
:show-talking-highlight="false"
:is-grid="true"
:fit-video="true"
:is-big="true"
:is-one-to-one="isOneToOne"
:is-sidebar="isSidebar" />
</template>
</div>
</template>
<!-- Stripe or fullscreen grid depending on `isGrid` -->
<Grid v-if="!isSidebar"
v-bind="$attrs"
:is-stripe="!isGrid"
:token="token"
:fit-video="true"
:has-pagination="true"
:min-height="isGrid && !isSidebar ? 240 : 150"
:min-width="isGrid && !isSidebar ? 320 : 200"
:videos-cap="gridVideosCap"
:videos-cap-enforced="gridVideosCapEnforced"
:call-participant-models="callParticipantModels"
:screens="screens"
:target-aspect-ratio="gridTargetAspectRatio"
:local-media-model="localMediaModel"
:local-call-participant-model="localCallParticipantModel"
:shared-datas="sharedDatas"
@select-video="handleSelectVideo"
@click-local-video="handleClickLocalVideo" />
<!-- Local video if sidebar -->
<LocalVideo v-if="isSidebar && !showLocalVideo"
ref="localVideo"
class="local-video"
:class="{ 'local-video--sidebar': isSidebar }"
:show-controls="false"
:fit-video="true"
:is-stripe="true"
:token="token"
:local-media-model="localMediaModel"
:video-container-aspect-ratio="videoContainerAspectRatio"
:local-call-participant-model="localCallParticipantModel"
:is-sidebar="isSidebar"
@click-video="handleClickLocalVideo" />
</div>
</div>
</template>
<script>
import { loadState } from '@nextcloud/initial-state'
import Grid from './Grid/Grid.vue'
import { SIMULCAST } from '../../constants.js'
import { localMediaModel, localCallParticipantModel, callParticipantCollection } from '../../utils/webrtc/index.js'
import RemoteVideoBlocker from '../../utils/webrtc/RemoteVideoBlocker.js'
import { fetchPeers } from '../../services/callsService.js'
import { showMessage } from '@nextcloud/dialogs'
import EmptyCallView from './shared/EmptyCallView.vue'
import Video from './shared/Video.vue'
import LocalVideo from './shared/LocalVideo.vue'
import Screen from './shared/Screen.vue'
import debounce from 'debounce'
import { EventBus } from '../../services/EventBus.js'
import { subscribe, unsubscribe } from '@nextcloud/event-bus'
export default {
name: 'CallView',
components: {
Grid,
EmptyCallView,
Video,
LocalVideo,
Screen,
},
props: {
token: {
type: String,
required: true,
},
// Determines whether this component is used in the sidebar
isSidebar: {
type: Boolean,
default: false,
},
},
data() {
return {
screens: [],
localMediaModel,
localCallParticipantModel,
sharedDatas: {},
raisedHandUnwatchers: {},
speakingUnwatchers: {},
screenUnwatchers: {},
speakers: [],
// callParticipantModelsWithScreen: [],
localSharedData: {
screenVisible: true,
},
callParticipantCollection,
videoContainerAspectRatio: 0,
}
},
computed: {
callParticipantModels() {
return callParticipantCollection.callParticipantModels.filter(callParticipantModel => !callParticipantModel.attributes.internal)
},
reversedCallParticipantModels() {
return this.callParticipantModels.slice().reverse()
},
remoteParticipantsCount() {
return this.callParticipantModels.length
},
callParticipantModelsWithScreen() {
return this.callParticipantModels.filter(callParticipantModel => callParticipantModel.attributes.screen)
},
callParticipantModelsWithVideo() {
return this.callParticipantModels.filter(callParticipantModel => {
return callParticipantModel.attributes.videoAvailable
&& this.sharedDatas[callParticipantModel.attributes.peerId].remoteVideoBlocker.isVideoEnabled()
&& (typeof callParticipantModel.attributes.stream === 'object')
})
},
injectableLocalMediaModel() {
return localMediaModel
},
localScreen() {
return localMediaModel.attributes.localScreen
},
screenSharingActive() {
return this.screens.length > 0
},
isGrid() {
return this.$store.getters.isGrid && !this.isSidebar
},
gridTargetAspectRatio() {
if (this.isGrid) {
return 1.5
} else {
return 1
}
},
gridVideosCap() {
return parseInt(loadState('spreed', 'grid_videos_limit'), 10)
},
gridVideosCapEnforced() {
return loadState('spreed', 'grid_videos_limit_enforced')
},
selectedVideoPeerId() {
return this.$store.getters.selectedVideoPeerId
},
hasSelectedScreen() {
return this.selectedVideoPeerId !== null && this.screens.includes(this.selectedVideoPeerId)
},
hasSelectedVideo() {
return this.selectedVideoPeerId !== null && !this.screens.includes(this.selectedVideoPeerId)
},
isOneToOne() {
return this.callParticipantModels.length === 1
},
hasLocalVideo() {
return this.localMediaModel.attributes.videoEnabled
},
hasRemoteVideo() {
return this.callParticipantModelsWithVideo.length > 0
},
hasLocalScreen() {
return !!this.localMediaModel.attributes.localScreen
},
hasRemoteScreen() {
return this.callParticipantModelsWithScreen.length > 0
},
// The following conditions determine what to show in the "Big container"
// of the promoted view
// Show selected video (other than local)
showSelectedVideo() {
return this.hasSelectedVideo && !this.showLocalVideo
},
showSelectedScreen() {
return this.hasSelectedScreen && !this.showLocalVideo
},
// Shows the local video if selected
showLocalVideo() {
return this.hasLocalVideo && this.selectedVideoPeerId === 'local'
},
// Show local screen
showLocalScreen() {
return this.hasLocalScreen && this.selectedVideoPeerId === null && this.screens[0] === localCallParticipantModel.attributes.peerId
},
// Show somebody else's screen. This will show the screen of the last
// person that shared it.
showRemoteScreen() {
return this.shownRemoteScreenPeerId !== null && !this.showSelectedVideo && !this.showSelectedScreen
},
shownRemoteScreenPeerId() {
if (!this.screenSharingActive) {
return null
}
if (!this.hasRemoteScreen) {
return null
}
if (this.screens.includes(this.selectedVideoPeerId)) {
return this.selectedVideoPeerId
}
if (!this.hasSelectedScreen) {
return this.screens[0]
}
return null
},
},
watch: {
localScreen(localScreen) {
this._setScreenAvailable(localCallParticipantModel.attributes.peerId, localScreen)
},
callParticipantModels(models) {
this.updateDataFromCallParticipantModels(models)
},
isGrid() {
this.adjustSimulcastQuality()
},
selectedVideoPeerId() {
this.adjustSimulcastQuality()
},
speakers() {
this._setPromotedParticipant()
},
screenSharingActive() {
this._setPromotedParticipant()
},
screens() {
this._setScreenVisible()
},
callParticipantModelsWithScreen(newValue, previousValue) {
// Everytime a new screen is shared, switch to promoted view
if (newValue.length > previousValue.length) {
this.$store.dispatch('startPresentation')
} else if (newValue.length === 0 && previousValue.length > 0 && !this.hasLocalScreen) {
// last screen share stopped, reopening stripe
this.$store.dispatch('stopPresentation')
}
},
showLocalScreen(showLocalScreen) {
// Everytime the local screen is shared, switch to promoted view
if (showLocalScreen) {
this.$store.dispatch('startPresentation')
} else if (this.callParticipantModelsWithScreen.length === 0) {
this.$store.dispatch('stopPresentation')
}
},
hasLocalVideo(newValue) {
if (this.$store.getters.selectedVideoPeerId === 'local') {
if (!newValue) {
this.$store.dispatch('selectedVideoPeerId', null)
}
}
},
showSelectedVideo(newVal) {
if (newVal) {
this.$store.dispatch('setCallViewMode', { isGrid: false })
}
},
showSelectedScreen(newVal) {
if (newVal) {
this.$store.dispatch('setCallViewMode', { isGrid: false })
}
},
},
created() {
// Ensure that data is properly initialized before mounting the
// subviews.
this.updateDataFromCallParticipantModels(this.callParticipantModels)
},
mounted() {
EventBus.$on('refresh-peer-list', this.debounceFetchPeers)
callParticipantCollection.on('remove', this._lowerHandWhenParticipantLeaves)
subscribe('switch-screen-to-id', this._switchScreenToId)
},
beforeDestroy() {
EventBus.$off('refresh-peer-list', this.debounceFetchPeers)
callParticipantCollection.off('remove', this._lowerHandWhenParticipantLeaves)
unsubscribe('switch-screen-to-id', this._switchScreenToId)
},
methods: {
/**
* Updates data properties that depend on the CallParticipantModels.
*
* The data contains some properties that can not be dynamically
* computed but that depend on the current CallParticipantModels, so
* this function adds and removes elements and watchers as needed based
* on the given CallParticipantModels.
*
* @param {Array} models the array of CallParticipantModels
*/
updateDataFromCallParticipantModels(models) {
const addedModels = models.filter(model => !this.sharedDatas[model.attributes.peerId])
const removedModelIds = Object.keys(this.sharedDatas).filter(sharedDataId => models.find(model => model.attributes.peerId === sharedDataId) === undefined)
removedModelIds.forEach(removedModelId => {
this.$delete(this.sharedDatas, removedModelId)
this.speakingUnwatchers[removedModelId]()
// Not reactive, but not a problem
delete this.speakingUnwatchers[removedModelId]
this.screenUnwatchers[removedModelId]()
// Not reactive, but not a problem
delete this.screenUnwatchers[removedModelId]
this.raisedHandUnwatchers[removedModelId]()
// Not reactive, but not a problem
delete this.raisedHandUnwatchers[removedModelId]
const index = this.speakers.findIndex(speaker => speaker.id === removedModelId)
this.speakers.splice(index, 1)
this._setScreenAvailable(removedModelId, false)
})
addedModels.forEach(addedModel => {
const sharedData = {
promoted: false,
remoteVideoBlocker: new RemoteVideoBlocker(addedModel),
screenVisible: false,
}
this.$set(this.sharedDatas, addedModel.attributes.peerId, sharedData)
// Not reactive, but not a problem
this.speakingUnwatchers[addedModel.attributes.peerId] = this.$watch(function() {
return addedModel.attributes.speaking
}, function(speaking) {
this._setSpeaking(addedModel.attributes.peerId, speaking)
})
this.speakers.push({
id: addedModel.attributes.peerId,
active: false,
})
// Not reactive, but not a problem
this.screenUnwatchers[addedModel.attributes.peerId] = this.$watch(function() {
return addedModel.attributes.screen
}, function(screen) {
this._setScreenAvailable(addedModel.attributes.peerId, screen)
})
// Not reactive, but not a problem
this.raisedHandUnwatchers[addedModel.attributes.peerId] = this.$watch(function() {
return addedModel.attributes.raisedHand
}, function(raisedHand) {
this._handleParticipantRaisedHand(addedModel, raisedHand)
})
this.adjustSimulcastQualityForParticipant(addedModel)
})
},
_setSpeaking(peerId, speaking) {
if (speaking) {
// Move the speaker to the first element of the list
const index = this.speakers.findIndex(speaker => speaker.id === peerId)
const speaker = this.speakers[index]
speaker.active = true
this.speakers.splice(index, 1)
this.speakers.unshift(speaker)
return
}
// Set the speaker as not speaking
const index = this.speakers.findIndex(speaker => speaker.id === peerId)
const speaker = this.speakers[index]
speaker.active = false
// Move the speaker after all the active speakers
if (index === 0) {
this.speakers.shift()
const firstInactiveSpeakerIndex = this.speakers.findIndex(speaker => !speaker.active)
if (firstInactiveSpeakerIndex === -1) {
this.speakers.push(speaker)
} else {
this.speakers.splice(firstInactiveSpeakerIndex, 0, speaker)
}
}
},
_handleParticipantRaisedHand(callParticipantModel, raisedHand) {
const nickName = callParticipantModel.attributes.name || callParticipantModel.attributes.userId
// sometimes the nick name is not available yet...
if (nickName) {
if (raisedHand?.state) {
showMessage(t('spreed', '{nickName} raised their hand.', { nickName }))
}
} else {
if (raisedHand?.state) {
showMessage(t('spreed', 'A participant raised their hand.'))
}
}
// update in callViewStore
this.$store.dispatch('setParticipantHandRaised', {
sessionId: callParticipantModel.attributes.nextcloudSessionId,
raisedHand,
})
},
_lowerHandWhenParticipantLeaves(callParticipantCollection, callParticipantModel) {
this.$store.dispatch('setParticipantHandRaised', {
sessionId: callParticipantModel.attributes.nextcloudSessionId,
raisedHand: false,
})
},
_setScreenAvailable(id, screen) {
if (screen) {
this.screens.unshift(id)
return
}
const index = this.screens.indexOf(id)
if (index !== -1) {
this.screens.splice(index, 1)
}
},
_setPromotedParticipant() {
Object.values(this.sharedDatas).forEach(sharedData => {
sharedData.promoted = false
})
if (!this.screenSharingActive && this.speakers.length) {
this.sharedDatas[this.speakers[0].id].promoted = true
}
this.adjustSimulcastQuality()
},
_switchScreenToId(id) {
const index = this.screens.indexOf(id)
if (index === -1) {
return
}
this.$store.dispatch('startPresentation')
this.$store.dispatch('selectedVideoPeerId', null)
this.screens.splice(index, 1)
this.screens.unshift(id)
},
_setScreenVisible() {
this.localSharedData.screenVisible = false
Object.values(this.sharedDatas).forEach(sharedData => {
sharedData.screenVisible = false
})
if (!this.screens.length) {
return
}
if (this.screens[0] === this.localCallParticipantModel.attributes.peerId) {
this.localSharedData.screenVisible = true
return
}
this.sharedDatas[this.screens[0]].screenVisible = true
},
// Get the aspect ratio of the incoming stream
getVideoContainerAspectRatio() {
const videoContainerWidth = this.$refs.videoContainer.clientWidth
const VideoContainerHeight = this.$refs.videoContainer.clientHeight
this.videoContainerAspectRatio = videoContainerWidth / VideoContainerHeight
},
handleSelectVideo(peerId) {
if (this.isSidebar) {
return
}
this.$store.dispatch('startPresentation')
this.$store.dispatch('selectedVideoPeerId', peerId)
this.isLocalVideoSelected = false
},
handleClickLocalVideo() {
// DO nothing if no video
if (!this.hasLocalVideo || this.isSidebar) {
return
}
// Deselect possible selected video
this.$store.dispatch('selectedVideoPeerId', 'local')
this.$store.dispatch('startPresentation')
},
debounceFetchPeers: debounce(async function() {
const token = this.token
try {
const response = await fetchPeers(token)
this.$store.dispatch('purgePeersStore')
response.data.ocs.data.forEach((peer) => {
this.$store.dispatch('addPeer', {
token,
peer,
})
})
} catch (exception) {
// Just means guests have no name, so don't error …
console.error(exception)
}
}, 1500),
adjustSimulcastQuality() {
this.callParticipantModels.forEach(callParticipantModel => {
this.adjustSimulcastQualityForParticipant(callParticipantModel)
})
},
adjustSimulcastQualityForParticipant(callParticipantModel) {
if (this.isGrid) {
callParticipantModel.setSimulcastVideoQuality(SIMULCAST.MEDIUM)
} else if (this.sharedDatas[callParticipantModel.attributes.peerId].promoted || this.selectedVideoPeerId === callParticipantModel.attributes.peerId) {
callParticipantModel.setSimulcastVideoQuality(SIMULCAST.HIGH)
} else {
callParticipantModel.setSimulcastVideoQuality(SIMULCAST.LOW)
}
},
},
}
</script>
<style lang="scss" scoped>
@import '../../assets/variables';
.call-view {
width: 100%;
height: 100%;
overflow: hidden;
background-color: $color-call-background;
}
#call-container {
width: 100%;
height: 100%;
background-color: $color-call-background;
}
#videos {
position: absolute;
width: 100%;
height: calc(100% - 60px);
top: 60px;
overflow: hidden;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-justify-content: space-around;
justify-content: space-around;
-webkit-align-items: flex-end;
align-items: flex-end;
flex-direction: column;
padding: 1px 8px 8px 8px;
}
.video__promoted {
position:relative;
height: 100%;
width: 100%;
display: block;
}
.video__promoted.full-page {
/* make the promoted video cover the whole call view */
position: static;
}
.local-video {
position: absolute;
right: 0;
bottom: 0;
width: 300px;
height: 250px;
&--sidebar {
width: 150px;
height: 100px;
}
}
#videos.hidden {
display: none;
}
::v-deep video {
z-index: 0;
/* default filter for slightly better look */
/* Disabled for now as it causes a huuuuge performance drop.
CPU usage is more than halved without this.
-webkit-filter: contrast(1.1) saturate(1.1) sepia(.1);
filter: contrast(1.1) saturate(1.1) sepia(.1);
*/
vertical-align: top; /* fix white line below video */
}
#videos .videoContainer ::v-deep .avatardiv {
box-shadow: 0 0 15px var(--color-box-shadow);
}
.participants-1 #videos .videoContainer ::v-deep video,
.participants-2 #videos .videoContainer ::v-deep video {
padding: 0;
}
.videoContainer ::v-deep .avatar-container .avatardiv {
display: block;
margin-left: auto;
margin-right: auto;
}
.videoContainer.promoted ::v-deep .avatar-container {
top: 30%;
}
.videoContainer.promoted ::v-deep .avatar-container + .nameIndicator {
display: none;
}
.videoContainer.promoted ::v-deep .mediaIndicator {
display: none !important;
}
@media only screen and (max-width: 768px) {
.participants-1 .videoView,
.participants-2 .videoView {
max-height: 35%;
}
}
.participants-1 .videoView ::v-deep video,
.participants-2 .videoView ::v-deep video {
position: absolute;
max-height: 100% !important;
bottom: 0;
border-top-right-radius: 3px;
right: 0;
}
#screens {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
::v-deep .nameIndicator {
position: absolute;
bottom: 0;
left: 0;
padding: 12px;
color: #fff;
text-shadow: 3px 3px 10px rgba(0, 0, 0, .5), 3px -3px 10px rgba(0, 0, 0, .5), -3px 3px 10px rgba(0, 0, 0, .5), -3px -3px 10px rgba(0, 0, 0, .5);
width: 100%;
text-align: center;
font-size: 20px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
::v-deep .videoView .nameIndicator {
padding: 0;
overflow: visible;
}
.participants-1 .videoView ::v-deep .nameIndicator,
.participants-2 .videoView ::v-deep .nameIndicator {
left: initial;
right: 0;
}
.participants-1 .videoView ::v-deep .avatar-container,
.participants-2 .videoView ::v-deep .avatar-container {
left: initial;
right: 0;
}
/* ellipsize name in 1on1 calls */
.participants-2 ::v-deep .videoContainer.promoted + .videoContainer-dummy .nameIndicator {
padding: 12px 35%;
}
#videos .videoContainer.speaking:not(.videoView) ::v-deep .nameIndicator,
#videos .videoContainer.videoView.speaking ::v-deep .nameIndicator .microphone-icon {
animation: pulse 1s;
animation-iteration-count: infinite;
}
@keyframes pulse {
0% {
opacity: 1;
}
50% {
opacity: .3;
}
100% {
opacity: 1;
}
}
</style>
|