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
path: root/src/utils
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2022-03-11 15:00:35 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2022-03-11 15:00:35 +0300
commit1eaf569402e0685bcd5f0f35dba5f9fc64a42bca (patch)
treef2ea117908a013c1ff3095e0e513d5181dbd9116 /src/utils
parent951d0828d195fa12537eb68a59c1722d94414f91 (diff)
Set initial media state based on the current tracks
This should not make any difference, as the configuration reflects the current tracks, but it makes it more consistent with "_updateMediaAvailability()" and prepares it for upcoming changes. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/webrtc/models/LocalMediaModel.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/utils/webrtc/models/LocalMediaModel.js b/src/utils/webrtc/models/LocalMediaModel.js
index 3f87eb8c2..2771e9616 100644
--- a/src/utils/webrtc/models/LocalMediaModel.js
+++ b/src/utils/webrtc/models/LocalMediaModel.js
@@ -172,7 +172,7 @@ LocalMediaModel.prototype = {
this.set('token', store.getters.getToken())
- this._setInitialMediaState(configuration)
+ this._setInitialMediaState(localStream)
},
_handleLocalStreamRequestFailedRetryNoVideo(constraints, error) {
@@ -186,11 +186,11 @@ LocalMediaModel.prototype = {
_handleLocalStreamRequestFailed() {
this.set('localStream', null)
- this._setInitialMediaState({ audio: false, video: false })
+ this._setInitialMediaState(null)
},
- _setInitialMediaState(configuration) {
- if (configuration.audio !== false) {
+ _setInitialMediaState(localStream) {
+ if (localStream && localStream.getAudioTracks().length > 0) {
this.set('audioAvailable', true)
if (this.get('audioEnabled')) {
this.enableAudio()
@@ -202,7 +202,7 @@ LocalMediaModel.prototype = {
this.set('audioAvailable', false)
}
- if (configuration.video !== false) {
+ if (localStream && localStream.getVideoTracks().length > 0) {
this.set('videoAvailable', true)
if (this.get('videoEnabled')) {
this.enableVideo()