Take two, this time it doesn't brooke everything
This commit is contained in:
parent
440fb9db42
commit
f87fb483c7
1 changed files with 6 additions and 1 deletions
|
@ -19,6 +19,7 @@ const playerGainTweens: Array<{
|
|||
tweens: Between[];
|
||||
}> = [];
|
||||
const loadAbortControllers: AbortController[] = [];
|
||||
const lastObjectURLs: string[] = [];
|
||||
|
||||
type PlayerStateEnum = "playing" | "paused" | "stopped";
|
||||
type PlayerRepeatEnum = "none" | "one" | "all";
|
||||
|
@ -297,7 +298,11 @@ export const load = (
|
|||
|
||||
const playerInstance = await audioEngine.createPlayer(player, objectUrl);
|
||||
|
||||
URL.revokeObjectURL(objectUrl);
|
||||
// Clear the last one out from memory
|
||||
if (typeof lastObjectURLs[player] === "string") {
|
||||
URL.revokeObjectURL(lastObjectURLs[player]);
|
||||
}
|
||||
lastObjectURLs[player] = objectUrl;
|
||||
|
||||
playerInstance.on("loadComplete", (duration) => {
|
||||
console.log("loadComplete");
|
||||
|
|
Loading…
Reference in a new issue