Let me explain my setup.
Currently, I have two HTML5 audio elements, which I'll refer to as Master and Slave.
Both of these elements load the same media file, but the Slave has its audio muted by default.
Each player can control the other (pause, play, scrub, etc).
They both have custom styling and receive duration data from an external JSON file instead of relying on audio.duration
.
While everything functions perfectly, the downside is that the audio file is loaded twice for each song due to server-side authentication complexities.
Is there a way to mimic an audio element without actually using it for the muted player? Perhaps with a setTimeout function or something similar?
I just need to simulate the audio.currentTime
value to update the progress bar, but I'm unsure where to begin. Any advice would be appreciated. Thank you!
EDIT - To clarify, my website operates similarly to Soundcloud, with multiple players (slaves) on screen that can be controlled individually or by the master footer player. All content, except for the Master player, is dynamically loaded via Ajax.