Error in screensharing without Webcam

Hello,
my question is related to screensharing.

when i open my application on devices with Camera/Mic, the screenshare works perfectly, However If i open my app in the machine without mic/camera it doesnt work and shows me, ''accessAllowed: false"

How do i resolve this? Uploaded my code below.