At the moment, some strange behaviour occurs if PiP mode is enabled, and then you click the 'fullscreen' button, or vice versa.
Sometimes it works fine, sometimes the entire page dies and needs to be reloaded.
The easiest way to help avoid this issue would be to detect what state the video is playing (Whether fullscreen, or in PiP) and then disable the button for the other mode while it is active.
I don't know when I'll get more time to work on this, so a pull request would be greatly appreciated. :D