-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
Interface Check ReportThis pull request does not change any public interfaces ! |
pal/audio/web/player-web.ts
Outdated
// only state is suspended can involve resume function | ||
if (context.state === 'suspended') { | ||
context.resume().catch((e) => { debug.warn('runContext error', e); }); | ||
} | ||
if (context.state === 'running') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'if' condition needs to be changed to 'else if'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
pal/audio/web/player-web.ts
Outdated
// only state is suspended can involve resume function | ||
if (context.state === 'suspended') { | ||
context.resume().catch((e) => { debug.warn('runContext error', e); }); | ||
} | ||
if (context.state === 'running') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'if' condition needs to be changed to 'else if'.
context.resume().catch((e) => { debug.warn('runContext error', e); }); | ||
// only state is suspended can involve resume function | ||
if (context.state === 'suspended') { | ||
context.resume().catch((e) => { debug.warn('runContext error', e); }); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Re: #17637
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request: