mediastream-gain
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -29,11 +29,3 @@ (function(e){if("function"==typeof bootstrap)bootstrap("mediastreamgaincontroller",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeMediaStreamGainController=e}else"undefined"!=typeof window?window.MediaStreamGainController=e():global.MediaStreamGainController=e()})(function(){var define,ses,bootstrap,module,exports; | ||
// check for support | ||
if (!this.support) { | ||
// if we're being asked to set to | ||
// 0 we can still disable it. | ||
if (val === 0) { | ||
return this.off(); | ||
} else { | ||
return; | ||
} | ||
} | ||
if (!this.support) return; | ||
this.gainFilter.gain.value = val; | ||
@@ -48,20 +40,10 @@ this.gain = val; | ||
GainController.prototype.off = function () { | ||
if (this.support) return this.setGain(0); | ||
this._enableAudio(false); | ||
this.gain = 0; | ||
return this.setGain(0); | ||
}; | ||
GainController.prototype.on = function () { | ||
if (this.support) return this.setGain(1); | ||
this._enableAudio(true); | ||
this.gain = 1; | ||
this.setGain(1); | ||
}; | ||
GainController.prototype._enableAudio = function (bool) { | ||
this.stream.getAudioTracks().forEach(function (track) { | ||
track.enabled = bool; | ||
}); | ||
}; | ||
module.exports = GainController; | ||
@@ -89,3 +71,3 @@ | ||
prefix: prefix, | ||
webAudio: !!AudioContext.prototype.createMediaStreamSource, | ||
webAudio: !!(AudioContext && AudioContext.prototype.createMediaStreamSource), | ||
screenSharing: screenSharing, | ||
@@ -92,0 +74,0 @@ AudioContext: AudioContext, |
{ | ||
"name": "mediastream-gain", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "cross-browser getUserMedia shim with node.js style error-first API.", | ||
@@ -20,3 +20,3 @@ "main": "mediastream-gain.js", | ||
"dependencies": { | ||
"webrtcsupport": "0.4.0" | ||
"webrtcsupport": "0.4.1" | ||
}, | ||
@@ -23,0 +23,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9444
106
+ Addedwebrtcsupport@0.4.1(transitive)
- Removedwebrtcsupport@0.4.0(transitive)
Updatedwebrtcsupport@0.4.1