Skip to content

Commit

Permalink
feat: put the resume button directly below the iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat committed Jun 8, 2024
1 parent beb9e00 commit 6283923
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/announcement-data/AnnouncementSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,13 @@ export default abstract class AnnouncementSystem {
crunker._context.resume()
button.remove()
}
document.body.appendChild(button)

const container = document.getElementById('resume-audio-container')
if (container) container.appendChild(button)
else 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!",
"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 and pressing the 'Resume audio' button. If this doesn't help, there's nothing else that we can do. Sorry!",
)

button.scrollIntoView()
Expand Down
2 changes: 2 additions & 0 deletions src/components/AmeyLiveTrainAnnouncements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1666,6 +1666,8 @@ export function LiveTrainAnnouncements<SystemKeys extends string>({
/>
</FullScreen>

<div id="resume-audio-container" />

<Logs css={{ marginTop: 16 }} logs={logs} />

<img
Expand Down

0 comments on commit 6283923

Please sign in to comment.