@weni/unnnic-system 2.33.1 → 2.33.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/CHANGELOG.md +6 -0
- package/dist/{es-2722d018.mjs → es-f822faea.mjs} +1 -1
- package/dist/{index-dc398afb.mjs → index-e05dc7a3.mjs} +8 -6
- package/dist/{pt-br-26267027.mjs → pt-br-9c97dbfc.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +1 -1
- package/dist/unnnic.umd.js +1 -1
- package/package.json +1 -1
- package/src/components/AudioRecorder/AudioRecorder.vue +9 -3
package/package.json
CHANGED
|
@@ -202,7 +202,7 @@ export default {
|
|
|
202
202
|
? blob
|
|
203
203
|
: window.URL.createObjectURL(blob);
|
|
204
204
|
|
|
205
|
-
return durationPromisse;
|
|
205
|
+
return durationPromisse.catch(() => 0); // Return 0 if there's an error
|
|
206
206
|
},
|
|
207
207
|
|
|
208
208
|
// entry point; accessed by external components
|
|
@@ -256,7 +256,7 @@ export default {
|
|
|
256
256
|
return;
|
|
257
257
|
}
|
|
258
258
|
this.audio.currentTime = 0;
|
|
259
|
-
this.duration = this.audio.duration;
|
|
259
|
+
this.duration = isNaN(this.audio.duration) ? 0 : this.audio.duration;
|
|
260
260
|
};
|
|
261
261
|
|
|
262
262
|
this.audio.addEventListener('loadeddata', setDuration);
|
|
@@ -273,7 +273,9 @@ export default {
|
|
|
273
273
|
this.audio.addEventListener('timeupdate', () => {
|
|
274
274
|
if (this.status !== 'playing') return;
|
|
275
275
|
|
|
276
|
-
this.currentTime = this.audio.currentTime
|
|
276
|
+
this.currentTime = isNaN(this.audio.currentTime)
|
|
277
|
+
? 0
|
|
278
|
+
: this.audio.currentTime;
|
|
277
279
|
});
|
|
278
280
|
|
|
279
281
|
this.audio.addEventListener('ended', () => {
|
|
@@ -360,6 +362,10 @@ export default {
|
|
|
360
362
|
numberToTimeString(time) {
|
|
361
363
|
const { isRecording } = this;
|
|
362
364
|
|
|
365
|
+
if (isNaN(time)) {
|
|
366
|
+
return isRecording ? '00:00:00' : '00:00';
|
|
367
|
+
}
|
|
368
|
+
|
|
363
369
|
function formatNumber(number, decimals = 2) {
|
|
364
370
|
return number.toString().padStart(decimals, '0');
|
|
365
371
|
}
|