diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2021-05-25 06:48:21 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2021-06-21 19:03:19 +0200 |
commit | b29647bd739f5cb8ec21fe104300a1bbed8c4d0d (patch) | |
tree | 55fbe4be46533d4e8d2474f56e09192eb63758ab | |
parent | 9c5aad76f292601fd8d314a3ee351da49348f22c (diff) |
Replace anonymous with arrow function so "this" is properly defined
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r-- | src/utils/webrtc/simplewebrtc/localmedia.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utils/webrtc/simplewebrtc/localmedia.js b/src/utils/webrtc/simplewebrtc/localmedia.js index 890961dd4..ad7e84903 100644 --- a/src/utils/webrtc/simplewebrtc/localmedia.js +++ b/src/utils/webrtc/simplewebrtc/localmedia.js @@ -634,8 +634,8 @@ LocalMedia.prototype.resume = function() { LocalMedia.prototype._setAudioEnabled = function(bool) { this._audioEnabled = bool - this.localStreams.forEach(function(stream) { - stream.getAudioTracks().forEach(function(track) { + this.localStreams.forEach(stream => { + stream.getAudioTracks().forEach(track => { track.enabled = !!bool }) }) @@ -643,8 +643,8 @@ LocalMedia.prototype._setAudioEnabled = function(bool) { LocalMedia.prototype._setVideoEnabled = function(bool) { this._videoEnabled = bool - this.localStreams.forEach(function(stream) { - stream.getVideoTracks().forEach(function(track) { + this.localStreams.forEach(stream => { + stream.getVideoTracks().forEach(track => { track.enabled = !!bool }) }) |