Nice experiment, I thought to try it with YouTube as well, but so far I did it only with audio files on mobile. Would you be able to get more data from YouTube audio?
This is what I made:
https://biim-games.itch.io/galassia-audio-player
Viewing post in Construct 3 + YouTube embed beat sync experiment comments
I’m pretty sure that grabbing only the audio stream from a YouTube video (especially without a subscription) is a bit of a grey area at least (or it might break ToS, not sure). YT-DLP does it, NewPipe on Android does it (it allows video/audio downloads, playing with locked screen, etc), but I’m not aware of a solution that does it in a browser with purely client side JS. Then again, if you’re making an Android app, there’s probably a way to hack together a Cordova plugin that grabs the audio stream and passes the URL to the JS runtime. NewPipe is open source, so you can probably check out how it does it.