Basic audio operations are performed with audio nodes, which are linked together to form an audio routing graph.
The browser will use the first recognized format.
Then you could reduce volume at Youtube, and for other often visited too-loud sites, but leave it 100% at other sites. The controls attribute adds audio controls, like play, pause, and volume. Too bad Mozilla has not added volume scaling as a per-site preference. Yet, many videos from elsewhere become too soft when scaling it used globally. Still, it provides a volume reduction that not even Youtube will override.
I find the 100% scale too high for almost every video, and I don’t want to change my speaker volumes for videos which makes all other sound events events in Windows too soft. Using media.volume_scale will help by reducing the initial volume, say, down to 50% (0.5), so you aren’t blasting high volume through your speakers. They manage to start their videos at 100% for the control’s volume setting. Youtube somehow (probably via scripting) gets around the HTML volume control setting using Firefox’s fault_volume setting.