Bugzilla – Attachment 106782 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: Simplify code, add msGetUserMedia case
Bug-6815-Simplify-code-add-msGetUserMedia-case.patch (text/plain), 2.77 KB, created by
Mark Tompsett
on 2020-07-11 12:40:17 UTC
(
hide
)
Description:
Bug 6815: Simplify code, add msGetUserMedia case
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2020-07-11 12:40:17 UTC
Size:
2.77 KB
patch
obsolete
>From f7eba2aacd4e9efcbde255262a7b84df4509ecb8 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Sat, 11 Jul 2020 12:39:08 +0000 >Subject: [PATCH] Bug 6815: Simplify code, add msGetUserMedia case > >--- > .../intranet-tmpl/prog/js/pages/patron-webcam.js | 31 +++++++--------------- > 1 file changed, 10 insertions(+), 21 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 ff406b14cc..bead6bb0da 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/patron-webcam.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/patron-webcam.js >@@ -11,6 +11,10 @@ function initializeCamera( camera_form ){ > alert("Cannot load camera interface"); > } > }; >+ navigator.getMedia = ( navigator.getUserMedia || // use the proper vendor prefix >+ navigator.webkitGetUserMedia || >+ navigator.mozGetUserMedia || >+ navigator.msGetUserMedia ); > > // Put video listeners into place > if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { >@@ -23,30 +27,15 @@ function initializeCamera( camera_form ){ > ); > } > /* Legacy code below! */ >- else if (navigator.getUserMedia) { // Standard >- navigator.getUserMedia(mediaConfig, >+ else { >+ navigator.getMedia( >+ mediaConfig, > function(stream) { > video.src = stream; > video.play(); > }, > errBack > ); >- } else if (navigator.webkitGetUserMedia) { // WebKit-prefixed >- navigator.webkitGetUserMedia(mediaConfig, >- function(stream) { >- video.src = window.webkitURL.createObjectURL(stream); >- video.play(); >- }, >- errBack >- ); >- } else if (navigator.mozGetUserMedia) { // Mozilla-prefixed >- navigator.mozGetUserMedia(mediaConfig, >- function(stream) { >- video.src = window.URL.createObjectURL(stream); >- video.play(); >- }, >- errBack >- ); > } > > camera_form.find("#snap").on("click", function(){ >@@ -84,9 +73,9 @@ function initializeCamera( camera_form ){ > } > > navigator.getMedia = ( navigator.getUserMedia || // use the proper vendor prefix >- navigator.webkitGetUserMedia || >- navigator.mozGetUserMedia || >- navigator.msGetUserMedia); >+ navigator.webkitGetUserMedia || >+ navigator.mozGetUserMedia || >+ navigator.msGetUserMedia ); > > var div_take_image = document.getElementById('take_patron_image'); > navigator.getMedia({video: true}, function(stream) { >-- >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