If you're using Safari on the Mac and you like watching YouTube (who doesn't), you can watch your videos in a floating window by using Mac OS's picture in picture mode.
To do so, open any Youtube video, double right click on it and select 'Enter Picture in Picture':
That's it! Now you can move away your Safari window and enjoy your videos over other apps.