audio-recorder-polyfill
Advanced tools
Comparing version 0.1.3 to 0.1.4
# Change Log | ||
This project adheres to [Semantic Versioning](http://semver.org/). | ||
## 0.1.4 | ||
* Fix noise in Safari (by Sri Harsha Gangisetty). | ||
## 0.1.3 | ||
@@ -5,0 +8,0 @@ * Fix compatibility by adding `error` event (by Tom Quirk). |
12
index.js
@@ -81,2 +81,5 @@ var AudioContext = window.AudioContext || window.webkitAudioContext | ||
start: function start (timeslice) { | ||
/** | ||
Create a clone of stream and start recording | ||
*/ | ||
if (this.state !== 'inactive') { | ||
@@ -91,3 +94,4 @@ return this.em.dispatchEvent(error('start')) | ||
} | ||
var input = context.createMediaStreamSource(this.stream) | ||
this.clone = this.stream.clone() | ||
var input = context.createMediaStreamSource(this.clone) | ||
var processor = context.createScriptProcessor(2048, 1, 1) | ||
@@ -129,2 +133,5 @@ | ||
stop: function stop () { | ||
/** | ||
Stop stream and end cloned stream tracks | ||
*/ | ||
if (this.state === 'inactive') { | ||
@@ -136,2 +143,5 @@ return this.em.dispatchEvent(error('stop')) | ||
this.state = 'inactive' | ||
this.clone.getTracks().forEach(function (track) { | ||
track.stop() | ||
}) | ||
return clearInterval(this.slicing) | ||
@@ -138,0 +148,0 @@ }, |
{ | ||
"name": "audio-recorder-polyfill", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "MediaRecorder polyfill to record audio in Edge and Safari", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -12,3 +12,3 @@ # Audio Recorder Polyfill | ||
MediaRecorder, you will just remove polyfill. | ||
* **Small.** 1 KB (minified and gzipped). No dependencies. | ||
* **Small.** 1.1 KB (minified and gzipped). No dependencies. | ||
It uses [Size Limit] to control size. | ||
@@ -46,5 +46,5 @@ * **One file.** In contrast to other recorders, this polyfill uses | ||
We recommend creating separated webpack bundle with polyfill. In this case, | ||
polyfill will be downloaded only by Edge and Safari. Good browsers will | ||
download less. | ||
We recommend creating separated webpack/Parcel bundle with polyfill. | ||
In this case, polyfill will be downloaded only by Edge and Safari. | ||
Good browsers will download less. | ||
@@ -70,3 +70,5 @@ ```diff | ||
+ if (!window.MediaRecorder) { | ||
+ document.write(decodeURI('%3Cscript src="/polyfill.js">%3C/script>')) | ||
+ document.write( | ||
+ decodeURI('%3Cscript defer src="/polyfill.js">%3C/script>') | ||
+ ) | ||
+ } | ||
@@ -159,4 +161,2 @@ + </script> | ||
* Constructor options are not supported. | ||
* Polyfill ignores method call in the wrong state (like `stop()` | ||
during `inactive` state) instead of throwing an error. | ||
* `BlobEvent.timecode` is not supported. | ||
@@ -163,0 +163,0 @@ |
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
16097
316