Closed alexmcn closed 1 year ago
That's an interesting requirement. I came up with an idea but haven't tried it, you may try it out and let me know if it works:
In Player 1: Set src
as usual, save audio
ref to the global scope (or React context)
window.audioSrc = player1Ref.current.audio.current
In Player 2: Set an empty src
, and set the audio
ref to the same as Player 1
player2Ref.current.audio.current = window.audioSrc
Thanks for the advice.
I have tried this and it works perfectly.
We have a requirement to have a player on a web page but also have another 'sticky player' which remains in view as the web page is scrolled. They both need to control (play, pause) the same audio and have the duration and progress bars synchronised.
Is this possible? Thank you