Abhijit Jadhav
Abhijit Jadhav

Reputation: 174

Automatically access the camera without asking for permission

I am using Media Recorder to record the video and audio from the camera. Each time I start recording It asks for the permissions.

Is it possible to automatically take the user access to the camera.

I am using the below code to get the camera access.

 navigator.getMedia = (navigator.getUserMedia ||
          navigator.webkitGetUserMedia ||
          navigator.mozGetUserMedia ||
          navigator.msGetUserMedia);


  if (!navigator.getMedia) {
      displayErrorMessage("Your browser doesn't have support for the navigator.getUserMedia interface.");
  } else {

      // Request the camera.
      navigator.getMedia(
              constraints,
              // Success Callback
                      function (stream) {

}

Upvotes: -4

Views: 6130

Answers (2)

iftach barshem
iftach barshem

Reputation: 527

It is possible on the mobile web! y asking the browser to pick up a file from the file browser, at the mobile web the browser usually uses the camera to do it. See https://austingil.com/html-capture-attribute/ for more details.

Upvotes: 0

Alfeardo
Alfeardo

Reputation: 29

This is not possible to do , and considered as violating the user privacy , most of browsers / devices would ask for the user to allow accessing into camera.

this page explains how to do this but it will ask for the user permission to allow cam view

however , the only way you can do that by using internet explorer browser through ActiveX libraries

in addition , there could be a way to achieve this by tricking the user once he visit your website and ask him directly that this website might getting full access / control to the PC without specifying the camera message which again against rules and will be considered as violating users privacy .

Upvotes: 2

Related Questions