diff --git a/src/components/pages/Conference/CscConferenceParticipants.vue b/src/components/pages/Conference/CscConferenceParticipants.vue index db1ebe03..c293b757 100644 --- a/src/components/pages/Conference/CscConferenceParticipants.vue +++ b/src/components/pages/Conference/CscConferenceParticipants.vue @@ -75,6 +75,7 @@ }, setSelectedParticipant(participant){ this.$store.commit('conference/setSelectedParticipant', participant); + this.$store.commit('conference/setManualSelection', true); } }, watch: { diff --git a/src/components/pages/Conference/CscConferenceRemoteParticipant.vue b/src/components/pages/Conference/CscConferenceRemoteParticipant.vue index 73c95c54..5f51925a 100644 --- a/src/components/pages/Conference/CscConferenceRemoteParticipant.vue +++ b/src/components/pages/Conference/CscConferenceRemoteParticipant.vue @@ -27,7 +27,8 @@ import { QIcon, QCard, QCardMedia, QCardTitle } from 'quasar-framework' import CscMedia from "../../CscMedia"; import { - mapGetters + mapGetters, + mapState } from 'vuex' export default { name: 'csc-conference-remote-participant', @@ -50,12 +51,18 @@ 'hasRemoteVideo', ], computed: { + ...mapState('conference', [ + 'manualSelection' + ]), ...mapGetters('conference', [ 'selectedParticipant' ]) }, mounted() { this.assignStream(this); + if(!this.manualSelection){ + this.$store.commit('conference/setSelectedParticipant', this.remoteParticipant.id); + } }, methods: { assignStream: (scope) => { @@ -67,8 +74,8 @@ scope.$store.commit('conference/setSelectedParticipant', scope.remoteParticipant.id); } } - else if (this.$refs.cscMedia) { - this.$refs.cscMedia.reset(); + else if (scope.$refs.cscMedia) { + scope.$refs.cscMedia.reset(); } } }, diff --git a/src/store/conference.js b/src/store/conference.js index 3a888246..9c059130 100644 --- a/src/store/conference.js +++ b/src/store/conference.js @@ -26,7 +26,8 @@ export default { leaveError: null, participants: [], remoteMediaStreams: {}, - selectedParticipant: null + selectedParticipant: null, + manualSelection: false }, getters: { username(state, getters, rootState, rootGetters) { @@ -210,6 +211,7 @@ export default { } else if(state.selectedParticipant == participant.getId()){ state.selectedParticipant = 'local'; + state.manualSelection = false; } state.participants = state.participants.filter(($participant) => { return participant.getId() !== $participant; @@ -219,6 +221,9 @@ export default { }, setSelectedParticipant(state, participant){ state.selectedParticipant = participant; + }, + setManualSelection(state, val){ + state.manualSelection = val; } }, actions: {