Camera use confirmation












-1















I wan't to remove users choice when he is asked for allowing camera in browser if he don't allow it. Is there possibility of doing it, or to ask him again about it? I can't find a way of triggering it unless i refresh my page.










share|improve this question























  • Your question lacks context, and previous attempts

    – Ahmad
    Nov 20 '18 at 10:05











  • So do you want to remove the choice? Or ask them again? I don't understand.

    – Chris G
    Nov 20 '18 at 10:12


















-1















I wan't to remove users choice when he is asked for allowing camera in browser if he don't allow it. Is there possibility of doing it, or to ask him again about it? I can't find a way of triggering it unless i refresh my page.










share|improve this question























  • Your question lacks context, and previous attempts

    – Ahmad
    Nov 20 '18 at 10:05











  • So do you want to remove the choice? Or ask them again? I don't understand.

    – Chris G
    Nov 20 '18 at 10:12
















-1












-1








-1








I wan't to remove users choice when he is asked for allowing camera in browser if he don't allow it. Is there possibility of doing it, or to ask him again about it? I can't find a way of triggering it unless i refresh my page.










share|improve this question














I wan't to remove users choice when he is asked for allowing camera in browser if he don't allow it. Is there possibility of doing it, or to ask him again about it? I can't find a way of triggering it unless i refresh my page.







javascript camera






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 20 '18 at 10:04









JackyJacky

77




77













  • Your question lacks context, and previous attempts

    – Ahmad
    Nov 20 '18 at 10:05











  • So do you want to remove the choice? Or ask them again? I don't understand.

    – Chris G
    Nov 20 '18 at 10:12





















  • Your question lacks context, and previous attempts

    – Ahmad
    Nov 20 '18 at 10:05











  • So do you want to remove the choice? Or ask them again? I don't understand.

    – Chris G
    Nov 20 '18 at 10:12



















Your question lacks context, and previous attempts

– Ahmad
Nov 20 '18 at 10:05





Your question lacks context, and previous attempts

– Ahmad
Nov 20 '18 at 10:05













So do you want to remove the choice? Or ask them again? I don't understand.

– Chris G
Nov 20 '18 at 10:12







So do you want to remove the choice? Or ask them again? I don't understand.

– Chris G
Nov 20 '18 at 10:12














2 Answers
2






active

oldest

votes


















0














        function initializeMedia() {
if(!('mediaDevices' in navigator)) {
navigator.mediaDevices = {};
}

if(!('getUserMedia' in navigator.mediaDevices)){
//polyfil
navigator.mediaDevices.getUserMedia = function(constraints) {
const getUserMedia = navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia ||
navigator.msGetUserMedia;

if(!getUserMedia) {
return Promise.reject(new Error('getUserMedia is not implemented'))
}

return new Promise(resolve, reject => {
getUserMedia.call(navigator, constraints, resolve, reject);
})
}
}

navigator.mediaDevices.getUserMedia({video: true}).then(stream => {
videoPlayer.srcObject = stream;
videoPlayer.style.display = "block";
}).catch(err => console.log(err))

}
this is method, i can catch it if it's not allowed, and inside i would tell to forget users choice of not allowing it. Or if there is another way to do that





