add checked webcam start - only when https...
This commit is contained in:
parent
81e2d51e59
commit
dda482a338
@ -8,27 +8,35 @@ function Customer(o){
|
|||||||
init();
|
init();
|
||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
|
|
||||||
defaults = $.extend(defaults,o);
|
defaults = $.extend(defaults,o);
|
||||||
|
var url = location.href;
|
||||||
Webcam.set({
|
var initCamera;
|
||||||
width: 160,
|
console.info(url);
|
||||||
height: 120,
|
if ( url.indexOf("https") >= 0){
|
||||||
dest_width: 320,
|
initCamera = true;
|
||||||
dest_height: 240,
|
}else if ( url.indexOf("localhost") >= 0 ){
|
||||||
image_format: 'jpeg',
|
initCamera = true;
|
||||||
jpeg_quality: 90,
|
}
|
||||||
// force_flash: false,
|
if ( initCamera ){
|
||||||
// flip_horiz: true,
|
Webcam.set({
|
||||||
// fps: 45
|
width: 160,
|
||||||
});
|
height: 120,
|
||||||
|
dest_width: 320,
|
||||||
Webcam.attach( '#my_camera' );
|
dest_height: 240,
|
||||||
|
image_format: 'jpeg',
|
||||||
$("#snap").click(snap);
|
jpeg_quality: 90
|
||||||
|
});
|
||||||
preventSubmit( '#customerupdate-replacementcardnumber' );
|
Webcam.attach( '#my_camera' );
|
||||||
preventSubmit( '#customercreate-cardnumber' );
|
$("#snap").click(snap);
|
||||||
|
}else{
|
||||||
|
$("#snap").hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
preventSubmit( '#customerupdate-replacementcardnumber' );
|
||||||
|
preventSubmit( '#customercreate-cardnumber' );
|
||||||
}
|
}
|
||||||
|
|
||||||
function preventSubmit($selector){
|
function preventSubmit($selector){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user