I haven't experienced this specifically on YouTube, but you may be talking about the Page Visibility API [0]. I've tried to disable it natively in Firefox and Chrome (without extensions) but with no avail. It can even tell if I switch desktops in i3wm. Here's two demos [1][2]. I'm guessing it's saving $$$ on bandwidth. I just want the option to turn it off.
[0] https://www.w3.org/TR/page-visibility-2/
[1] http://daniemon.com/tech/webapps/page-visibility/
[2] https://testdrive-archive.azurewebsites.net/Performance/Page...