Skip to content

Commit

Permalink
add PR goldfire#1707 to fix play after 30 seconds on iOS 14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amcjen committed Feb 21, 2024
1 parent 0c15d3f commit 4dce5a6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/howler.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,17 @@

// If no sound has played after 30 seconds, suspend the context.
self._suspendTimer = setTimeout(function () {
if (!self.autoSuspend) {
if (!self.autoSuspend ) {
return;
}

// Issue #1707: https://github.com/goldfire/howler.js/pull/1707/commits/f8dd3805a58c605f9e5ce1e04d3a3ab146103822
// Fixed the issue of music not playing in iOS 14.0 30s,
// and music can no longer be played after that·
if (self.ctx.state === "suspended") {
return;
}

self._suspendTimer = null;
self.state = "suspending";

Expand Down

0 comments on commit 4dce5a6

Please sign in to comment.