Can html5 camera inputs work on windows 10 tablets?

TL DR

Can html5 camera inputs work on windows 10 tablets?

More details

  • Device: Dell Venue 8 Pro Tablet
  • OS: Windows 10
  • Browser: Chrome

Customization

Create and host a page with the following html and open in Chrome:

<input type="file" accept="image/*" capture="camera">

Make sure Windows 10 allows apps to use the camera.

Problem

Pressing the input does not start the camera. Instead, it launches a file browser.

Study

The above code works great on Android and iOS devices.

I connected the javascript library of the webcam that works on the Win10 tablet. My suspicion is that Windows does not recognize the built-in camera as a camera just like Android / iOS, and instead considers it to be a web camera (since mobile Windows 10 is essentially just desktop Windows 10 in a smaller form factor)

Help

- html5 Windows 10? -.

+4
1

: https://developers.google.com/web/fundamentals/native-hardware/capturing-images/

<input type="file" accept="image/*" capture>
. . Safari iOS , , -; Android -.

JavaScript, onchange .

, API Image Capture, : https://developers.google.com/web/updates/2016/12/imagecapture ,

, : HTTP VS HTTPS google chrome HTTP

Google Chrome HTTPS Google Chrome, , - , HTTPS. ( localhost), " ", HTTPS-.

, , localhost,

Windows , ( HTTPS localhost) ,

<video autoplay></video>
<script>
const constraints = {
          video: true
};
const video = document.querySelector('video');
function handleSuccess(stream) {
   video.srcObject = stream;
}
function handleError(error) {
console.error('Reeeejected!', error);
}
navigator.mediaDevices.getUserMedia(constraints).
then(handleSuccess).catch(handleError);
</script>

https://www.html5rocks.com/en/tutorials/getusermedia/intro/

-1

Source: https://habr.com/ru/post/1670940/


All Articles