I don't recall if there was a particular reason for using *before* unload but this event is not emitted for iframes.
Using "unload" instead makes an iframe content script notice it's being destroyed (e.g. because of the overlay it was in being removed) and correctly signals the player being gone.
We did noticed a video in an overlay being removed but not when it was inside of an iframe.