Tried
https://www.youtube.com/watch?v=mjjbq_U2kgw using Firefox and enabled "statistics for nerds". Connection speed is monitored continually and current resolution adopts accordingly within a few seconds until optimal resolution is reached. Your observations may differ.
That brings up another factor to consider. I suspect that whatever YT is doing, they're doing it server-side. jAlbum albums can't do that - they're all purely client-side.
Even if you could do something client-side with Javascript, it could be only a quick snapshot upon page loading. Once it had determined that your connection speed was X, and had decided to cough up the
mydog-small.jpg instead of the
mydog-large.jpg file, it would then be too late to do anything about it later. You wouldn't want it repeatedly testing your connection speed and redrawing the page with different versions of the images until things settled down. Finally, connection speed is generally not linear, so that initial snapshot could be wildly wrong (in fact, almost certainly
would be wrong).