summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2023-08-13 06:23:55 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-08-15 03:39:56 +0000
commit2c34fa91be59361fbb872dcab751a887a92a02ab (patch)
tree7c4217f557f01664a6ec38cc010846ad55d97ae1
parent10c4934e3853975c6ed633b91e1496370741adf3 (diff)
Update timestamp only when starting to speak
The timestamp is only used to calculate the elapsed speaking time when stopping to speak, so it needs to be updated only when starting to speak. Additionally, in some cases "speaking" can also be set to "undefined" (for example, when a remote participant leaves the call); from the point of view of tracking the speaking time any falsy value is false, so the value is explicitly set to true/false. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r--src/store/participantsStore.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/store/participantsStore.js b/src/store/participantsStore.js
index 1bd09bce1..540810092 100644
--- a/src/store/participantsStore.js
+++ b/src/store/participantsStore.js
@@ -371,12 +371,10 @@ const mutations = {
// when speaking has stopped, update the total talking time
if (currentSpeakingState && !speaking && state.speaking[token][sessionId].lastTimestamp) {
+ state.speaking[token][sessionId].speaking = false
state.speaking[token][sessionId].totalCountedTime += (currentTimestamp - state.speaking[token][sessionId].lastTimestamp)
- }
-
- // don't change state for consecutive identical signals
- if (currentSpeakingState !== speaking) {
- state.speaking[token][sessionId].speaking = speaking
+ } else if (!currentSpeakingState && speaking) {
+ state.speaking[token][sessionId].speaking = true
state.speaking[token][sessionId].lastTimestamp = currentTimestamp
}
},