fix(frontend): 画面を閉じる直前にAudioContextを閉じるように (#15080)
* fix(frontend): 画面を閉じる直前にAudioContextを閉じるように * Update Changelog * Update CHANGELOG.md --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
parent
ef29130057
commit
791b4500ec
2 changed files with 5 additions and 0 deletions
|
|
@ -93,6 +93,10 @@ export async function loadAudio(url: string, options?: { useCache?: boolean; })
|
|||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
if (ctx == null) {
|
||||
ctx = new AudioContext();
|
||||
|
||||
window.addEventListener('beforeunload', () => {
|
||||
ctx.close();
|
||||
});
|
||||
}
|
||||
if (options?.useCache ?? true) {
|
||||
if (cache.has(url)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue