Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat committed Jun 8, 2024
1 parent 10d8c56 commit 5ae5303
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/announcement-data/AnnouncementSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,19 +212,23 @@ export default abstract class AnnouncementSystem {

if (crunker._context.state === 'suspended') {
console.error('[Crunker] Failed to resume audio context')
alert(
"Your device or web browser is refusing to let the website play audio.\n\nThis is especially common on iPhones and iPads. We'd recommend you try using a desktop computer or an alterantive device.\n\nTry scrolling to the bottom of the page and pressing the 'Resume audio' button. If this doesn't help, there's nothing else that we can do. Sorry!",
)

document.getElementById('resume-audio-button')?.remove()

const button = document.createElement('button')
button.textContent = 'Resume audio'
button.id = 'resume-audio-button'
button.style.margin = '16px'
button.onclick = () => {
crunker._context.resume()
button.remove()
}
document.body.appendChild(button)

alert(
"Your device or web browser is refusing to let the website play audio.\n\nThis is especially common on iPhones and iPads. We'd recommend you try using a desktop computer or an alterantive device.\n\nTry scrolling to the bottom of the page and pressing the 'Resume audio' button. If this doesn't help, there's nothing else that we can do. Sorry!",
)

button.scrollIntoView()
}
}
Expand Down

0 comments on commit 5ae5303

Please sign in to comment.