I tried to take a screenshot of a movie on the Disney+ web app when I realised that the video turns black as soon as I try to take a new screenshot with Snipping Tool. When I tried to do the same thing with OBS and Discord streams, I saw the same effect.
Interestingly, this only works for Chrome on my machine (I also tried Firefox and Edge and they just let me record my screen).
When I saw this, I became really curious on how they achieved this. Does anyone have any idea how I can recreate this for my own web projects?
I became really curious on how they achieved this.
It's also used by Netflix, Hulu and others.
Widevine is Google's DRM system that's baked-in to Chrome.
It's just a standard HTML5 <video>
element - when the browser downloads the video stream it will see that it's encrypted with Widevine and that engages the Widevine client-side code which does all the DRM biz.
On Windows, I understand (though unconfirmed) that Widevine makes use of SetWindowDisplayAffinity
to block screenshots.
Has anyone any idea how I can recreate this for my own web projects?
You'll need to license Widevine yourself. This is a complicated process intended only for large media production companies and content rightsholders, not individuals or small businesses.
Anyway, even if you could, please don't. Why would you want to make to harder for users to share and appreciate your media? Just stick it up on YouTube instead.