Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mixins/devices.js20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/mixins/devices.js b/src/mixins/devices.js
index e519ec360..59fd15727 100644
--- a/src/mixins/devices.js
+++ b/src/mixins/devices.js
@@ -126,7 +126,15 @@ export const devices = {
this.mediaDevicesManager.getUserMedia({ audio: true })
.then(stream => {
- this.setAudioStream(stream)
+ if (!this.initialized) {
+ // The promise was fulfilled once the stream is no
+ // longer needed, so just discard it.
+ stream.getTracks().forEach((track) => {
+ track.stop()
+ })
+ } else {
+ this.setAudioStream(stream)
+ }
resetPendingGetUserMediaAudioCount()
})
@@ -178,7 +186,15 @@ export const devices = {
this.mediaDevicesManager.getUserMedia({ video: true })
.then(stream => {
- this.setVideoStream(stream)
+ if (!this.initialized) {
+ // The promise was fulfilled once the stream is no
+ // longer needed, so just discard it.
+ stream.getTracks().forEach((track) => {
+ track.stop()
+ })
+ } else {
+ this.setVideoStream(stream)
+ }
resetPendingGetUserMediaVideoCount()
})