Skip to content

Commit

Permalink
UNLOAD時に念のためsrcを空にする
Browse files Browse the repository at this point in the history
  • Loading branch information
thiramisu committed Jul 27, 2023
1 parent a5a611b commit 2fe01cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/store/audioPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ export const audioPlayerStore = createPartialStore<AudioPlayerStoreTypes>({

UNLOAD_AUDIO_BLOB: {
action({ dispatch }, { blobId }: { blobId?: BlobId }) {
if (blobId === undefined || !audioElements.has(blobId)) {
let audioElement;
if (blobId === undefined || !(audioElement = audioElements.get(blobId))) {
return;
}
dispatch("STOP_AUDIO_BLOB", { blobId });
audioElement.src = "";
audioElements.delete(blobId);
},
},
Expand Down

0 comments on commit 2fe01cb

Please sign in to comment.