Default camera device to show screen instead of physical camera

Solution 1:

Making the browser itself pretend there's a "desktop" camera would be technically possible, but since it would only work with that single browser, it doesn't look like anyone has done this yet. (At least I couldn't find any work for Chrome or Firefox – even though they have 'screen sharing' as a WebRTC feature, nobody seems to have linked it to webcam API yet.)

However, there are products which install a custom device driver that creates a virtual "webcam" device, which is then usable by any program. Your web browser will think you have two webcams; you still need to approve camera requests, and it's still up to you to choose the "preferred" camera.

I googled "virtual camera device" and found several products which can stream the desktop, for example Webcamoid (appears to be multi-platform and open-source), VCam (commercial), OBS VirtualCam (a plugin for OBS).

(For Linux there are two 'generic' drivers, akvcam or the older v4l2loopback, but they still need a program that would provide the actual video data. For Windows and macOS each product most likely uses its own custom drivers.)

Solution 2:

This is not possible, since access to the camera means camera only, as the browser's security and permissions model is pretty tight nowadays.

That is, unless your camera software does screen-sharing (but I haven't yet encountered such software).

If you would like to do screen-streaming, your best tool is VLC.
See this answer of mine for instructions.