add checked webcam start - only when https...

This commit is contained in:
Roland Schneider 2017-03-07 08:16:12 +01:00
parent 81e2d51e59
commit dda482a338

View File

@ -10,22 +10,30 @@ function Customer(o){
function init(){
defaults = $.extend(defaults,o);
var url = location.href;
var initCamera;
console.info(url);
if ( url.indexOf("https") >= 0){
initCamera = true;
}else if ( url.indexOf("localhost") >= 0 ){
initCamera = true;
}
if ( initCamera ){
Webcam.set({
width: 160,
height: 120,
dest_width: 320,
dest_height: 240,
image_format: 'jpeg',
jpeg_quality: 90,
// force_flash: false,
// flip_horiz: true,
// fps: 45
jpeg_quality: 90
});
Webcam.attach( '#my_camera' );
$("#snap").click(snap);
}else{
$("#snap").hide();
}
preventSubmit( '#customerupdate-replacementcardnumber' );
preventSubmit( '#customercreate-cardnumber' );