mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
1 line
78 KiB
JSON
1 line
78 KiB
JSON
|
|
{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { r as registerInstance, d as getContext, h, g as getElement } from './core-f86805ad.js';\n\n/**\r\n * MediaStream ImageCapture polyfill\r\n *\r\n * @license\r\n * Copyright 2018 Google Inc.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\nlet ImageCapture = window.ImageCapture;\nif (typeof ImageCapture === 'undefined') {\n ImageCapture = class {\n /**\r\n * TODO https://www.w3.org/TR/image-capture/#constructors\r\n *\r\n * @param {MediaStreamTrack} videoStreamTrack - A MediaStreamTrack of the 'video' kind\r\n */\n constructor(videoStreamTrack) {\n if (videoStreamTrack.kind !== 'video') throw new DOMException('NotSupportedError');\n this._videoStreamTrack = videoStreamTrack;\n if (!('readyState' in this._videoStreamTrack)) {\n // Polyfill for Firefox\n this._videoStreamTrack.readyState = 'live';\n }\n // MediaStream constructor not available until Chrome 55 - https://www.chromestatus.com/feature/5912172546752512\n this._previewStream = new MediaStream([videoStreamTrack]);\n this.videoElement = document.createElement('video');\n this.videoElementPlaying = new Promise(resolve => {\n this.videoElement.addEventListener('playing', resolve);\n });\n if (HTMLMediaElement) {\n this.videoElement.srcObject = this._previewStream; // Safari 11 doesn't allow use of createObjectURL for MediaStream\n } else {\n this.videoElement.src = URL.createObjectURL(this._previewStream);\n }\n this.videoElement.muted = true;\n this.videoElement.setAttribute('playsinline', ''); // Required by Safari on iOS 11. See https://webkit.org/blog/6784\n this.videoElement.play();\n this.canvasElement = document.createElement('canvas');\n // TODO Firefox has https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas\n this.canvas2dContext = this.canvasElement.getContext('2d');\n }\n /**\r\n * https://w3c.github.io/mediacapture-image/index.html#dom-imagecapture-videostreamtrack\r\n * @return {MediaStreamTrack} The MediaStreamTrack passed into the constructor\r\n */\n get videoStreamTrack() {\n return this._videoStreamTrack;\n }\n /**\r\n * Implements https://www.w3.org/TR/image-capture/#dom-imagecapture-getphotocapabilities\r\n * @return {Promise<PhotoCapabilities>} Fulfilled promise with\r\n * [PhotoCapabilities](https://www.w3.org/TR/image-capture/#idl-def-photocapabilities)\r\n * object on success, rejected promise on failure\r\n */\n getPhotoCapabilities() {\n return new Promise(function executorGPC(resolve, reject) {\n // TODO see https://github.com/w3c/mediacapture-image/issues/97\n const MediaSettingsRange = {\n current: 0,\n min: 0,\n max: 0\n };\n resolve({\n exposureCompensation: MediaSettingsRange,\n exposureMode: 'none',\n fillLightMode: ['none'],\n focusMode: 'none',\n imageHeight: MediaSettingsRange,\n imageWidth: MediaSettingsRange,\n iso: MediaSettingsRange,\n redEyeReduction: false,\n whiteBalanceMode: 'none',\n zoom: MediaSettingsRange\n });\n reject(new DOMException('OperationError'));\n });\n }\n /**\r\n * Implements https://www.w3.or
|