Skip to content

Commit

Permalink
Merge pull request #334 from BloomBooks/BL14017_AudioPlayers
Browse files Browse the repository at this point in the history
fix: Don't keep adding audio players for activity sounds (BL-14017)
  • Loading branch information
hatton authored Oct 29, 2024
2 parents 335496d + 98a92b2 commit bc80999
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/activities/ActivityContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ export class ActivityContext {
}

private getPagePlayer(): any {
let player = document.querySelector("#activity-sound-player") as any;
let player = document.getElementById("activity-sound-player") as any;
if (player && !player.play) {
player.remove();
player = null;
}
if (!player) {
player = document.createElement("audio");
player.setAttribute("id", "#activity-sound-player");
player.setAttribute("id", "activity-sound-player");
document.body.appendChild(player);
}
return player;
Expand Down

0 comments on commit bc80999

Please sign in to comment.