Skip to content

Commit

Permalink
Resolve merge conflict on CHANGES.md
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpaulmedina committed Jan 27, 2021
2 parents 00bd603 + 8cc4bbd commit 151365a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 24 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ wavesurfer.js changelog
x.x.x (unreleased)
------------------
- Split Channels: `overlay` param now properly displays a single canvas (#2161)
- Fixed memory leak with `destroy()` in `WebAudio` backend (#1940)
- Regions plugin: Stop region dragging when mouse leaves canvas (#2158)
- Fixed `WaveSurfer.load(url)` not working when passing a HTMLMediaElement as the url parameter, with the WebAudio backend.
- Microphone plugin: remove deprecated `MediaStream.stop` call (#2168)

4.4.0 (13.01.2021)
------------------
Expand Down
4 changes: 0 additions & 4 deletions build-config/fragments/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ const path = require('path');
module.exports = {
mode: 'development',
devtool: 'eval-source-map',
output: {
publicPath: 'localhost:8080/dist/'
},
devServer: {
static: [
{
directory: path.resolve(__dirname, '..', '..'),
staticOptions: {},
publicPath: '/dist/',
serveIndex: true,
watch: {
ignored: [
Expand Down
2 changes: 2 additions & 0 deletions spec/wavesurfer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ describe('WaveSurfer/playback:', function() {
done();
});
wavesurfer.destroy();

expect(wavesurfer.backend).toBeNull();
});

describe('seek event emission', function() {
Expand Down
22 changes: 2 additions & 20 deletions src/plugin/microphone/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,26 +216,8 @@ export default class MicrophonePlugin {
this.disconnect();

// stop stream from device
if (this.stream) {
// MediaStream.stop is deprecated since:
// - Firefox 44 (https://www.fxsitecompat.com/en-US/docs/2015/mediastream-stop-has-been-deprecated/)
// - Chrome 45 (https://developers.google.com/web/updates/2015/07/mediastream-deprecations)
if (
(this.browser.browser === 'chrome' &&
this.browser.version >= 45) ||
(this.browser.browser === 'firefox' &&
this.browser.version >= 44) ||
this.browser.browser === 'edge' ||
this.browser.browser === 'safari'
) {
if (this.stream.getTracks) {
// note that this should not be a call
this.stream.getTracks().forEach(stream => stream.stop());
return;
}
}

this.stream.stop();
if (this.stream && this.stream.getTracks) {
this.stream.getTracks().forEach(stream => stream.stop());
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/wavesurfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,8 @@ export default class WaveSurfer extends util.Observer {
}
if (this.backend) {
this.backend.destroy();
// clears memory usage
this.backend = null;
}
if (this.drawer) {
this.drawer.destroy();
Expand Down

0 comments on commit 151365a

Please sign in to comment.