wavesurfer.js 6.3.0 → 6.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +1 -0
  2. package/dist/plugin/wavesurfer.cursor.js +29 -49
  3. package/dist/plugin/wavesurfer.cursor.js.map +1 -1
  4. package/dist/plugin/wavesurfer.cursor.min.js +2 -2
  5. package/dist/plugin/wavesurfer.cursor.min.js.map +1 -1
  6. package/dist/plugin/wavesurfer.elan.js +19 -49
  7. package/dist/plugin/wavesurfer.elan.js.map +1 -1
  8. package/dist/plugin/wavesurfer.elan.min.js +1 -1
  9. package/dist/plugin/wavesurfer.elan.min.js.map +1 -1
  10. package/dist/plugin/wavesurfer.markers.js +57 -72
  11. package/dist/plugin/wavesurfer.markers.js.map +1 -1
  12. package/dist/plugin/wavesurfer.markers.min.js +2 -2
  13. package/dist/plugin/wavesurfer.markers.min.js.map +1 -1
  14. package/dist/plugin/wavesurfer.mediasession.js +5 -15
  15. package/dist/plugin/wavesurfer.mediasession.js.map +1 -1
  16. package/dist/plugin/wavesurfer.mediasession.min.js +1 -1
  17. package/dist/plugin/wavesurfer.mediasession.min.js.map +1 -1
  18. package/dist/plugin/wavesurfer.microphone.js +44 -62
  19. package/dist/plugin/wavesurfer.microphone.js.map +1 -1
  20. package/dist/plugin/wavesurfer.microphone.min.js +1 -1
  21. package/dist/plugin/wavesurfer.microphone.min.js.map +1 -1
  22. package/dist/plugin/wavesurfer.minimap.js +16 -68
  23. package/dist/plugin/wavesurfer.minimap.js.map +1 -1
  24. package/dist/plugin/wavesurfer.minimap.min.js +1 -1
  25. package/dist/plugin/wavesurfer.minimap.min.js.map +1 -1
  26. package/dist/plugin/wavesurfer.playhead.js +2 -29
  27. package/dist/plugin/wavesurfer.playhead.js.map +1 -1
  28. package/dist/plugin/wavesurfer.playhead.min.js +1 -1
  29. package/dist/plugin/wavesurfer.playhead.min.js.map +1 -1
  30. package/dist/plugin/wavesurfer.regions.js +98 -252
  31. package/dist/plugin/wavesurfer.regions.js.map +1 -1
  32. package/dist/plugin/wavesurfer.regions.min.js +1 -1
  33. package/dist/plugin/wavesurfer.regions.min.js.map +1 -1
  34. package/dist/plugin/wavesurfer.spectrogram.js +51 -146
  35. package/dist/plugin/wavesurfer.spectrogram.js.map +1 -1
  36. package/dist/plugin/wavesurfer.spectrogram.min.js +1 -1
  37. package/dist/plugin/wavesurfer.spectrogram.min.js.map +1 -1
  38. package/dist/plugin/wavesurfer.timeline.js +42 -85
  39. package/dist/plugin/wavesurfer.timeline.js.map +1 -1
  40. package/dist/plugin/wavesurfer.timeline.min.js +1 -1
  41. package/dist/plugin/wavesurfer.timeline.min.js.map +1 -1
  42. package/dist/wavesurfer-html-init.js +31 -53
  43. package/dist/wavesurfer-html-init.js.map +1 -1
  44. package/dist/wavesurfer-html-init.min.js +1 -1
  45. package/dist/wavesurfer-html-init.min.js.map +1 -1
  46. package/dist/wavesurfer.js +419 -982
  47. package/dist/wavesurfer.js.map +1 -1
  48. package/dist/wavesurfer.min.js +2 -2
  49. package/dist/wavesurfer.min.js.map +1 -1
  50. package/package.json +6 -6
  51. package/src/plugin/cursor/index.js +15 -3
  52. package/src/plugin/markers/index.js +39 -0
  53. package/CHANGES.md +0 -482
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wavesurfer.js",
3
- "version": "6.3.0",
3
+ "version": "6.4.0",
4
4
  "description": "Interactive navigable audio visualization using Web Audio and Canvas",
5
5
  "main": "dist/wavesurfer.js",
6
6
  "directories": {
@@ -55,13 +55,13 @@
55
55
  "visualization"
56
56
  ],
