Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera won't open on an actual phone (Android) #30

Open
areebbeigh opened this issue Aug 2, 2018 · 0 comments
Open

Camera won't open on an actual phone (Android) #30

areebbeigh opened this issue Aug 2, 2018 · 0 comments

Comments

@areebbeigh
Copy link

areebbeigh commented Aug 2, 2018

Opening /camera in Chrome on an Android phone produces a DOMException:

CameraView.vue

      navigator.mediaDevices.getUserMedia({ video: true })
        .then(stream => {
          let video = this.$refs.video
          video.srcObject = mediaStream
          video.play()
          //video.onloadedmetadata = x => { video.play() }
          console.log('video stream loaded')
        })
        .catch(err => { console.log(err); throw err })

index.html

    <script>
      (function () {
      var src = '//cdn.jsdelivr.net/npm/eruda';
      document.write('<scr' + 'ipt src="' + src + '"></scr' + 'ipt>');
      document.write('<scr' + 'ipt>eruda.init();</scr' + 'ipt>');})();
    </script>

Modified the code to include Eruda console and throw any errors.

@areebbeigh areebbeigh changed the title Camera won Camera won't open on an actual phone (Android) Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant