Picture-in-picture is a new feature in macOS Sierra in which you can send a video to a corner of the screen, where it’ll remain playing “on top” of other windows while you carry on with other tasks in other apps. With online videos played in the web browser picture-in-picture is achieved via right-clicking the video and selecting the option. But it seems you can’t do this on YouTube videos because they have their own right-click menu that blocks Safari’s built-in menu.
YouTube may fix this in future but for the moment you can just right-click the video twice in succession. See the GIF movie below for an example of this.
Update: The PiP Tool extension for Safari is also worth a look. It adds a picture-in-picture icon to the bottom right of YouTube (and other) online video players.