57
57
  "devDependencies": {
58
- "@babel/core": "^7.19.3",
58
+ "@babel/core": "^7.20.2",
59
59
  "@babel/eslint-parser": "^7.19.1",
60
60
  "@babel/plugin-proposal-class-properties": "^7.18.6",
61
- "@babel/preset-env": "^7.19.3",
61
+ "@babel/preset-env": "^7.20.2",
62
62
  "@babel/register": "^7.18.9",
63
63
  "@chiragrupani/karma-chromium-edge-launcher": "^2.2.2",
64
- "babel-loader": "^8.2.5",
64
+ "babel-loader": "^9.1.0",
65
65
  "babel-plugin-add-module-exports": "^1.0.4",
66
66
  "babel-plugin-istanbul": "^6.1.1",
67
67
  "date-fns": "^2.29.3",
@@ -73,10 +73,10 @@
73
73
  "esdoc-ecmascript-proposal-plugin": "^1.0.0",
74
74
  "esdoc-integrate-test-plugin": "^1.0.0",
75
75
  "esdoc-standard-plugin": "^1.0.0",
76
- "eslint": "^8.24.0",
76
+ "eslint": "^8.26.0",
77
77
  "htmlhint": "^1.1.4",
78
78
  "in-publish": "^2.0.1",
79
- "jasmine-core": "^4.4.0",
79
+ "jasmine-core": "^4.5.0",
80
80
  "karma": "^6.4.1",
81
81
  "karma-chrome-launcher": "3.1.1",
82
82
  "karma-coverage": "^2.2.0",
@@ -17,6 +17,7 @@
17
17
  * the cursor follow the x and the y-position of the mouse. Use `false` to make the
18
18
  * it only follow the x-position of the mouse.
19
19
  * @property {function} formatTimeCallback Formats the timestamp on the cursor.
20
+ * @property {boolean} isDestroyCalled true if called destroy before the ready event fired
20
21
  */
21
22
 
22
23
  /**
@@ -140,11 +141,19 @@ export default class CursorPlugin {
140
141
  * @type {?HTMLElement}
141
142
  */
142
143
  this.displayTime = null;
144
+ /**
145
+ * true if call destory before ready event
146
+ * @type {boolean}
147
+ */
148
+ this.isDestroyCalled = false;
143
149
 
144
150
  this.params = Object.assign({}, this.defaultParams, params);
145
151
  }
146
152
 
