One of the new feature in macOS Sierra is the Picture-to-Picture mode for Safari. First appeared in iPad, Picture-in-Picture allows you to detach a video so that it is always viewable while using other apps.
It is easy to enable Picture-to-Picture mode for YouTube video. First right-click on the video to bring up a menu. Then right-click again on the menu to bring out a different menu. Select “Enter Picture-in-Picture” from the menu.
The video will now detach, and stay on top so that you can watch it while using other apps. You can control the video as usual, and also resize and reposition it on the screen.