TT#71911 Conference: fix wrong merge

Change-Id: Iae4f97a98b1d10fa2eb3beac7144667d3f595750
changes/36/35936/2
Carlo Venusino 6 years ago
parent 8d94175edd
commit f861e0e189

@ -166,10 +166,7 @@
} }
}, },
toggleAudio(muted){ toggleAudio(muted){
return this.$refs.media.muted = muted || !this.$refs.media.muted; this.$refs.media.muted = muted;
},
isMuted(){
return this.$refs.media.muted;
} }
}, },
watch: { watch: {

@ -42,7 +42,6 @@
<csc-conference-participants <csc-conference-participants
ref="confParticipants" ref="confParticipants"
v-if="!isJoining && isJoined" v-if="!isJoining && isJoined"
:is-muted="isMuted"
/> />
</div> </div>
@ -116,6 +115,7 @@
:disable="!hasConferenceId || isJoining" :disable="!hasConferenceId || isJoining"
/> />
<q-btn <q-btn
v-if="isJoined"
class="csc-conf-button" class="csc-conf-button"
:color="screenButtonColor" :color="screenButtonColor"
icon="more_vert" icon="more_vert"
@ -178,7 +178,6 @@
export default { export default {
data: function () { data: function () {
return { return {
isMuted: false,
selectedMediaStream : null, selectedMediaStream : null,
selectedParticipantName: null selectedParticipantName: null
} }
@ -224,7 +223,8 @@
'remoteParticipant', 'remoteParticipant',
'remoteMediaStream', 'remoteMediaStream',
'remoteMediaStreams', 'remoteMediaStreams',
'hasRemoteVideo' 'hasRemoteVideo',
'mutedState'
]), ]),
microphoneButtonColor() { microphoneButtonColor() {
if(this.isMicrophoneEnabled) { if(this.isMicrophoneEnabled) {
@ -293,12 +293,17 @@
}, },
toggleMuteAll(){ toggleMuteAll(){
this.$refs.popover.close(); this.$refs.popover.close();
this.isMuted = !this.isMuted; if(this.mutedState.length < 1) {
this.$store.dispatch('conference/muteAll');
}
else{
this.$store.dispatch('conference/unMuteAll');
}
}, },
muteLabel() { muteLabel() {
return this.isMuted return this.mutedState.length < 1
? this.$t('conferencing.unmuteAll') ? this.$t('conferencing.muteAll')
: this.$t('conferencing.muteAll'); : this.$t('conferencing.unmuteAll');
}, },
async join(conferenceId) { async join(conferenceId) {
if(this.hasConferenceId) { if(this.hasConferenceId) {

@ -23,7 +23,6 @@
:has-remote-video="hasRemoteVideo(participantId)" :has-remote-video="hasRemoteVideo(participantId)"
:remote-media-stream="remoteMediaStream" :remote-media-stream="remoteMediaStream"
:remote-media-streams="remoteMediaStreams" :remote-media-streams="remoteMediaStreams"
:is-muted="isMuted"
/> />
</div> </div>
</div> </div>
@ -49,9 +48,6 @@
CscConferenceRemoteParticipant, CscConferenceRemoteParticipant,
CscConferenceLocalParticipant CscConferenceLocalParticipant
}, },
props: [
'isMuted'
],
computed: { computed: {
...mapState('conference', [ ...mapState('conference', [
'remoteMediaStreams' 'remoteMediaStreams'

@ -78,7 +78,7 @@
}, },
data: function () { data: function () {
return { return {
isAudioMuted: JSON.parse(this.isMuted), isAudioMuted: false,
localMediaStream : null localMediaStream : null
} }
}, },
@ -86,15 +86,14 @@
'remoteParticipant', 'remoteParticipant',
'remoteMediaStream', 'remoteMediaStream',
'remoteMediaStreams', 'remoteMediaStreams',
'hasRemoteVideo', 'hasRemoteVideo'
'isMuted'
], ],
computed: { computed: {
...mapState('conference', [ ...mapState('conference', [
'manualSelection' 'manualSelection'
]), ]),
...mapGetters('conference', [ ...mapGetters('conference', [
'selectedParticipant' 'mutedState'
]) ])
}, },
mounted() { mounted() {
@ -119,7 +118,9 @@
}, },
toggleAudio(){ toggleAudio(){
this.$refs.popover.close(); this.$refs.popover.close();
this.isAudioMuted = this.$refs.cscMedia.toggleAudio(); this.isAudioMuted
? this.$store.commit('conference/removeMutedState', this.remoteParticipant.id)
: this.$store.commit('conference/addMutedState', this.remoteParticipant.id)
}, },
audioLabel() { audioLabel() {
return this.isAudioMuted return this.isAudioMuted
@ -131,9 +132,9 @@
remoteMediaStreams() { remoteMediaStreams() {
this.assignStream(); this.assignStream();
}, },
isMuted(){ mutedState(){
this.isAudioMuted = this.isMuted; this.isAudioMuted = this.mutedState.includes(this.remoteParticipant.id);
this.$refs.cscMedia.toggleAudio(this.isMuted); this.$refs.cscMedia.toggleAudio(this.isAudioMuted);
} }
} }
} }

@ -25,6 +25,7 @@ export default {
leaveState: RequestState.initiated, leaveState: RequestState.initiated,
leaveError: null, leaveError: null,
participants: [], participants: [],
mutedState: [],
remoteMediaStreams: {}, remoteMediaStreams: {},
selectedParticipant: null, selectedParticipant: null,
manualSelection: false manualSelection: false
@ -100,6 +101,9 @@ export default {
participantsList(state) { participantsList(state) {
return state.participants; return state.participants;
}, },
mutedState(state){
return state.mutedState;
},
remoteMediaStreams(state) { remoteMediaStreams(state) {
return state.remoteMediaStreams; return state.remoteMediaStreams;
}, },
@ -225,6 +229,16 @@ export default {
}, },
setManualSelection(state, val){ setManualSelection(state, val){
state.manualSelection = val; state.manualSelection = val;
},
addMutedState(state, participantId){
if(!state.mutedState[participantId]){
state.mutedState.push(participantId);
}
},
removeMutedState(state, participantId){
state.mutedState = state.mutedState.filter(($participant) => {
return participantId !== $participant;
});
} }
}, },
actions: { actions: {
@ -418,6 +432,17 @@ export default {
context.commit('leaveFailed', err.message); context.commit('leaveFailed', err.message);
} }
} }
},
muteAll(context){
for(let participant of context.getters.participantsList){
context.commit('addMutedState', participant);
}
},
unMuteAll(context){
for(let participant of context.getters.participantsList){
context.commit('removeMutedState', participant);
}
} }
} }
} }

Loading…
Cancel
Save