Skip to content

Commit 4dce5a6

Browse files
committed
add PR goldfire#1707 to fix play after 30 seconds on iOS 14.0
1 parent 0c15d3f commit 4dce5a6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/howler.core.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -558,10 +558,17 @@
558558

559559
// If no sound has played after 30 seconds, suspend the context.
560560
self._suspendTimer = setTimeout(function () {
561-
if (!self.autoSuspend) {
561+
if (!self.autoSuspend ) {
562562
return;
563563
}
564564

565+
// Issue #1707: https://github.com/goldfire/howler.js/pull/1707/commits/f8dd3805a58c605f9e5ce1e04d3a3ab146103822
566+
// Fixed the issue of music not playing in iOS 14.0 30s,
567+
// and music can no longer be played after that·
568+
if (self.ctx.state === "suspended") {
569+
return;
570+
}
571+
565572
self._suspendTimer = null;
566573
self.state = "suspending";
567574

0 commit comments

Comments
 (0)