Browse Source

Do not explicitly disable audio and video on changed streams

When a stream was changed the audio and video was explicitly disabled
again even if it was already disabled. This was needed in the past
because updated tracks always started enabled, so they had to be
explicitly disabled through the model. However, since 82ba579624 the
updated tracks are automatically disabled if needed after starting, so
they are already consistent with the state in the model and thus it is
no longer needed to explicitly disable them again.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
pull/6322/head
Daniel Calviño Sánchez 4 years ago
parent
commit
defe61742e
  1. 14
      src/utils/webrtc/models/LocalMediaModel.js

14
src/utils/webrtc/models/LocalMediaModel.js

@ -210,13 +210,6 @@ LocalMediaModel.prototype = {
_updateMediaAvailability(localStream) {
if (localStream && localStream.getAudioTracks().length > 0) {
this.set('audioAvailable', true)
if (!this.get('audioEnabled')) {
// Explicitly disable the audio to ensure that it will also be
// disabled in the other end. Otherwise the WebRTC media could
// be enabled.
this.disableAudio()
}
} else {
this.disableAudio()
this.set('audioAvailable', false)
@ -224,13 +217,6 @@ LocalMediaModel.prototype = {
if (localStream && localStream.getVideoTracks().length > 0) {
this.set('videoAvailable', true)
if (!this.get('videoEnabled')) {
// Explicitly disable the video to ensure that it will also be
// disabled in the other end. Otherwise the WebRTC media could
// be enabled.
this.disableVideo()
}
} else {
this.disableVideo()
this.set('videoAvailable', false)

Loading…
Cancel
Save