diff options
Diffstat (limited to 'src/store/callViewStore.js')
-rw-r--r-- | src/store/callViewStore.js | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/store/callViewStore.js b/src/store/callViewStore.js index 5f67569bd..4af4c89d9 100644 --- a/src/store/callViewStore.js +++ b/src/store/callViewStore.js @@ -33,8 +33,8 @@ const state = { lastIsStripeOpen: null, presentationStarted: false, selectedVideoPeerId: null, - videoBackgroundBlur: 1, participantRaisedHands: {}, + backgroundImageAverageColorCache: {}, } const getters = { @@ -46,19 +46,15 @@ const getters = { selectedVideoPeerId: (state) => { return state.selectedVideoPeerId }, - /** - * @param {object} state the width and height to calculate the radius from - * @returns {number} the blur radius to use, in pixels - */ - getBlurRadius: (state) => (width, height) => { - return (width * height * state.videoBackgroundBlur) / 1000 - }, getParticipantRaisedHand: (state) => (sessionId) => { return state.participantRaisedHands[sessionId] || { state: false, timestamp: null } }, isParticipantRaisedHand: (state) => (sessionId) => { return state.participantRaisedHands[sessionId]?.state }, + getCachedBackgroundImageAverageColor: (state) => (videoBackgroundId) => { + return state.backgroundImageAverageColorCache[videoBackgroundId] + }, } const mutations = { @@ -94,6 +90,12 @@ const mutations = { clearParticipantHandRaised(state) { state.participantRaisedHands = {} }, + setCachedBackgroundImageAverageColor(state, { videoBackgroundId, backgroundImageAverageColor }) { + Vue.set(state.backgroundImageAverageColorCache, videoBackgroundId, backgroundImageAverageColor) + }, + clearBackgroundImageAverageColorCache(state) { + state.backgroundImageAverageColorCache = {} + }, } const actions = { @@ -118,6 +120,8 @@ const actions = { leaveCall(context) { // clear raised hands as they were specific to the call context.commit('clearParticipantHandRaised') + + context.commit('clearBackgroundImageAverageColorCache') }, /** @@ -152,6 +156,10 @@ const actions = { context.commit('setParticipantHandRaised', { sessionId, raisedHand }) }, + setCachedBackgroundImageAverageColor(context, { videoBackgroundId, backgroundImageAverageColor }) { + context.commit('setCachedBackgroundImageAverageColor', { videoBackgroundId, backgroundImageAverageColor }) + }, + /** * Starts presentation mode. * |