147
153
  _onReady() {
154
+ if (this.isDestroyCalled) {
155
+ return;
156
+ }
148
157
  this.wrapper = this.wavesurfer.drawer.wrapper;
149
158
  this.cursor = this.util.withOrientation(this.wrapper.appendChild(
150
159
  document.createElement('cursor'),
@@ -237,10 +246,14 @@ export default class CursorPlugin {
237
246
  * Destroy the plugin (used by the Plugin API)
238
247
  */
239
248
  destroy() {
249
+ if (!this.cursorTime || !this.showTime){
250
+ this.isDestroyCalled = true;
251
+ return;
252
+ }
240
253
  if (this.params.showTime) {
241
- this.showTime.remove();
254
+ this.showTime && this.showTime.remove();
242
255
  }
243
- this.cursor.remove();
256
+ this.cursor && this.cursor.remove();
244
257
  this.wrapper.removeEventListener('mousemove', this._onMousemove);
245
258
  if (this.params.hideOnBlur) {
246
259
  this.wrapper.removeEventListener('mouseenter', this._onMouseenter);
@@ -323,7 +336,6 @@ export default class CursorPlugin {
323
336
  */
324
337
  formatTime(cursorTime) {
325
338
  cursorTime = isNaN(cursorTime) ? 0 : cursorTime;
326
-
327
339
  if (this.params.formatTimeCallback) {
328
340
  return this.params.formatTimeCallback(cursorTime);
329
341
  }
@@ -4,6 +4,7 @@
4
4
  * @example wavesurfer.addMarker(regionParams);
5
5
  * @property {number} time The time to set the marker at
6
6
  * @property {?label} string An optional marker label
7
+ * @property {?tooltip} string An optional marker tooltip
7
8
  * @property {?color} string Background color for marker
8
9
  * @property {?position} string "top" or "bottom", defaults to "bottom"
9
10
  * @property {?markerElement} element An HTML element to display instead of the default marker image
@@ -159,6 +160,7 @@ export default class MarkersPlugin {
159
160
  let marker = {
160
161
  time: params.time,
161
162
  label: params.label,
163
+ tooltip: params.tooltip,
162
164
  color: params.color || DEFAULT_FILL_COLOR,
163
165
  position: params.position || DEFAULT_POSITION,
164
166
  draggable: !!params.draggable,
@@ -171,6 +173,8 @@ export default class MarkersPlugin {
171
173
  this.markers.push(marker);
172
174
  this._updateMarkerPositions();
173
175
 
176
+ this._registerEvents();
177
+
174
178
  return marker;
175
179
  }
176
180
 
@@ -199,6 +203,8 @@ export default class MarkersPlugin {
199
203
 
200
204
  this.wrapper.removeChild(marker.el);
201
205
  this.markers.splice(index, 1);
206
+
207
+ this._unregisterEvents();
202
208
  }
203
209
 
204
210
  _createPointerSVG(color, position) {
@@ -231,6 +237,7 @@ export default class MarkersPlugin {
231
237
 
232
238
  _createMarkerElement(marker, markerElement) {
233
239
  let label = marker.label;
240
+ let tooltip = marker.tooltip;
234
241
 
235
242
  const el = document.createElement('marker');
236
243
  el.className = "wavesurfer-marker";
@@ -265,6 +272,7 @@ export default class MarkersPlugin {
265
272
  if ( label ) {
266
273
  const labelEl = document.createElement('span');
267
274
  labelEl.innerText = label;
275
+ labelEl.setAttribute('title', tooltip);
268
276
  this.style(labelEl, {
269
277
  "font-family": "monospace",
270
278
  "font-size": "90%"
@@ -386,6 +394,37 @@ export default class MarkersPlugin {
386
394
  this.wavesurfer.fireEvent("marker-drop", this.selectedMarker, event);
387
395
  }
388
396
 
397
+ _registerEvents() {
398
+ if (!this.markers.find(marker => marker.draggable)) {
399
+ return;
400
+ }
401
+ //we have some draggable markers, check for listeners
402
+ if (!this.onMouseMove) {
403
+ this.onMouseMove = (e) => this._onMouseMove(e);
404
+ window.addEventListener('mousemove', this.onMouseMove);
405
+ }
406
+
407
+ if (!this.onMouseUp) {
408
+ this.onMouseUp = (e) => this._onMouseUp(e);
409
+ window.addEventListener("mouseup", this.onMouseUp);
410
+ }
411
+ }
412
+
413
+ _unregisterEvents() {
414
+ if (this.markers.find(marker => marker.draggable)) {
415
+ return;
416
+ }
417
+ //we don't have any draggable markers, unregister listeners
418
+ if (this.onMouseMove) {
419
+ window.removeEventListener('mousemove', this.onMouseMove);
420
+ this.onMouseMove = null;
421
+ }
422
+ if (this.onMouseUp) {
423
+ window.removeEventListener("mouseup", this.onMouseUp);
424
+ this.onMouseUp = null;
425
+ }
426
+ }
427
+
389
428
  /**
390
429
  * Remove all markers
391
430
  */
package/CHANGES.md DELETED
@@ -1,482 +0,0 @@
1
- wavesurfer.js changelog
2
- =======================
3
-
4
- 6.3.0 (03.10.2022)
5
- ------------------
6
- - Fix `barMinHeight` option not setting the minimum bar height properly (#2522)
7
- - Regions plugin: restore support for one drag selection for all channels (#2529)
8
- - Markers plugin:
9
- - Add support for a context menu event on a marker (#2546)
10
- - Spectrogram plugin: Make labels have position: absolute instead of fixed (#2542)
11
-
12
- 6.2.0 (16.05.2022)
13
- ------------------
14
- - Fix `clientWidth` error in responsive mode (#2498)
15
- - Cursor plugin:
16
- - Fix `TypeError` when `showTime: undefined` (#2501)
17
- - Spectrogram plugin:
18
- - Fix to have consistent CSS height regardless of device pixel ratio (#2507)
19
- - Added `height` configuration option to control CSS height of the view,
20
- which will scale to fill
21
- - Frequency label display is `fixed` instead of `absolute` to enable
22
- consistent size on hi-dpi displays
23
-
24
- 6.1.0 (31.03.2022)
25
- ------------------
26
- - Fix many calls to `setSinkId` resulting in no sound (#2481)
27
- - Optimize responsive resize to avoid unnecessarily firing redraw on unpainted waveforms (#2485)
28
- - Minimap plugin:
29
- - Remove waveform of previous audio when starting to load new audio (#2479)
30
- - Changed regions function name to resolve ambiguities (#2482)
31
-
32
- 6.0.4 (09.03.2022)
33
- ------------------
34
- - Spectrogram plugin:
35
- - Add `frequencyMin`, `frequencyMax` option to scale frequency axis.
36
- And set default 12kHz range to draw spectrogram like 5.x (#2455)
37
- - Timeline plugin:
38
- - Fix rendering issue for negative `offset` values (#2463)
39
-
40
- 6.0.3 (01.03.2022)
41
- ------------------
42
- - Cursor plugin:
43
- - Fix type documentation for `followCursorY` and `opacity` options (#2459)
44
- - Fix destroying cursor and showTime dom nodes (#2460)
45
-
46
- 6.0.2 (20.02.2022)
47
- ------------------
48
- - Fix regression and restore support for passing a `CanvasGradient` to
49
- `setWaveColor()` (#2448)
50
- - Regions plugin:
51
- - Fixed the type annotation of `maxRegions` in the regions plugin (#2454)
52
-
53
- 6.0.1 (13.02.2022)
54
- ------------------
55
- - Fixed a regression that broke bars rendering when using a certain format for
56
- the peaks array (#2439)
57
-
58
- 6.0.0 (07.02.2022)
59
- ------------------
60
- - Add additional type to `waveColor` and `progressColor` parameters to support linear
61
- gradients (#2345)
62
- - Add `hideCursor` option to hide the mouse cursor when hovering over the waveform (#2367)
63
- - Add optional `channelIdx` parameter to `setWaveColor`, `getWaveColor`, `setProgressColor`
64
- and `getProgressColor` methods (#2391)
65
- - Improved drawing waveform with bars, now bars height is the maximum peak value in
66
- range (#2428)
67
- - Workaround for `seekTo` occasionally crashing on Firefox (#1228, #2431)
68
- - Markers plugin: Add the ability to set markers as draggable using param `draggable=true`,
69
- `marker-drag` and `marker-drop` events will be triggered (#2398)
70
- - Regions plugin:
71
- - Increase region z-index to fix stacking inconsistencies (#2353)
72
- - Check `maxLength` before resizing region (#2374)
73
- - Add support for drag selection to be separated for each channel (#2380)
74
- - Allow `formatTimeCallback` from plugin params to be used (#2294)
75
- - Use of default `edgeScrollWidth` value no longer dependent on regions being created via
76
- plugin params (#2401)
77
- - Disable `region-remove` event emission during plugin teardown (#2403)
78
- - Spectrogram plugin:
79
- - Remove inaccurate frequency doubling of spectrogram (#2232)
80
- - Support for `splitChannels` option to draw spectrogram for each channel (#2424)
81
-
82
- 5.2.0 (16.08.2021)
83
- ------------------
84
- - Add `ignoreSilenceMode` option to ignore iOS hardware silence switch when using the
85
- `WebAudio` backend (#1864)
86
- - Fixed unhandled `Failed to execute 'stop' on 'AudioScheduledSourceNode'` error (#1473)
87
- - Fixed unhandled `Cannot read property 'decodeArrayBuffer' of null` error (#2279)
88
- - Timeline plugin: fixed unhandled `null is not an object (evaluating context.canvas)`
89
- error in Safari v14 (#2333)
90
- - Regions plugin: add `direction` and `action` fields to the `region-updated` event
91
- params (#2339)
92
-
93
- 5.1.0 (20.06.2021)
94
- ------------------
95
- - Markers plugin:
96
- - Add the ability to use custom HTML elements in place of the default marker icon by
97
- passing the new `markerElement` parameter to the marker constructor (#2269)
98
- - Custom HTML elements are now centered over the marker line (#2298)
99
- - Trigger `marker-click` event on wavesurfer (#2287)
100
- - Regions plugin: handle rollover cursor bug fix (#2293)
101
- - Timeline plugin: prevent calling `Canvas` context methods on `null` values (#2299)
102
- - Spectrogram plugin: prevent calling `Canvas` context methods on `null` values (#2299)
103
-
104
- 5.0.1 (05.05.2021)
105
- ------------------
106
- - Fix removing DOM element on `destroy()` (#2258)
107
-
108
- 5.0.0 (02.05.2021)
109
- ------------------
110
- - Add new `vertical` parameter enabling displaying waveforms vertically (#2195)
111
- - Fixed `exportPCM()` to return a Promise containing valid JSON data with `noWindow`
112
- (#1896, #1954)
113
- - Nullify `onaudioprocess` on remove to not execute in background (#2218)
114
- - Playhead plugin: add a new plugin that allows the setting of a independent
115
- "play head", or song-start position. (#2209)
116
- - Markers plugin: fix a bug where markers at the end of a track would cause
117
- incorrect click-to-seek behavior (#2208)
118
- - Regions plugin:
119
- - Fix mouseup not firing if click & drag a region handle & release outside the
120
- browser window (#2213)
121
- - Added new `showTooltip` param allowing disabling region `title` tooltip (#2213)
122
-
123
- 4.6.0 (04.03.2021)
124
- ------------------
125
- - Webaudio: fix `decodeAudioData` handling in Safari (#2201)
126
- - Markers plugin: add new plugin that allows for timeline markers (#2196)
127
-
128
- 4.5.0 (14.02.2021)
129
- ------------------
130
- - Split channels: `overlay` param now properly displays a single canvas (#2161)
131
- - Fixed memory leak with `destroy()` in `WebAudio` backend (#1940)
132
- - Fixed `WaveSurfer.load(url)` not working when passing a HTMLMediaElement as
133
- the url parameter, with the WebAudio backend.
134
- - Microphone plugin: remove deprecated `MediaStream.stop` call (#2168)
135
- - Regions plugin: stop region dragging when mouse leaves canvas (#2158)
136
-
137
- 4.4.0 (13.01.2021)
138
- ------------------
139
-
140
- - Use Webpack 5 for build (#2093)
141
- - Fix seeking issues for `WebAudio` backend (#2149)
142
- - Use `splitChannelsOptions` to color wave bars (#2150)
143
-
144
- 4.3.0 (12.12.2020)
145
- ------------------
146
-
147
- - Add `relativeNormalization` option to maintain proportionality between
148
- waveforms when `splitChannels` and `normalize` are `true` (#2108)
149
- - WebAudio backend: set playback rate modifying directly the playback
150
- property of the source node (#2118)
151
- - Spectrogram plugin: Use `ImageData` to draw pixel-by-pixel (#2127)
152
-
153
- 4.2.0 (20.10.2020)
154
- ------------------
155
-
156
- - Fix performance issues with `seekTo` while audio is playing (#2045)
157
- - Trigger `waveform-ready` event when provided peaks are drawn (#2031)
158
-
159
- 4.1.1 (24.09.2020)
160
- ------------------
161
-
162
- - Revert Code cleanup for Observer class (#2069)
163
-
164
- 4.1.0 (16.09.2020)
165
- ------------------
166
-
167
- - Don't call HTMLMediaElement#load when given peaks and preload == 'none'.
168
- Prevents browsers from pre-fetching audio (#1969, #1990)
169
- - `seekTo` bugfix inc. basic unit tests (#2047)
170
- - Fix unhandled `AbortError` thrown during `cancelAjax` (#2063)
171
- - Remove `util.extend`: deprecated since v3.3.0 (#1995)
172
- - Remove `util.ajax`: deprecated since v3.0.0 (#2033)
173
- - Regions plugin:
174
- - Removed `col-resize` cursor when resize is disabled (#1985)
175
- - Improved and unified loop playback logic (#1868)
176
- - Check `minLength` before resizing region (#2001)
177
- - Dragging and resizing will continue outside canvas (#2006)
178
- - `regionsMinLength` parameter to assign a min length to those regions for which the `minLength` is not specified (#2009)
179
- - Revert PR #1926 click propagation on regions. Use event parameter passed
180
- in `region-click` if you need `stopPropagation`. (#2024)
181
- - Edgescroll works for both edges (#2011)
182
- - Microphone plugin: move to separate directory (#1997)
183
- - Minimap plugin: move plugin to separate directory (#1999)
184
- - Cursor plugin: move plugin to separate directory (#1998)
185
- - Elan plugin: move plugin to separate directory (#2019)
186
- - Spectrogram plugin: move to separate directory (#1996)
187
- - Mediasession plugin: move to separate directory (#2020)
188
- - Timeline plugin: move to separate directory (#2018)
189
-
190
- 4.0.1 (23.06.2020)
191
- ------------------
192
-
193
- - Fixes for event handling with certain plugins (regions, microphone).
194
- The crash would have involved '_disabledEventEmissions' (#1975)
195
-
196
- 4.0.0 (21.06.2020)
197
- ------------------
198
-
199
- - Fixed mediaelement-webaudio playback under Safari (#1964)
200
- - Fixed the `destroy` method of the `MediaElementWebAudio` backend. Instead of
201
- destroying only the media element, the audio nodes are disconnected and the
202
- audio context is closed. This was done by splitting the `destroy` method of the
203
- `WebAudio` backend, so it calls the new `destroyWebAudio` method to cancel
204
- everything related to WebAudio (#1927)
205
- - Removed private methods of plugins and generalized plugins' access, so they can be extended creating custom
206
- plugins (#1928)
207
- - Added plugin inheritance example (#1921)
208
- - Added compatibility for Gatsby and other static site generators (#1938)
209
- - Minimap plugin: added the ability to use a customized regions plugin using a new parameter
210
- `regionsPluginName` (#1943)
211
- - Fixed waveform display to not always connect to the sample=0 point (#1942)
212
- - Elan plugin: optional params.tiers (#1910)
213
- - Regions plugin:
214
- - Split `regions.js` into `region.js` (containing `Region` class) and `index.js`.
215
- Both files moved into the `src/plugin/regions` directory. This makes it easier
216
- to extend these classes and use them in custom plugins (#1934)
217
- - Fixed channelCount assignment (#1858)
218
- - Fixed click propagation issue (#1926)
219
- - Fixed switch loop region (#1929)
220
- - Added ability to specify time format for Regions tooltip using timeformatCallback (#1948)
221
- - Add `splitChannelsOptions` param and `setFilteredChannels` method to configure how channels are drawn (#1947)
222
- - Added checks in `minimap` plugin for `drawer` presence (#1953)
223
- - Add `setDisabledEventEmissions` method to optionally disable calls to event handlers for specific events (#1960)
224
- - Drawer: removed private methods to allow overriding them (#1962)
225
- - Add optional `setMute` method to backends to fix muting behavior with the `MediaElement` backend (#1966)
226
-
227
- 3.3.3 (16.04.2020)
228
- ------------------
229
-
230
- - Change default `desynchronized` drawing context attribute to `false` (#1908)
231
-
232
- 3.3.2 (07.04.2020)
233
- ------------------
234
-
235
- - Use `requestAnimationFrame` for clearWave (#1884)
236
- - Fix `Unable to get property 'toLowerCase' of undefined or null reference`
237
- in IE11 (#1771)
238
- - Spectrogram plugin: correct the hamming windfunc formula (#1850)
239
-
240
- 3.3.1 (13.01.2020)
241
- ------------------
242
-
243
- - Regions plugin:
244
- - Improve handles style support (#1839)
245
- - Add support for a context menu event on a region (#1844)
246
- - Fix for handle position when using `channelIdx` param (#1845)
247
-
248
- 3.3.0 (29.12.2019)
249
- ------------------
250
-
251
- - `wavesurfer.exportPCM` now accepts an optional `end` argument and returns
252
- a Promise (#1728)
253
- - Add `wavesurfer.setPlayEnd(position)` to set a point in seconds for
254
- playback to stop at (#1795)
255
- - Add `drawingContextAttributes` option and enable canvas `desynchronized`
256
- hint (#1642)
257
- - Add `barMinHeight` option (#1693)
258
- - Expose progress to the `dblclick` event (#1790)
259
- - Deprecate `util.extend` and replace usage with `Object.assign` (#1825)
260
- - Regions plugin:
261
- - Add `start` argument to `play` and `playLoop` methods (#1794)
262
- - Add `maxRegions` option to limit max numbers of created regions (#1793)
263
- - Don't assign to module object (#1823)
264
- - Allow setting the `handleColor` inside `addRegion` (#1798)
265
- - Disable drag selection before enabling it (#1698)
266
- - Add `channelIdx` option to select specific channel to draw on (#1829)
267
- - Refactor for improved readability (#1826)
268
- - Cursor plugin: fix time visibility (#1802)
269
-
270
- 3.2.0 (24.10.2019)
271
- ------------------
272
-
273
- - New `MediaElementWebAudio` backend (#1767):
274
- - Allows you to use Web Audio API with big audio files, loading audio
275
- like with MediaElement backend (HTML5 audio tag), so you can use the
276
- same methods of MediaElement backend for loading and playback. This way,
277
- the audio resource is not loaded entirely from server, but in ranges,
278
- allowing you to use WebAudio features, like filters, on audio files with
279
- a long duration. You can also supply peaks data, so the entire audio file
280
- does not have to be decoded.
281
- For example:
282
- ```
283
- wavesurfer.load(url | HTMLMediaElement, peaks, preload, duration);
284
- wavesurfer.play();
285
- wavesurfer.setFilter(customFilter);
286
- ```
287
- - Add `barRadius` option to create waveforms with rounded bars (#953)
288
- - Throw error when the url parameter supplied to `wavesurfer.load()`
289
- is empty (#1773, #1775)
290
- - Specify non-minified wavesurfer.js in `main` entry of `package.json` (#1759)
291
- - Add `dblclick` event listener to wavesurfer wrapper (#1764)
292
- - Fix `destroy()` in `MediaElement` backend (#1778)
293
- - Cursor plugin: flip position of time text to left of the cursor where needed
294
- to improve readability (#1776)
295
- - Regions plugin: change region end handler position (#1762, #1781)
296
-
297
- 3.1.0 (26.09.2019)
298
- ------------------
299
-
300
- - Add `autoCenter` and `autoCenterRate` options (#1699)
301
- - Make sure `isReady` is true before firing the `ready` event (#1749)
302
- - Improve fetch error messages (#1748)
303
- - Use `MediaElement` backend for browsers that don't support WebAudio (#1739)
304
- - Regions plugin:
305
- - Use `isResizing` and `isDragging` to filter events in
306
- region-updated listener (#1716)
307
- - Fix `playLoop` and `loop` option for clips with duration <15s (#1626)
308
- - Spectrogram plugin: fix variable name in click handler (#1742)
309
- - Minimap plugin: fix left/width calculations for regions on retina/4k
310
- screens (#1743)
311
- - New example: video-annotation (#1726)
312
-
313
- 3.0.0 (11.07.2019)
314
- ------------------
315
-
316
- - Add `wavesurfer.getActivePlugins()`: return map of plugins
317
- that are currently initialised
318
- - Replace usage of `util.ajax` with `util.fetchFile` (#1365)
319
- - Update progress when seeking with HTML media controls (#1535)
320
- - Make sure mute/volume is updated when using `MediaElement` backend (#1615)
321
- - Refactor `MultiCanvas` and add `CanvasEntry` class (#1617)
322
- - Fix `wavesurfer.isReady`: make it a public boolean, the
323
- broken `isReady` method is removed (#1597)
324
- - Add support for `Blob` output type in `wavesurfer.exportImage` (#1610)
325
- - Fix fallback to Audio Element in browsers that don't support Web Audio (#1614)
326
- - `util.getId()` now accepts a `prefix` argument (#1619)
327
- - Improve documentation for `xhr` option (#1656)
328
- - Fix: the `progressWave` should not be rendered when specifying the same
329
- value for the `progressColor` and `waveColor` options (#1620)
330
- - Cursor plugin:
331
- - Add `formatTimeCallback` option
332
- - Add `followCursorY` option (#1605)
333
- - Remove deprecated `enableCursor` method (#1646)
334
- - Hide the cursor elements before first mouseover if `hideOnBlur` is set (#1663)
335
- - Spectrogram plugin:
336
- - Fix `ready` listener when loading multiple audio files (#1572)
337
- - Allow user to specify a colorMap (#1436)
338
- - Regions plugin:
339
- - Fix `ready` listener when loading multiple audio files (#1602)
340
- - Add `snapToGridInterval` and `snapToGridOffset` options (#1632)
341
- - Allow drawing regions over existing regions, if the underlying ones are not
342
- draggable or resizable (#1633)
343
- - Calculate the duration at event time to allow predefined regions to be
344
- dragged and resized (#1673)
345
- - Remove deprecated `initRegions` method (#1646)
346
- - Timeline plugin: fix `ready` listener when loading multiple
347
- audio files
348
- - Minimap plugin: remove deprecated `initMinimap` method (#1646)
349
-
350
- Check `UPGRADE.md` for backward incompatible changes since v2.x.
351
-
352
- 2.2.1 (18.03.2019)
353
- ------------------
354
-
355
- - Add `backgroundColor` option (#1118)
356
- - Spectrogram plugin: fix click handler (#1585)
357
- - Cursor plugin: fix `displayTime` (#1589)
358
-
359
- 2.2.0 (07.03.2019)
360
- ------------------
361
-
362
- - Add `rtl` option (#1296)
363
- - Fix peaks rendering issue on zooming and scrolling multicanvas (#1570)
364
- - Add `duration` option to specify an explicit audio length (#1441)
365
- - Spectrogram plugin: fix event listener removal (#1571)
366
- - Regions plugin: display regions before file load using `duration`
367
- option (#1441)
368
- - Build: switch to terser-webpack-plugin for minifying
369
-
370
- 2.1.3 (21.01.2019)
371
- ------------------
372
-
373
- - Fix removeOnAudioProcess for Safari (#1215, #1367, #1398)
374
-
375
- 2.1.2 (06.01.2019)
376
- ------------------
377
-
378
- - Fix computing peaks when buffer is not set (#1530)
379
- - Cursor plugin: fix displayed time (#1543)
380
- - Cursor plugin: document new params (#1516)
381
- - Add syntax highlighting in examples (#1522)
382
-
383
- 2.1.1 (18.11.2018)
384
- ------------------
385
-
386
- - Fix order of arguments for PluginClass.constructor (#1472)
387
- - Microphone plugin: Safari support (#1377)
388
- - Minimap plugin: fix styling issues and add support for zooming (#1464)
389
- - Timeline plugin: add duration parameter handling (#1491)
390
- - Cursor plugin: add showTime option (#1143)
391
- - Fix: progress bar did not reach 100% when audio file is small (#1502)
392
-
393
- 2.1.0 (29.09.2018)
394
- ------------------
395
-
396
- - Add wavesurfer.js logo, created by @entonbiba (#1409)
397
- - Library version number is now available as `WaveSurfer.VERSION` (#1430)
398
- - Fix `setSinkId` that used deprecated API (#1428)
399
- - Set `isReady` attribute to false when emptying wavesufer (#1396, #1403)
400
- - Microphone plugin: make it work in MS Edge browser (#627)
401
- - Timeline plugin: display more tick marks as the user zooms in closely (#1455)
402
- - Cursor plugin: fix `destroy` (#1435)
403
-
404
- 2.0.6 (14.06.2018)
405
- ------------------
406
-
407
- - Build library using webpack 4 (#1376)
408
- - Add `audioScriptProcessor` option to use custom script processor node (#1389)
409
- - Added `mute` and `volume` events (#1345)
410
-
411
- 2.0.5 (26.02.2018)
412
- ------------------
413
-
414
- - Fix `util.ajax` on iterating `requestHeaders` (#1329)
415
- - Add version information to distributed files (#1330)
416
- - Regions plugin: prevent click when creating / updating region (#1295)
417
- - Add `wavesurfer.isReady` method (#1333)
418
-
419
- 2.0.4 (14.02.2018)
420
- ------------------
421
-
422
- - Added `xhr` option to configure util.ajax for authorization (#1310, #1038, #1100)
423
- - Fix `setCurrentTime` method (#1292)
424
- - Fix `getScrollX` method: Check bounds when `scrollParent: true` (#1312)
425
- - Minimap plugin: fix initial load, canvas click did not work (#1265)
426
- - Regions plugin: fix dragging a region utside of scrollbar (#430)
427
-
428
- 2.0.3 (22.01.2018)
429
- ------------------
430
-
431
- - Added support for selecting different audio output devices using `setSinkId` (#1293)
432
- - Replace deprecated playbackRate.value setter (#1302)
433
- - Play method now properly returns a Promise (#1229)
434
-
435
- 2.0.2 (10.01.2018)
436
- ------------------
437
-
438
- - Added `barGap` parameter to set the space between bars (#1058)
439
- - Replace deprecated gain.value setter (#1277)
440
- - MediaElement backend: Update progress on pause events (#1267)
441
- - Restore missing MediaSession plugin (#1286)
442
-
443
- 2.0.1 (18.12.2017)
444
- ------------------
445
-
446
- - Core library and the plugins were refactored to be modular so it can be used with a module bundler
447
- - Code updated to ES6/ES7 syntax and is transpiled with babel and webpack
448
- - New plugin API
449
- - `MultiCanvas` renderer is now the default
450
- - Added getters and setters for height and color options (#1145)
451
- - Introduce an option to prevent removing media element on destroy (#1163)
452
- - Added duration parameter for the load function (#1239)
453
- - New soundtouch.js filter to preserve pitch when changing tempo (#149)
454
- - Add `getPlaybackRate` method (#1022)
455
- - Switched to BSD license (#1060)
456
- - Added `setCurrentTime` method
457
- - Added `util.debounce` (#993)
458
-
459
- 1.2.4 (11.11.2016)
460
- ------------------
461
-
462
- - Fix a problem of Web Audio not playing in Safari on initial load (#749)
463
-
464
- 1.2.3 (09.11.2016)
465
- ------------------
466
-
467
- - Add a 'waveform-ready' event, triggered when waveform is drawn with MediaElement backend (#736)
468
- - Add a 'preload' parameter to load function to choose the preload HTML5 audio attribute value if MediaElement backend is choosen (#854)
469
-
470
- 1.2.2 (31.10.2016)
471
- ------------------
472
-
473
- - Deterministic way to mute and unmute a track (#841)
474
- - Replace jasmine with karma / jasmine test suite (#849)
475
- - Regions plugin: fix a bug when clicking on scroll-bar in Firefox (#851)
476
-
477
- 1.2.1 (01.10.2016)
478
- ------------------
479
-
480
- - Added changelog (#824)
481
- - Correct AMD module name for plugins (#831)
482
- - Fix to remove small gaps between regions (#834)