forked from nimiq/qr-scanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqr-scanner.min.js.map
1 lines (1 loc) · 21.9 KB
/
qr-scanner.min.js.map
1
{"version":3,"file":"qr-scanner.min.js","sources":["src/qr-scanner.js"],"sourcesContent":["export default class QrScanner {\n /* async */\n static hasCamera() {\n // note that enumerateDevices can always be called and does not prompt the user for permission. However, device\n // labels are only readable if served via https and an active media stream exists or permanent permission is\n // given. That doesn't matter for us though as we don't require labels.\n return navigator.mediaDevices.enumerateDevices()\n .then(devices => devices.some(device => device.kind === 'videoinput'))\n .catch(() => false);\n }\n\n constructor(video, onDecode, defaultFacingMode = 'environment', canvasSize = QrScanner.DEFAULT_CANVAS_SIZE) {\n this.$video = video;\n this.$canvas = document.createElement('canvas');\n this._onDecode = onDecode;\n this._active = false;\n this._paused = false;\n this._defaultFacingMode = defaultFacingMode;\n\n this.$canvas.width = canvasSize;\n this.$canvas.height = canvasSize;\n this._sourceRect = {\n x: 0,\n y: 0,\n width: canvasSize,\n height: canvasSize\n };\n\n this._onCanPlay = this._onCanPlay.bind(this);\n this._onPlay = this._onPlay.bind(this);\n this._onVisibilityChange = this._onVisibilityChange.bind(this);\n\n this.$video.addEventListener('canplay', this._onCanPlay);\n this.$video.addEventListener('play', this._onPlay);\n document.addEventListener('visibilitychange', this._onVisibilityChange);\n\n this._qrWorker = new Worker(QrScanner.WORKER_PATH);\n }\n\n destroy() {\n this.$video.removeEventListener('canplay', this._onCanPlay);\n this.$video.removeEventListener('play', this._onPlay);\n document.removeEventListener('visibilitychange', this._onVisibilityChange);\n\n this.stop();\n this._qrWorker.postMessage({\n type: 'close'\n });\n }\n\n /* async */\n start() {\n if (this._active && !this._paused) {\n return Promise.resolve();\n }\n if (window.location.protocol !== 'https:') {\n // warn but try starting the camera anyways\n console.warn('The camera stream is only accessible if the page is transferred via https.');\n }\n this._active = true;\n this._paused = false;\n if (document.hidden) {\n // camera will be started as soon as tab is in foreground\n return Promise.resolve();\n }\n clearTimeout(this._offTimeout);\n this._offTimeout = null;\n if (this.$video.srcObject) {\n // camera stream already/still set\n this.$video.play();\n return Promise.resolve();\n }\n\n let facingMode = this._defaultFacingMode;\n let alternateFacingMode = this._defaultFacingMode === 'user' ? 'environment' : 'user';\n return this._getCameraStream(this._defaultFacingMode, true)\n .catch(() => {\n return this._getCameraStream(alternateFacingMode, false); // throws if camera is not accessible (e.g. due to not https)\n })\n .then(stream => {\n this.$video.srcObject = stream;\n this._setVideoMirror(facingMode);\n })\n .catch(e => {\n this._active = false;\n throw e;\n });\n }\n\n stop() {\n this.pause();\n this._active = false;\n }\n\n pause() {\n this._paused = true;\n if (!this._active) {\n return;\n }\n this.$video.pause();\n if (this._offTimeout) {\n return;\n }\n this._offTimeout = setTimeout(() => {\n const track = this.$video.srcObject && this.$video.srcObject.getTracks()[0];\n if (!track) return;\n track.stop();\n this.$video.srcObject = null;\n this._offTimeout = null;\n }, 300);\n }\n\n /* async */\n static scanImage(imageOrFileOrUrl, sourceRect=null, worker=null, canvas=null, fixedCanvasSize=false,\n alsoTryWithoutSourceRect=false) {\n let createdNewWorker = false;\n let promise = new Promise((resolve, reject) => {\n if (!worker) {\n worker = new Worker(QrScanner.WORKER_PATH);\n createdNewWorker = true;\n worker.postMessage({ type: 'inversionMode', data: 'both' }); // scan inverted color qr codes too\n }\n let timeout, onMessage, onError;\n onMessage = event => {\n if (event.data.type !== 'qrResult') {\n return;\n }\n worker.removeEventListener('message', onMessage);\n worker.removeEventListener('error', onError);\n clearTimeout(timeout);\n if (event.data.data !== null) {\n resolve(event.data.data);\n } else {\n reject('QR code not found.');\n }\n };\n onError = (e) => {\n worker.removeEventListener('message', onMessage);\n worker.removeEventListener('error', onError);\n clearTimeout(timeout);\n const errorMessage = !e ? 'Unknown Error' : (e.message || e);\n reject('Scanner error: ' + errorMessage);\n };\n worker.addEventListener('message', onMessage);\n worker.addEventListener('error', onError);\n timeout = setTimeout(() => onError('timeout'), 3000);\n QrScanner._loadImage(imageOrFileOrUrl).then(image => {\n const imageData = QrScanner._getImageData(image, sourceRect, canvas, fixedCanvasSize);\n worker.postMessage({\n type: 'decode',\n data: imageData\n }, [imageData.data.buffer]);\n }).catch(onError);\n });\n\n if (sourceRect && alsoTryWithoutSourceRect) {\n promise = promise.catch(() => QrScanner.scanImage(imageOrFileOrUrl, null, worker, canvas, fixedCanvasSize));\n }\n\n promise = promise.finally(() => {\n if (!createdNewWorker) return;\n worker.postMessage({\n type: 'close'\n });\n });\n\n return promise;\n }\n\n setGrayscaleWeights(red, green, blue, useIntegerApproximation = true) {\n this._qrWorker.postMessage({\n type: 'grayscaleWeights',\n data: { red, green, blue, useIntegerApproximation }\n });\n }\n\n setInversionMode(inversionMode) {\n this._qrWorker.postMessage({\n type: 'inversionMode',\n data: inversionMode\n });\n }\n\n _onCanPlay() {\n this._updateSourceRect();\n this.$video.play();\n }\n\n _onPlay() {\n this._updateSourceRect();\n this._scanFrame();\n }\n\n _onVisibilityChange() {\n if (document.hidden) {\n this.pause();\n } else if (this._active) {\n this.start();\n }\n }\n\n _updateSourceRect() {\n const smallestDimension = Math.min(this.$video.videoWidth, this.$video.videoHeight);\n const sourceRectSize = Math.round(2 / 3 * smallestDimension);\n this._sourceRect.width = this._sourceRect.height = sourceRectSize;\n this._sourceRect.x = (this.$video.videoWidth - sourceRectSize) / 2;\n this._sourceRect.y = (this.$video.videoHeight - sourceRectSize) / 2;\n }\n\n _scanFrame() {\n if (!this._active || this.$video.paused || this.$video.ended) return false;\n // using requestAnimationFrame to avoid scanning if tab is in background\n requestAnimationFrame(() => {\n QrScanner.scanImage(this.$video, this._sourceRect, this._qrWorker, this.$canvas, true)\n .then(this._onDecode, error => {\n if (this._active && error !== 'QR code not found.') {\n console.error(error);\n }\n })\n .then(() => this._scanFrame());\n });\n }\n\n _getCameraStream(facingMode, exact = false) {\n const constraintsToTry = [\n {\n width: { min: 1024 }\n },\n {\n width: { min: 768 }\n },\n {},\n ];\n\n if (facingMode) {\n if (exact) {\n facingMode = { exact: facingMode };\n }\n constraintsToTry.forEach(constraint => constraint.facingMode = facingMode);\n }\n\n return this._getMatchingCameraStream(constraintsToTry);\n }\n\n _getMatchingCameraStream(constraintsToTry) {\n if (constraintsToTry.length === 0) {\n return Promise.reject('Camera not found.');\n }\n return navigator.mediaDevices.getUserMedia({\n video: constraintsToTry.shift()\n }).catch(() => this._getMatchingCameraStream(constraintsToTry));\n }\n\n _setVideoMirror(facingMode) {\n // in user facing mode mirror the video to make it easier for the user to position the QR code\n const scaleFactor = facingMode==='user'? -1 : 1;\n this.$video.style.transform = 'scaleX(' + scaleFactor + ')';\n }\n\n static _getImageData(image, sourceRect=null, canvas=null, fixedCanvasSize=false) {\n canvas = canvas || document.createElement('canvas');\n const sourceRectX = sourceRect && sourceRect.x? sourceRect.x : 0;\n const sourceRectY = sourceRect && sourceRect.y? sourceRect.y : 0;\n const sourceRectWidth = sourceRect && sourceRect.width? sourceRect.width : image.width || image.videoWidth;\n const sourceRectHeight = sourceRect && sourceRect.height? sourceRect.height : image.height || image.videoHeight;\n if (!fixedCanvasSize && (canvas.width !== sourceRectWidth || canvas.height !== sourceRectHeight)) {\n canvas.width = sourceRectWidth;\n canvas.height = sourceRectHeight;\n }\n const context = canvas.getContext('2d', { alpha: false });\n context.imageSmoothingEnabled = false; // gives less blurry images\n context.drawImage(image, sourceRectX, sourceRectY, sourceRectWidth, sourceRectHeight, 0, 0, canvas.width, canvas.height);\n return context.getImageData(0, 0, canvas.width, canvas.height);\n }\n\n /* async */\n static _loadImage(imageOrFileOrUrl) {\n if (imageOrFileOrUrl instanceof HTMLCanvasElement || imageOrFileOrUrl instanceof HTMLVideoElement\n || window.ImageBitmap && imageOrFileOrUrl instanceof window.ImageBitmap\n || window.OffscreenCanvas && imageOrFileOrUrl instanceof window.OffscreenCanvas) {\n return Promise.resolve(imageOrFileOrUrl);\n } else if (imageOrFileOrUrl instanceof Image) {\n return QrScanner._awaitImageLoad(imageOrFileOrUrl).then(() => imageOrFileOrUrl);\n } else if (imageOrFileOrUrl instanceof File || imageOrFileOrUrl instanceof URL\n || typeof(imageOrFileOrUrl)==='string') {\n const image = new Image();\n if (imageOrFileOrUrl instanceof File) {\n image.src = URL.createObjectURL(imageOrFileOrUrl);\n } else {\n image.src = imageOrFileOrUrl;\n }\n return QrScanner._awaitImageLoad(image).then(() => {\n if (imageOrFileOrUrl instanceof File) {\n URL.revokeObjectURL(image.src);\n }\n return image;\n });\n } else {\n return Promise.reject('Unsupported image type.');\n }\n }\n\n /* async */\n static _awaitImageLoad(image) {\n return new Promise((resolve, reject) => {\n if (image.complete && image.naturalWidth!==0) {\n // already loaded\n resolve();\n } else {\n let onLoad, onError;\n onLoad = () => {\n image.removeEventListener('load', onLoad);\n image.removeEventListener('error', onError);\n resolve();\n };\n onError = () => {\n image.removeEventListener('load', onLoad);\n image.removeEventListener('error', onError);\n reject('Image load error');\n };\n image.addEventListener('load', onLoad);\n image.addEventListener('error', onError);\n }\n });\n }\n}\nQrScanner.DEFAULT_CANVAS_SIZE = 400;\nQrScanner.WORKER_PATH = 'qr-scanner-worker.min.js';\n"],"names":["QrScanner","navigator","mediaDevices","enumerateDevices","then","devices","some","device","kind","catch","video","onDecode","defaultFacingMode","canvasSize","DEFAULT_CANVAS_SIZE","$video","$canvas","document","createElement","_onDecode","_paused","_active","_defaultFacingMode","width","height","_sourceRect","x","y","_onCanPlay","bind","_onPlay","_onVisibilityChange","addEventListener","_qrWorker","Worker","WORKER_PATH","removeEventListener","stop","postMessage","type","Promise","resolve","window","location","protocol","console","warn","hidden","clearTimeout","_offTimeout","srcObject","play","facingMode","alternateFacingMode","_getCameraStream","stream","_setVideoMirror","e","pause","setTimeout","track","imageOrFileOrUrl","sourceRect","worker","canvas","fixedCanvasSize","alsoTryWithoutSourceRect","createdNewWorker","promise","reject","data","timeout","onMessage","onError","event","_loadImage","image","imageData","buffer","scanImage","finally","red","green","blue","useIntegerApproximation","inversionMode","_updateSourceRect","_scanFrame","start","videoHeight","sourceRectSize","videoWidth","paused","ended","requestAnimationFrame","error","exact","min","constraintsToTry","forEach","constraint","_getMatchingCameraStream","length","getUserMedia","shift","style","transform","sourceRectWidth","sourceRectHeight","alpha","context","imageSmoothingEnabled","drawImage","sourceRectX","sourceRectY","getImageData","HTMLCanvasElement","HTMLVideoElement","ImageBitmap","OffscreenCanvas","Image","_awaitImageLoad","File","URL","src","createObjectURL","revokeObjectURL","complete","naturalWidth","onLoad"],"mappings":"aAAe,KAAMA,EAAN,CAEJ,gBAAS,EAAG,CAIf,MAAOC,UAAAC,aAAAC,iBAAA,EAAAC,KAAA,CACGC,CAAA,EAAWA,CAAAC,KAAA,CAAaC,CAAA,EAA0B,YAA1B,GAAUA,CAAAC,KAAvB,CADd,CAAAC,MAAA,CAEI,EAAA,EAAM,CAAA,CAFV,CAJQ,CASnB,WAAW,CAACC,CAAD,CAAQC,CAAR,CAAkBC,CAAA,CAAoB,aAAtC,CAAqDC,CAAA,CAAab,CAAAc,oBAAlE,CAAiG,CACxG,IAAAC,OAAA,CAAcL,CACd,KAAAM,QAAA,CAAeC,QAAAC,cAAA,CAAuB,QAAvB,CACf,KAAAC,UAAA,CAAiBR,CAEjB,KAAAS,QAAA,CADA,IAAAC,QACA,CADe,CAAA,CAEf,KAAAC,mBAAA,CAA0BV,CAE1B,KAAAI,QAAAO,MAAA,CAAqBV,CACrB,KAAAG,QAAAQ,OAAA,CAAsBX,CACtB,KAAAY,YAAA,CAAmB,CACfC,EAAG,CADY,CAEfC,EAAG,CAFY,CAGfJ,MAAOV,CAHQ,CAIfW,OAAQX,CAJO,CAOnB,KAAAe,WAAA,CAAkB,IAAAA,WAAAC,KAAA,CAAqB,IAArB,CAClB,KAAAC,QAAA,CAAe,IAAAA,QAAAD,KAAA,CAAkB,IAAlB,CACf;IAAAE,oBAAA,CAA2B,IAAAA,oBAAAF,KAAA,CAA8B,IAA9B,CAE3B,KAAAd,OAAAiB,iBAAA,CAA6B,SAA7B,CAAwC,IAAAJ,WAAxC,CACA,KA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