Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix safari can not resume the webaudio #17640

Merged
merged 5 commits into from
Oct 15, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pal/audio/web/player-web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@
resolve();
return;
}
context.resume().catch((e) => { debug.warn('runContext error', e); });
if (context.state === 'running') {
// only state is suspended can involve resume function
if (context.state === 'suspended') {
context.resume().catch((e) => { debug.warn('runContext error', e); });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the logic change, will low-end devices be able to play normally?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have test ios 15.7 ios 14.8 and ios 17.5.1, three version of iphone.

}

Check failure on line 101 in pal/audio/web/player-web.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Closing curly brace does not appear on the same line as the subsequent block
else if (context.state === 'running') {
resolve();
return;
}
Expand Down
Loading