A little-known trick in Safari is to get Youtube content into Picture in Picture (PiP) mode.
When you are watching a YouTube video in the browser, right-click on the video window. Then right click somewhere else on the video again, away from the first menu, and you will get a second menu that allows you to get PiP.