YouTube freezes with Safari
Edit: This solution worked only temporarily. In my case, the problem is on-and-off and there is no way to know when it is going to happen.

This exact same thing was happening to me, but in Firefox. This answer from ElementaryOS-SE solved the issue for me. The solution is to basically install the plugin h264ify. From the GitHub page:


  By default, YouTube streams VP8/VP9 encoded video. However, this can cause problems with less powerful machines because VP8/VP9 is not typically hardware accelerated.
  In contrast, H.264 is commonly hardware accelerated by GPUs, which usually means smoother video playback and reduced CPU usage.