mirror of
https://github.com/galacean/engine.git
synced 2026-06-03 09:14:01 +08:00
@@ -10,6 +10,14 @@ export class AudioManager {
|
||||
private static _resumePromise: Promise<void> = null;
|
||||
private static _needsUserGestureResume = false;
|
||||
|
||||
/**
|
||||
* Suspend the audio context.
|
||||
* @returns A promise that resolves when the audio context is suspended
|
||||
*/
|
||||
static suspend(): Promise<void> {
|
||||
return AudioManager._context.suspend();
|
||||
}
|
||||
|
||||
/**
|
||||
* Resume the audio context.
|
||||
* @remarks On iOS Safari, calling this within a user gesture (e.g., click/touch event handler) can pre-unlock audio and reduce playback delay.
|
||||
|
||||
Reference in New Issue
Block a user