Skip to content

Commit

Permalink
Fixed in memory object
Browse files Browse the repository at this point in the history
Signed-off-by: Toomore Chiang <toomore@ocf.tw>
  • Loading branch information
toomore committed Dec 19, 2024
1 parent 5df63ac commit 8e39911
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bioerosion-album.html
Original file line number Diff line number Diff line change
Expand Up @@ -974,11 +974,14 @@
},
]);

function allstop() {
function allstop(org_track) {
tracks.forEach((track) => {
if (track && track.audio && track.status == "play") {
track.audio.pause();
track.status = "pause";
if (track != org_track) {
track.audio.pause();
track.status = "no";
track.audio = null;
}
}
});
}
Expand All @@ -991,7 +994,7 @@
},
methods: {
play($event, track) {
allstop();
allstop(track);
if (tracks[track].audio === null) {
tracks[track].audio = new Audio(tracks[track].src);
}
Expand Down

0 comments on commit 8e39911

Please sign in to comment.