@checksub_team/peaks_timeline 2.0.0 → 2.0.2
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.
package/package.json
CHANGED
package/peaks.js
CHANGED
|
@@ -14561,7 +14561,7 @@ module.exports = function (Utils, Konva) {
|
|
|
14561
14561
|
return Axis;
|
|
14562
14562
|
}(_dereq_('../utils'), _dereq_('konva'));
|
|
14563
14563
|
},{"../utils":116,"konva":43}],87:[function(_dereq_,module,exports){
|
|
14564
|
-
module.exports = function (Data) {
|
|
14564
|
+
module.exports = function (Data, Utils) {
|
|
14565
14565
|
'use strict';
|
|
14566
14566
|
function DataRetriever(peaks) {
|
|
14567
14567
|
this._peaks = peaks;
|
|
@@ -14607,11 +14607,10 @@ module.exports = function (Data) {
|
|
|
14607
14607
|
throw new Error('HTTP ' + response.status + ': ' + response.statusText);
|
|
14608
14608
|
}
|
|
14609
14609
|
return response.blob();
|
|
14610
|
-
}).catch(function (err) {
|
|
14611
|
-
return later(delay).then(function () {
|
|
14612
|
-
return recur(timesTried + 1, err);
|
|
14613
|
-
});
|
|
14614
14610
|
}).then(function (blob) {
|
|
14611
|
+
if (Utils.isNullOrUndefined(blob)) {
|
|
14612
|
+
throw new Error('Failed to retrieve blob');
|
|
14613
|
+
}
|
|
14615
14614
|
var type = blob.type;
|
|
14616
14615
|
if (type) {
|
|
14617
14616
|
type = type.split('/')[0];
|
|
@@ -14625,13 +14624,17 @@ module.exports = function (Data) {
|
|
|
14625
14624
|
self._peaks.emit('data.retrieved', data, src, url);
|
|
14626
14625
|
});
|
|
14627
14626
|
}
|
|
14627
|
+
}).catch(function (err) {
|
|
14628
|
+
return later(delay).then(function () {
|
|
14629
|
+
return recur(timesTried + 1, err);
|
|
14630
|
+
});
|
|
14628
14631
|
});
|
|
14629
14632
|
}
|
|
14630
14633
|
return recur(0);
|
|
14631
14634
|
};
|
|
14632
14635
|
return DataRetriever;
|
|
14633
|
-
}(_dereq_('./data'));
|
|
14634
|
-
},{"./data":88}],88:[function(_dereq_,module,exports){
|
|
14636
|
+
}(_dereq_('./data'), _dereq_('../utils'));
|
|
14637
|
+
},{"../utils":116,"./data":88}],88:[function(_dereq_,module,exports){
|
|
14635
14638
|
module.exports = function () {
|
|
14636
14639
|
'use strict';
|
|
14637
14640
|
function Data(type, content) {
|
|
@@ -17749,6 +17752,7 @@ module.exports = function (WaveformBuilder, WaveformShape, Loader, Utils, Konva)
|
|
|
17749
17752
|
this._selected = this._source.selected;
|
|
17750
17753
|
this._hovered = false;
|
|
17751
17754
|
this._isDragged = false;
|
|
17755
|
+
this._destroyed = false;
|
|
17752
17756
|
this._previewList = [];
|
|
17753
17757
|
this._previewBuildQueue = new Set();
|
|
17754
17758
|
this._markersGroup = this._createMarkers();
|
|
@@ -18333,6 +18337,9 @@ module.exports = function (WaveformBuilder, WaveformShape, Loader, Utils, Konva)
|
|
|
18333
18337
|
options.dataUri = content;
|
|
18334
18338
|
}
|
|
18335
18339
|
waveformBuilder.init(options, function (err, originalWaveformData) {
|
|
18340
|
+
if (self._destroyed) {
|
|
18341
|
+
return;
|
|
18342
|
+
}
|
|
18336
18343
|
if (err) {
|
|
18337
18344
|
throw err;
|
|
18338
18345
|
}
|
|
@@ -19004,6 +19011,7 @@ module.exports = function (WaveformBuilder, WaveformShape, Loader, Utils, Konva)
|
|
|
19004
19011
|
this._loader = null;
|
|
19005
19012
|
}
|
|
19006
19013
|
this._group.destroy();
|
|
19014
|
+
this._destroyed = true;
|
|
19007
19015
|
};
|
|
19008
19016
|
SourceGroup.getHeights = function (source, peaks) {
|
|
19009
19017
|
var unwrappedHeight = source.binaryHeight && source.previewHeight ? source.binaryHeight + source.previewHeight : peaks.options.lineHeight;
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
define([
|
|
10
|
-
'./data'
|
|
11
|
-
|
|
10
|
+
'./data',
|
|
11
|
+
'../utils'
|
|
12
|
+
], function(Data, Utils) {
|
|
12
13
|
'use strict';
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -84,13 +85,11 @@ define([
|
|
|
84
85
|
|
|
85
86
|
return response.blob();
|
|
86
87
|
})
|
|
87
|
-
.catch(function(err) {
|
|
88
|
-
return later(delay)
|
|
89
|
-
.then(function() {
|
|
90
|
-
return recur(timesTried + 1, err);
|
|
91
|
-
});
|
|
92
|
-
})
|
|
93
88
|
.then(function(blob) {
|
|
89
|
+
if (Utils.isNullOrUndefined(blob)) {
|
|
90
|
+
throw new Error('Failed to retrieve blob');
|
|
91
|
+
}
|
|
92
|
+
|
|
94
93
|
var type = blob.type;
|
|
95
94
|
|
|
96
95
|
if (type) {
|
|
@@ -108,6 +107,12 @@ define([
|
|
|
108
107
|
self._peaks.emit('data.retrieved', data, src, url);
|
|
109
108
|
});
|
|
110
109
|
}
|
|
110
|
+
})
|
|
111
|
+
.catch(function(err) {
|
|
112
|
+
return later(delay)
|
|
113
|
+
.then(function() {
|
|
114
|
+
return recur(timesTried + 1, err);
|
|
115
|
+
});
|
|
111
116
|
});
|
|
112
117
|
}
|
|
113
118
|
|
|
@@ -59,6 +59,7 @@ define([
|
|
|
59
59
|
this._selected = this._source.selected;
|
|
60
60
|
this._hovered = false;
|
|
61
61
|
this._isDragged = false;
|
|
62
|
+
this._destroyed = false;
|
|
62
63
|
|
|
63
64
|
this._previewList = [];
|
|
64
65
|
// internal queue state for async preview creation
|
|
@@ -842,6 +843,10 @@ define([
|
|
|
842
843
|
}
|
|
843
844
|
|
|
844
845
|
waveformBuilder.init(options, function(err, originalWaveformData) {
|
|
846
|
+
if (self._destroyed) {
|
|
847
|
+
return;
|
|
848
|
+
}
|
|
849
|
+
|
|
845
850
|
if (err) {
|
|
846
851
|
throw err;
|
|
847
852
|
}
|
|
@@ -1713,6 +1718,8 @@ define([
|
|
|
1713
1718
|
}
|
|
1714
1719
|
|
|
1715
1720
|
this._group.destroy();
|
|
1721
|
+
|
|
1722
|
+
this._destroyed = true;
|
|
1716
1723
|
};
|
|
1717
1724
|
|
|
1718
1725
|
/**
|
|
@@ -346,7 +346,7 @@ define([
|
|
|
346
346
|
* @param {WaveformBuilderInitCallback} callback
|
|
347
347
|
*/
|
|
348
348
|
|
|
349
|
-
|
|
349
|
+
WaveformBuilder.prototype._buildWaveformDataFromObjectUrl = function(options, callback) {
|
|
350
350
|
var self = this;
|
|
351
351
|
|
|
352
352
|
var webAudioOptions = {
|