Disabling hardware acceleration fixed that for me, though I found that some webpages, mostly video-related ones freeze when you switch between tabs, so I would really like to see this feature change so I could leave hardware acceleration on.
Though, I'm fairly certain that this is a copyright protection system, if you have hardware acceleration on you also can't stream Netflix on discord, for example, in almost every browser.
But I never had this issue with youtube on other browsers before, so until then I'm using MS Edge to stream youtube videos on discord 😕
The difference tho is that for me the Whole browser is just a black screen, not just the video:
discord screenshot of the alt tabbed browser screenshare
Even when selecting the window to stream, the preview is all black:
previews
Since I have a dual screen setup, I'm always tabbed out of the video window when I'm streaming it on discord so this adds a lot of headache to a simple "watch this cool meme video with your friends" task.