From 8f0fa87c5d40c3bd5ca0b2b924ba2dabd681411b Mon Sep 17 00:00:00 2001 From: Hans-Peter Herzog Date: Tue, 12 Nov 2019 12:05:30 +0100 Subject: [PATCH] TT#70200 Conferencing > most recent joined participant as current selected one - Can see the most recent joined participant as selected user (#70201) Logic: 1. if no participant has been manually selected during the conference, the last who joins becomes selected 2. if a participant is manually selected during the conference, the logic on point 1. is bypassed (ux) 3. if the current selected participant leaves the conference, the logic on point 1. is restored Change-Id: I5741d19d45aaa2cfb465d3545824c44ee6c67261 --- .../pages/Conference/CscConferenceParticipants.vue | 1 + .../Conference/CscConferenceRemoteParticipant.vue | 13 ++++++++++--- src/store/conference.js | 7 ++++++- 3 files changed, 17 insertions(+), 4 deletions(-) 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: {