H5 call the local camera to take pictures and how to get the original pictures.

webcam.js has been implemented by someone. Calling navigator.getUserMedia in H5 has been implemented, but the picture drawn with canvas is distorted. Is there any way to directly get the photos taken by the computer"s own camera

?

call camera: navigator.mediaDevices.getUserMedia
Photo: context.drawImage (video, 0,0,480,320);
transfer base64: var img_base64 = canvas.toDataURL ("image/jpeg", 0.5);


I have this content you can come to my home page to see


navigator.getUserMedia
https://developer.mozilla.org.

write widht= "3840" height= "2160"
context.drawImage (video, 0,01920) to canvas on html;
change it to
context.drawImage (video, 0,0,3840);

put two places

{
    video: true
}
Change

to

{
    "video": {width: 3840, height: 2160}
},    
< hr >

there is another solution

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

if you compress
https://developer.mozilla.org.
type pass' image/jpeg'" and then set the appropriate encoderOptions value, or modify the canvas size in the previous code

  • About h5 Wake up app

    I am waking up app with url scheme. the requirement is that if app exists, open app, does not exist, ios jumps to appstore, Android jumps to google play. var nowTime = new Date().valueOf(); setTimeout(function() { var launchTime = new Da...

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9f7e0-1a5e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9f7e0-1a5e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?