TT#47706 Conferencing: As a Customer, I want to mute/unmute each participant separately

- Must see a more menu at the top of the ParticipantItem (#70952)
- Must be able to mute/unmute the remote audio by opening the more menu and clicking the mute/unmute list item (#70955)
- Must see an icon that refelcts the current state in the ParticipantItem (whether muted or unmuted) (#70956)

Change-Id: Ibab4bdd9887c1a8ce4e3760c154cefae6b6caab7
changes/57/35357/7
Carlo Venusino 6 years ago
parent 079e4a12a1
commit 8de739f80f

@ -164,6 +164,12 @@
else { else {
this.fitMediaToParent(); this.fitMediaToParent();
} }
},
toggleAudio(){
return this.$refs.media.muted = !this.$refs.media.muted;
},
isMuted(){
return this.$refs.media.muted;
} }
}, },
watch: { watch: {

@ -2,6 +2,39 @@
<q-card <q-card
class="csc-conf-participant-cont" class="csc-conf-participant-cont"
> >
<div class="csc-conf-audio-icons-cont">
<q-icon
name="more_vert"
class="csc-conf-toggle-audio-menu-icon"
>
<q-popover ref="popover" class="csc-conf-toggle-audio-popover">
<q-list
link
class="no-border csc-conf-toggle-audio-menu-item"
>
<q-item
@click="toggleAudio"
>
<q-item-main
:label="audioLabel()"
/>
</q-item>
</q-list>
</q-popover>
</q-icon>
<q-icon
class="csc-conf-toggle-audio-icon"
name="volume_off"
v-if="isMuted"
>
</q-icon>
<q-icon
class="csc-conf-toggle-audio-icon"
name="volume_up"
v-if="!isMuted"
>
</q-icon>
</div>
<q-icon <q-icon
name="person" name="person"
class="csc-conf-avatar" class="csc-conf-avatar"
@ -24,7 +57,7 @@
</template> </template>
<script> <script>
import { QIcon, QCard, QCardMedia, QCardTitle } from 'quasar-framework' import { QIcon, QCard, QCardMedia, QCardTitle, QPopover, QList, QItem, QItemMain } from 'quasar-framework'
import CscMedia from "../../CscMedia"; import CscMedia from "../../CscMedia";
import { import {
mapGetters, mapGetters,
@ -37,11 +70,16 @@
QCard, QCard,
QCardMedia, QCardMedia,
QCardTitle, QCardTitle,
QPopover,
QList,
QItem,
QItemMain,
CscMedia CscMedia
}, },
data: function () { data: function () {
return { return {
localMediaStream : null localMediaStream : null,
isMuted: false
} }
}, },
props: [ props: [
@ -59,29 +97,38 @@
]) ])
}, },
mounted() { mounted() {
this.assignStream(this); this.assignStream();
if(!this.manualSelection){ if(!this.manualSelection){
this.$store.commit('conference/setSelectedParticipant', this.remoteParticipant.id); this.$store.commit('conference/setSelectedParticipant', this.remoteParticipant.id);
} }
}, },
methods: { methods: {
assignStream: (scope) => { assignStream(){
if (scope.$refs.cscMedia && scope.remoteMediaStreams[scope.remoteParticipant.id] === scope.remoteParticipant.id) { if (this.$refs.cscMedia && this.remoteMediaStreams[this.remoteParticipant.id] === this.remoteParticipant.id) {
scope.localMediaStream = scope.remoteMediaStream(scope.remoteParticipant.id); this.localMediaStream = this.remoteMediaStream(this.remoteParticipant.id);
scope.$refs.cscMedia.assignStream(scope.localMediaStream); this.$refs.cscMedia.assignStream(this.localMediaStream);
if(scope.selectedParticipant == scope.remoteParticipant.id){ if(this.selectedParticipant == this.remoteParticipant.id){
scope.$store.commit('conference/setSelectedParticipant', 'local'); // TODO improve (workaround to reset the mediaStream) this.$store.commit('conference/setSelectedParticipant', 'local'); // TODO improve (workaround to reset the mediaStream)
scope.$store.commit('conference/setSelectedParticipant', scope.remoteParticipant.id); this.$store.commit('conference/setSelectedParticipant', this.remoteParticipant.id);
} }
} }
else if (scope.$refs.cscMedia) { else if (this.$refs.cscMedia) {
scope.$refs.cscMedia.reset(); this.$refs.cscMedia.reset();
} }
},
toggleAudio(){
this.$refs.popover.close()
this.isMuted = this.$refs.cscMedia.toggleAudio();
},
audioLabel() {
return this.isMuted
? this.$t('conferencing.unmuteMicrophone')
: this.$t('conferencing.muteMicrophone');
} }
}, },
watch: { watch: {
remoteMediaStreams() { remoteMediaStreams() {
this.assignStream(this); this.assignStream();
} }
} }
} }
@ -89,4 +136,20 @@
<style lang="stylus" rel="stylesheet/stylus"> <style lang="stylus" rel="stylesheet/stylus">
@import '../../../themes/app.common.styl' @import '../../../themes/app.common.styl'
.csc-conf-audio-icons-cont
position relative
width 100%
.csc-conf-toggle-audio-menu-icon
position absolute
padding-top 5px
z-index 10
.csc-conf-toggle-audio-icon
@extend .csc-conf-toggle-audio-menu-icon
right 5px
cursor default
.csc-conf-toggle-audio-popover
width 115px
.csc-conf-toggle-audio-menu-item
.q-item
font-size 14px
</style> </style>

@ -596,7 +596,9 @@
"copyLinkButtonLabel": "Copy link", "copyLinkButtonLabel": "Copy link",
"exitDialogTitle": "Leave conference", "exitDialogTitle": "Leave conference",
"exitDialogText": "Leave current conference now!", "exitDialogText": "Leave current conference now!",
"leaveButtonLabel": "Leave" "leaveButtonLabel": "Leave",
"muteMicrophone": "Mute",
"unmuteMicrophone": "Unmute"
}, },
"userSettings": { "userSettings": {
"changePassword": "Change password", "changePassword": "Change password",

@ -256,8 +256,7 @@ input.q-input-target
position relative position relative
width 100% width 100%
height 100% height 100%
top 0 top 0px
bottom 0
left -22px left -22px
right 0 right 0
margin auto margin auto

Loading…
Cancel
Save