Have you ever searched YouTube and found a song that you love and then keep hitting play over and over? I frequently listen to the same song until my ears bleed because it helps me focus, and I finally got fed up with the whole mess and did some research. It turns out that some clever person has made a wonderful Firefox extension that allows for some extra controls to appear under the video. You can loop the entire video or even choose your own segment, and it even works with Firefox 4.
You can find this extension here: https://addons.mozilla.org/en-us/firefox/addon/youtube-auto-replay-11636/