share|improve this answer































    0














    Simply put: No, you can't remove or suppress the choice the user has.



    At least me (and I guess most other visitors) would instantly leave your page/app and never use it again if you would have the possibility to revoke the choices I as a user make on my own machine. And the chances for browser vendors to allow it are really really small, because users will stop using the browser if they'd allow it.



    Almost the same goes for constantly asking the user over and over again. Most users simply won't visit your page ever again if you keep asking them. In case you are going to build some application, users most likely will stop using it.






    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53390541%2fcamera-use-confirmation%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














              function initializeMedia() {
      if(!('mediaDevices' in navigator)) {
      navigator.mediaDevices = {};
      }

      if(!('getUserMedia' in navigator.mediaDevices)){
      //polyfil
      navigator.mediaDevices.getUserMedia = function(constraints) {
      const getUserMedia = navigator.getUserMedia ||
      navigator.webkitGetUserMedia ||
      navigator.mozGetUserMedia ||
      navigator.msGetUserMedia;

      if(!getUserMedia) {
      return Promise.reject(new Error('getUserMedia is not implemented'))
      }

      return new Promise(resolve, reject => {
      getUserMedia.call(navigator, constraints, resolve, reject);
      })
      }
      }

      navigator.mediaDevices.getUserMedia({video: true}).then(stream => {
      videoPlayer.srcObject = stream;
      videoPlayer.style.display = "block";
      }).catch(err => console.log(err))

      }
      this is method, i can catch it if it's not allowed, and inside i would tell to forget users choice of not allowing it. Or if there is another way to do that





      share|improve this answer




























        0














                function initializeMedia() {
        if(!('mediaDevices' in navigator)) {
        navigator.mediaDevices = {};
        }

        if(!('getUserMedia' in navigator.mediaDevices)){
        //polyfil
        navigator.mediaDevices.getUserMedia = function(constraints) {
        const getUserMedia = navigator.getUserMedia ||
        navigator.webkitGetUserMedia ||
        navigator.mozGetUserMedia ||
        navigator.msGetUserMedia;

        if(!getUserMedia) {
        return Promise.reject(new Error('getUserMedia is not implemented'))
        }

        return new Promise(resolve, reject => {
        getUserMedia.call(navigator, constraints, resolve, reject);
        })
        }
        }

        navigator.mediaDevices.getUserMedia({video: true}).then(stream => {
        videoPlayer.srcObject = stream;
        videoPlayer.style.display = "block";
        }).catch(err => console.log(err))

        }
        this is method, i can catch it if it's not allowed, and inside i would tell to forget users choice of not allowing it. Or if there is another way to do that





        share|improve this answer


























          0












          0








          0







                  function initializeMedia() {
          if(!('mediaDevices' in navigator)) {
          navigator.mediaDevices = {};
          }

          if(!('getUserMedia' in navigator.mediaDevices)){
          //polyfil
          navigator.mediaDevices.getUserMedia = function(constraints) {
          const getUserMedia = navigator.getUserMedia ||
          navigator.webkitGetUserMedia ||
          navigator.mozGetUserMedia ||
          navigator.msGetUserMedia;

          if(!getUserMedia) {
          return Promise.reject(new Error('getUserMedia is not implemented'))
          }

          return new Promise(resolve, reject => {
          getUserMedia.call(navigator, constraints, resolve, reject);
          })
          }
          }

          navigator.mediaDevices.getUserMedia({video: true}).then(stream => {
          videoPlayer.srcObject = stream;
          videoPlayer.style.display = "block";
          }).catch(err => console.log(err))

          }
          this is method, i can catch it if it's not allowed, and inside i would tell to forget users choice of not allowing it. Or if there is another way to do that





          share|improve this answer













                  function initializeMedia() {
          if(!('mediaDevices' in navigator)) {
          navigator.mediaDevices = {};
          }

          if(!('getUserMedia' in navigator.mediaDevices)){
          //polyfil
          navigator.mediaDevices.getUserMedia = function(constraints) {
          const getUserMedia = navigator.getUserMedia ||
          navigator.webkitGetUserMedia ||
          navigator.mozGetUserMedia ||
          navigator.msGetUserMedia;

          if(!getUserMedia) {
          return Promise.reject(new Error('getUserMedia is not implemented'))
          }

          return new Promise(resolve, reject => {
          getUserMedia.call(navigator, constraints, resolve, reject);
          })
          }
          }

          navigator.mediaDevices.getUserMedia({video: true}).then(stream => {
          videoPlayer.srcObject = stream;
          videoPlayer.style.display = "block";
          }).catch(err => console.log(err))

          }
          this is method, i can catch it if it's not allowed, and inside i would tell to forget users choice of not allowing it. Or if there is another way to do that






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 20 '18 at 10:37









          JackyJacky

          77




          77

























              0














              Simply put: No, you can't remove or suppress the choice the user has.



              At least me (and I guess most other visitors) would instantly leave your page/app and never use it again if you would have the possibility to revoke the choices I as a user make on my own machine. And the chances for browser vendors to allow it are really really small, because users will stop using the browser if they'd allow it.



              Almost the same goes for constantly asking the user over and over again. Most users simply won't visit your page ever again if you keep asking them. In case you are going to build some application, users most likely will stop using it.






              share|improve this answer




























                0














                Simply put: No, you can't remove or suppress the choice the user has.



                At least me (and I guess most other visitors) would instantly leave your page/app and never use it again if you would have the possibility to revoke the choices I as a user make on my own machine. And the chances for browser vendors to allow it are really really small, because users will stop using the browser if they'd allow it.



                Almost the same goes for constantly asking the user over and over again. Most users simply won't visit your page ever again if you keep asking them. In case you are going to build some application, users most likely will stop using it.






                share|improve this answer


























                  0












                  0








                  0







                  Simply put: No, you can't remove or suppress the choice the user has.



                  At least me (and I guess most other visitors) would instantly leave your page/app and never use it again if you would have the possibility to revoke the choices I as a user make on my own machine. And the chances for browser vendors to allow it are really really small, because users will stop using the browser if they'd allow it.



                  Almost the same goes for constantly asking the user over and over again. Most users simply won't visit your page ever again if you keep asking them. In case you are going to build some application, users most likely will stop using it.






                  share|improve this answer













                  Simply put: No, you can't remove or suppress the choice the user has.



                  At least me (and I guess most other visitors) would instantly leave your page/app and never use it again if you would have the possibility to revoke the choices I as a user make on my own machine. And the chances for browser vendors to allow it are really really small, because users will stop using the browser if they'd allow it.



                  Almost the same goes for constantly asking the user over and over again. Most users simply won't visit your page ever again if you keep asking them. In case you are going to build some application, users most likely will stop using it.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 20 '18 at 12:36









                  DavidDavid

                  62015




                  62015






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53390541%2fcamera-use-confirmation%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      MongoDB - Not Authorized To Execute Command

                      How to fix TextFormField cause rebuild widget in Flutter

                      in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith