Some Firefox users noticed playback issues on YouTube for several months. These affected high resolution videos only, from 1080p and up. To make matters worse, no clear pattern could be identified.
Some videos played fine, others would stop abruptly when they ran out of buffer.
I solved a lot of performance issues I had with yt playback by disabling Ambient Mode (it’s hidden under cog menu in the player). No clue why, but it was causing massve CPU usage.