Bugzilla – Attachment 106793 Details for
Bug 6815
Capture member photo via webcam
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6815: Attempt to detect webcam differently
Bug-6815-Attempt-to-detect-webcam-differently.patch (text/plain), 1.93 KB, created by
Christopher Brannon
on 2020-07-12 00:34:57 UTC
(
hide
)
Description:
Bug 6815: Attempt to detect webcam differently
Filename:
MIME Type:
Creator:
Christopher Brannon
Created:
2020-07-12 00:34:57 UTC
Size:
1.93 KB
patch
obsolete
>From b2ce7330bffdc03e10dabdaeb40641fd3e22882c Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Sat, 11 Jul 2020 04:49:22 +0000 >Subject: [PATCH] Bug 6815: Attempt to detect webcam differently > >--- > .../intranet-tmpl/prog/js/pages/patron-webcam.js | 28 ++++++++++++---------- > 1 file changed, 16 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/patron-webcam.js b/koha-tmpl/intranet-tmpl/prog/js/pages/patron-webcam.js >index 95f9c45e2f..ff406b14cc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/patron-webcam.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/patron-webcam.js >@@ -83,20 +83,24 @@ function initializeCamera( camera_form ){ > }); > } > >-function detectWebcam(callback) { >- let md = navigator.mediaDevices; >- if (!md || !md.enumerateDevices) return callback(false); >- md.enumerateDevices().then(devices => { >- callback(devices.some(device => 'videoinput' === device.kind)); >- }) >-} >+navigator.getMedia = ( navigator.getUserMedia || // use the proper vendor prefix >+ navigator.webkitGetUserMedia || >+ navigator.mozGetUserMedia || >+ navigator.msGetUserMedia); > >-detectWebcam(function(hasWebcam) { >- let div_take_image = document.getElementById('take_patron_image'); >- if (div_take_image) { >- div_take_image.style.display = hasWebcam ? "block" : "none"; >+var div_take_image = document.getElementById('take_patron_image'); >+navigator.getMedia({video: true}, function(stream) { >+ div_take_image.style.display = 'block'; >+ stream.getTracks().forEach(function(track) { >+ if (track.readyState == 'live' && track.kind === 'video') { >+ track.stop(); >+ } >+ }); >+ }, function() { >+ div_take_image.style.display = 'none'; > } >-}); >+); >+ > > $(document).ready(function(){ > $("#trigger-webcam").on("click", function(e){ >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6815
:
22623
|
29613
|
38518
|
91302
|
91303
|
91335
|
99015
|
99016
|
99757
|
106774
|
106775
|
106776
|
106777
|
106782
|
106783
|
106787
|
106788
|
106789
|
106790
|
106791
|
106792
|
106793
|
106794
|
106795
|
106796
|
106797
|
106798
|
106799
|
106800
|
106801
|
106802
|
106803
|
106804
|
106938
|
106939
|
106940
|
131174
|
131554
|
131985
|
131987
|
131988
|
131999
|
132000
|
132001