DEV Community

Discussion on: Screen Recording in 10 lines of Vanilla JS

Collapse
 
nterol profile image
Nicolas Terol

This is great !
But the method getDisplayMedia can fail. You can see this by wrapping the async call in a try catch bloc and catching the error.
And that's a good thing, it's pretty obvious why this method should be protected. I don't know about Windows, but under Mac you must give it access to your browser from the system and not only the browser. Besides, this method cannot be called programmatically :
Only the user can call it from an html button.

Still a great article ! It's a fantastic tool to play with.