Download:
child 252:365e94a6adc8
parent 250:a3345d0a228d
251:c34b52fa3e31
Anton Shestakov <av6@dwimlabs.net>, Sun, 04 Dec 2016 01:40:21 +0800
calls: rename enableTracks() to toggleTracks(), since it takes a state arg

2 файлов изменено, 8 вставок(+), 8 удалений(-) [+]
coffee/calls.coffee file | annotate | diff | comparison | revisions
js/calls.js file | annotate | diff | comparison | revisions
--- a/coffee/calls.coffee Sun Dec 04 01:33:05 2016 +0800
+++ b/coffee/calls.coffee Sun Dec 04 01:40:21 2016 +0800
@@ -75,22 +75,22 @@
@pause()
@removeAttribute('src')
- enableTracks: (tracks, state) ->
+ toggleTracks: (tracks, state) ->
if tracks?
for track in tracks
track.enabled = state
muteCam: ->
muted = @model.get('local/video/muted')
- @enableTracks(@model.get('local/stream')?.getVideoTracks?(), not muted)
+ @toggleTracks(@model.get('local/stream')?.getVideoTracks?(), not muted)
muteMic: ->
muted = @model.get('local/audio/muted')
- @enableTracks(@model.get('local/stream')?.getAudioTracks?(), not muted)
+ @toggleTracks(@model.get('local/stream')?.getAudioTracks?(), not muted)
muteAudio: ->
muted = @model.get('remote/audio/muted')
- @enableTracks(@model.get('remote/stream')?.getAudioTracks?(), not muted)
+ @toggleTracks(@model.get('remote/stream')?.getAudioTracks?(), not muted)
render: ->
@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
@@ -131,7 +131,7 @@
});
};
- CallView.prototype.enableTracks = function(tracks, state) {
+ CallView.prototype.toggleTracks = function(tracks, state) {
var i, len, results, track;
if (tracks != null) {
results = [];
@@ -146,19 +146,19 @@
CallView.prototype.muteCam = function() {
var muted, ref;
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() {
var muted, ref;
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() {
var muted, ref;
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() {