Anton Shestakov <av6@dwimlabs.net>, Sun, 04 Dec 2016 01:40:21 +0800
calls: rename enableTracks() to toggleTracks(), since it takes a state arg
--- a/coffee/calls.coffee Sun Dec 04 01:33:05 2016 +0800
+++ b/coffee/calls.coffee Sun Dec 04 01:40:21 2016 +0800
- enableTracks: (tracks, state) ->
+ toggleTracks: (tracks, state) ->
muted = @model.get('local/video/muted')
- @enableTracks(@model.get('local/stream')?.getVideoTracks?(), not muted)
+ @toggleTracks(@model.get('local/stream')?.getVideoTracks?(), not muted)
muted = @model.get('local/audio/muted')
- @enableTracks(@model.get('local/stream')?.getAudioTracks?(), not muted)
+ @toggleTracks(@model.get('local/stream')?.getAudioTracks?(), not muted)
muted = @model.get('remote/audio/muted')
- @enableTracks(@model.get('remote/stream')?.getAudioTracks?(), not muted)
+ @toggleTracks(@model.get('remote/stream')?.getAudioTracks?(), not muted)
@rivet = rivets.bind(@el, model: @model, view: @)
--- a/js/calls.js Sun Dec 04 01:33:05 2016 +0800
+++ b/js/calls.js Sun Dec 04 01:40:21 2016 +0800
- CallView.prototype.enableTracks = function(tracks, state) {
+ CallView.prototype.toggleTracks = function(tracks, state) {
var i, len, results, track;
CallView.prototype.muteCam = function() {
muted = this.model.get('local/video/muted');
- return this.enableTracks((ref = this.model.get('local/stream')) != null ? typeof ref.getVideoTracks === "function" ? ref.getVideoTracks() : void 0 : void 0, !muted);
+ return this.toggleTracks((ref = this.model.get('local/stream')) != null ? typeof ref.getVideoTracks === "function" ? ref.getVideoTracks() : void 0 : void 0, !muted);
CallView.prototype.muteMic = function() {
muted = this.model.get('local/audio/muted');
- return this.enableTracks((ref = this.model.get('local/stream')) != null ? typeof ref.getAudioTracks === "function" ? ref.getAudioTracks() : void 0 : void 0, !muted);
+ return this.toggleTracks((ref = this.model.get('local/stream')) != null ? typeof ref.getAudioTracks === "function" ? ref.getAudioTracks() : void 0 : void 0, !muted);
CallView.prototype.muteAudio = function() {
muted = this.model.get('remote/audio/muted');
- return this.enableTracks((ref = this.model.get('remote/stream')) != null ? typeof ref.getAudioTracks === "function" ? ref.getAudioTracks() : void 0 : void 0, !muted);
+ return this.toggleTracks((ref = this.model.get('remote/stream')) != null ? typeof ref.getAudioTracks === "function" ? ref.getAudioTracks() : void 0 : void 0, !muted);
CallView.prototype.render = function() {