@vunk/plus 1.3.5 → 1.3.6
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.
|
@@ -3449,7 +3449,6 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3449
3449
|
return new howler.Howl({
|
|
3450
3450
|
src: [url],
|
|
3451
3451
|
html5: true,
|
|
3452
|
-
// 使用HTML5 Audio,对于流媒体很重要
|
|
3453
3452
|
format: ["mp3", "wav", "aac"],
|
|
3454
3453
|
// 事件处理
|
|
3455
3454
|
onplay: () => {
|
|
@@ -3460,6 +3459,12 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3460
3459
|
},
|
|
3461
3460
|
onend: () => {
|
|
3462
3461
|
theData.value.broadcast = Broadcast.ended;
|
|
3462
|
+
setTimeout(() => {
|
|
3463
|
+
if (sound.value) {
|
|
3464
|
+
sound.value.unload();
|
|
3465
|
+
sound.value = null;
|
|
3466
|
+
}
|
|
3467
|
+
}, 400);
|
|
3463
3468
|
props.deferred.resolve(true);
|
|
3464
3469
|
},
|
|
3465
3470
|
onloaderror: (_, error) => {
|
|
@@ -3468,6 +3473,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3468
3473
|
},
|
|
3469
3474
|
onplayerror: (_, error) => {
|
|
3470
3475
|
theData.value.broadcast = Broadcast.failed;
|
|
3476
|
+
console.error("Failed to play audio", error);
|
|
3471
3477
|
props.deferred.reject(error || new Error("Failed to play audio"));
|
|
3472
3478
|
}
|
|
3473
3479
|
});
|