-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
base: v3.8.5
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,7 +95,10 @@ export class AudioContextAgent { | |
resolve(); | ||
return; | ||
} | ||
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); }); | ||
} | ||
if (context.state === 'running') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. ok There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 'if' condition needs to be changed to 'else if'. |
||
resolve(); | ||
return; | ||
|
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.