cty-mui-core 1.0.27 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/camera.js +2 -2
- package/components/device-info.js +7 -3
- package/components/image-picker.js +11 -9
- package/components/video-capture.js +2 -2
- package/dist/cjs/{audio-recorder-BKbTidei.js → audio-recorder-DYpLmmqT.js} +1 -1
- package/dist/cjs/cty-camera-photo.cjs.entry.js +2 -2
- package/dist/cjs/cty-camera_2.cjs.entry.js +4 -4
- package/dist/cjs/cty-canvas-video.cjs.entry.js +1 -1
- package/dist/cjs/cty-keyboard.cjs.entry.js +1 -1
- package/dist/cjs/cty-media-capture.cjs.entry.js +2 -2
- package/dist/cjs/cty-record.cjs.entry.js +2 -2
- package/dist/cjs/cty-share-sheet.cjs.entry.js +2 -2
- package/dist/cjs/cty-video.cjs.entry.js +1 -1
- package/dist/cjs/{device-info-C7UUXx-P.js → device-info-CC9Tsjk3.js} +7 -3
- package/dist/cjs/{image-picker-B6UWcLwS.js → image-picker-BaPYPMtN.js} +12 -10
- package/dist/cjs/index.cjs.js +5 -5
- package/dist/cjs/{share-C5S5TwgG.js → share-DjeE75QU.js} +1 -1
- package/dist/cjs/{video-capture-DAMSxk8m.js → video-capture-hurwVr0S.js} +3 -3
- package/dist/collection/components/camera/camera.js +2 -2
- package/dist/collection/utils/native/image-picker.js +11 -9
- package/dist/collection/utils/native/utils.js +7 -3
- package/dist/collection/utils/native/video-capture.js +2 -2
- package/dist/cty-mui/cty-mui.esm.js +1 -1
- package/dist/cty-mui/index.esm.js +1 -1
- package/dist/cty-mui/{p-0bc85558.entry.js → p-031c8494.entry.js} +1 -1
- package/dist/cty-mui/p-16a037a8.system.entry.js +1 -0
- package/dist/cty-mui/{p-0f32ebdb.system.entry.js → p-3440db23.system.entry.js} +1 -1
- package/dist/cty-mui/{p-7fee7137.system.entry.js → p-3a5c607b.system.entry.js} +1 -1
- package/dist/cty-mui/{p-f2a68731.entry.js → p-3f5a1b19.entry.js} +1 -1
- package/dist/cty-mui/{p-f846e924.system.entry.js → p-417821f8.system.entry.js} +1 -1
- package/dist/cty-mui/{p-53e5d520.system.entry.js → p-4480bc91.system.entry.js} +1 -1
- package/dist/cty-mui/p-468wbiwD.js +1 -0
- package/dist/cty-mui/{p-c5ed5fc1.system.entry.js → p-539f0f1d.system.entry.js} +1 -1
- package/dist/cty-mui/{p-10d7700f.system.entry.js → p-53c2f016.system.entry.js} +1 -1
- package/dist/cty-mui/{p-35bf1c7d.system.entry.js → p-5c614543.system.entry.js} +1 -1
- package/dist/cty-mui/{p-e66554bd.entry.js → p-707d8d55.entry.js} +1 -1
- package/dist/cty-mui/p-8b366f50.entry.js +1 -0
- package/dist/cty-mui/p-C74UJkmU.js +1 -0
- package/dist/cty-mui/{p-DM51Z91U.js → p-CNbcMFk_.js} +1 -1
- package/dist/cty-mui/p-CWqY9Xtf.system.js +1 -0
- package/dist/cty-mui/{p-CSK0Pbxf.system.js → p-C_A8vR45.system.js} +1 -1
- package/dist/cty-mui/p-Cegbc1c7.system.js +1 -1
- package/dist/cty-mui/{p-sGjEgJ1z.system.js → p-DDpKwS-R.system.js} +1 -1
- package/dist/cty-mui/p-DEiiznWK.system.js +1 -0
- package/dist/cty-mui/{p-CHeCaQQD.js → p-DIfQpXZY.js} +1 -1
- package/dist/cty-mui/p-Ddpjv6eK.system.js +1 -0
- package/dist/cty-mui/{p-D2G0Jsfd.system.js → p-Rzu7ijXt.system.js} +1 -1
- package/dist/cty-mui/{p-637194fb.entry.js → p-c1c79c99.entry.js} +1 -1
- package/dist/cty-mui/{p-64f873e3.entry.js → p-ebf89aee.entry.js} +1 -1
- package/dist/cty-mui/{p-14f3207d.entry.js → p-f1ed94f0.entry.js} +1 -1
- package/dist/cty-mui/{p-9eba7513.entry.js → p-f902b58c.entry.js} +1 -1
- package/dist/cty-mui/p-gl1FejVx.js +1 -0
- package/dist/docs.json +1 -1
- package/dist/esm/{audio-recorder-CMG1hXEJ.js → audio-recorder-B5KKGCKW.js} +1 -1
- package/dist/esm/cty-camera-photo.entry.js +2 -2
- package/dist/esm/cty-camera_2.entry.js +4 -4
- package/dist/esm/cty-canvas-video.entry.js +1 -1
- package/dist/esm/cty-keyboard.entry.js +1 -1
- package/dist/esm/cty-media-capture.entry.js +2 -2
- package/dist/esm/cty-record.entry.js +2 -2
- package/dist/esm/cty-share-sheet.entry.js +2 -2
- package/dist/esm/cty-video.entry.js +1 -1
- package/dist/esm/{device-info-DpfVimRl.js → device-info-xfEbcUL0.js} +7 -3
- package/dist/esm/{image-picker-Cx4xtB29.js → image-picker-FafI4s7M.js} +12 -10
- package/dist/esm/index.js +6 -6
- package/dist/esm/{share-BW1ZT5H7.js → share-Cmy90gRo.js} +1 -1
- package/dist/esm/{video-capture-Xsjc8H75.js → video-capture-DONPzerB.js} +3 -3
- package/dist/esm-es5/{audio-recorder-CMG1hXEJ.js → audio-recorder-B5KKGCKW.js} +1 -1
- package/dist/esm-es5/cty-camera-photo.entry.js +1 -1
- package/dist/esm-es5/cty-camera_2.entry.js +1 -1
- package/dist/esm-es5/cty-canvas-video.entry.js +1 -1
- package/dist/esm-es5/cty-keyboard.entry.js +1 -1
- package/dist/esm-es5/cty-media-capture.entry.js +1 -1
- package/dist/esm-es5/cty-record.entry.js +1 -1
- package/dist/esm-es5/cty-share-sheet.entry.js +1 -1
- package/dist/esm-es5/cty-video.entry.js +1 -1
- package/dist/esm-es5/device-info-xfEbcUL0.js +1 -0
- package/dist/esm-es5/image-picker-FafI4s7M.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{share-BW1ZT5H7.js → share-Cmy90gRo.js} +1 -1
- package/dist/esm-es5/video-capture-DONPzerB.js +1 -0
- package/dist/types/utils/native/image-picker.d.ts +1 -1
- package/dist/types/utils/native/utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cty-mui/p-5e3d3c21.system.entry.js +0 -1
- package/dist/cty-mui/p-81dac507.entry.js +0 -1
- package/dist/cty-mui/p-B-x0hJFy.js +0 -1
- package/dist/cty-mui/p-B3EGfVtf.js +0 -1
- package/dist/cty-mui/p-CXtPwfcM.js +0 -1
- package/dist/cty-mui/p-DIlGnmah.system.js +0 -1
- package/dist/cty-mui/p-DSgG8qVn.system.js +0 -1
- package/dist/cty-mui/p-e0BrrqR8.system.js +0 -1
- package/dist/esm-es5/device-info-DpfVimRl.js +0 -1
- package/dist/esm-es5/image-picker-Cx4xtB29.js +0 -1
- package/dist/esm-es5/video-capture-Xsjc8H75.js +0 -1
package/components/camera.js
CHANGED
|
@@ -120,7 +120,7 @@ const Camera = /*@__PURE__*/ proxyCustomElement(class Camera extends HTMLElement
|
|
|
120
120
|
async takePhoto() {
|
|
121
121
|
const { quality, width, height, file } = this;
|
|
122
122
|
const data = await cameraPreview.takePicture({ width, height, quality });
|
|
123
|
-
const result = imagePicker.formatPictureResult(file, data);
|
|
123
|
+
const result = await imagePicker.formatPictureResult(file, data);
|
|
124
124
|
this.pictures = [...this.pictures, result];
|
|
125
125
|
this.ctyTakePhoto.emit(result);
|
|
126
126
|
return result;
|
|
@@ -153,7 +153,7 @@ const Camera = /*@__PURE__*/ proxyCustomElement(class Camera extends HTMLElement
|
|
|
153
153
|
}
|
|
154
154
|
render() {
|
|
155
155
|
const { title, closeIcon, flash, flipText, flashText, ratioText, ratios, ratioIndex, zoomIndex, zooms, confirmIcon, confirmText, pictures, showImageViewer, imageViewerIndex } = this;
|
|
156
|
-
return (h(Host, { key: '
|
|
156
|
+
return (h(Host, { key: '6c0e8aee4840edae99979e2f8fa4fe1f28b91f00', class: "cty-camera", onClick: (e) => e.stopPropagation() }, h("cty-nav-bar", { key: '16ed59dc05921a634765cae7e3c8ab817a509b66', title: title, type: "clear" }, h("slot", { key: 'dbeb5240503757e7fb35741bfaacfee520e935c5', name: "header-start", slot: "start" }, h("ion-button", { key: 'e0258b6b06a50aa10d9903e6a4789d155b1a926b', class: "cty-camera__close", onClick: () => this.close() }, h("cty-icon", { key: '48c9f1c506dd13155e2545f1e4d5b8970886bb12', class: "cty-camera__close-icon", name: closeIcon })))), h("div", { key: 'a367e170321b0966ab490b9b694eaffe18fb8f6c', class: "cty-camera-widgets", part: "widgets" }, h("button", { key: '9f54e594fec181935c988f320158ce8f5754cd5c', class: "cty-button-native cty-camera-widget", part: "widget", onClick: () => this.flipCamera() }, h("cty-icon", { key: 'db2e97bd1ec69d82e93c9506fd8976cff560ed24', class: "cty-camera-widget__icon", name: "cty-flip" }), !!flipText && h("span", { key: '947fee726ab0e6c514747a2b2eadbf989f5ff91c', class: "cty-camera-widget__text" }, flipText)), h("button", { key: '01a10aae9e6745d83033ef5e4441cc3d7e199612', class: "cty-button-native cty-camera-widget", part: "widget", onClick: () => this.toggleFlash() }, h("cty-icon", { key: 'd2bd45656aa68309b40f8977e80b15ae7ec29e17', class: "cty-camera-widget__icon", name: flash ? 'cty-flash-on' : 'cty-flash-off' }), !!flashText && h("span", { key: 'b4f9d0d5675c6a21483f4bc211b92ba4e7a8f688', class: "cty-camera-widget__text" }, flashText)), h("button", { key: 'c36f3a4a1d6d2705ea7c52acb0281f18f7570de9', class: "cty-button-native cty-camera-widget", part: "ratio", onClick: () => this.ratioChange() }, h("span", { key: 'ac8cb010492f470ea5e776efa59d2e3b622c031b', class: "cty-camera-widget__ratio flex-center" }, ratios[ratioIndex]), !!ratioText && h("span", { key: 'fc2792dd4c5e27b4946db17fc05ca8d1f79ab475', class: "cty-camera-widget__text" }, ratioText))), h("div", { key: '2b6cb7cb689119162cba517b5469efdcf173e481', class: "cty-camera-controls safe-area-bottom-padding" }, h("slot", { key: '93ba0e977b61d5c5fdd0bd6ab220711064af826d', name: "zooms" }, h("div", { key: '2ea4da678fda37ba175c66a72e34fccf1974a521', class: "cty-camera-controls__zooms flex-center" }, zooms.map((item, idx) => (h("div", { class: { 'cty-camera-controls__zoom-item flex-center': true, 'cty-camera-controls__zoom-item__active': zoomIndex === idx }, onClick: () => this.setZoom(idx) }, h("span", { class: "cty-camera-controls__zoom-text flex-center" }, item, "X")))))), h("div", { key: '8f308406f2ceac48cd7cbfd4306a7a65aebce21f', class: "cty-camera-controls__main flex-center" }, h("div", { key: 'd3fc1707c8f6ee3d9f968f916e8a50810e580a4b', class: "cty-camera-controls__main-left flex-center" }), h("div", { key: 'fa7a8905a22006276b941693c26ac15e6b002976', class: "cty-camera-controls__take-photo flex-center" }, h("button", { key: '61536741582da9bef8bcf0fe4fba09e3fefde58e', class: "cty-button-native cty-camera-controls__take-photo-button", part: "take-photo", onClick: () => this.takePhoto() })), h("div", { key: '74ef21c9e62c7ac604b11b53f9b6a1126fa0338b', class: "cty-camera-controls__main-confirm flex-center" }, pictures.length > 0 && h("button", { key: 'c019b93aab832fadcb3e6d5c77bc98dd8e126b16', class: "cty-button-native flex-column-center", onClick: () => this.confirm() }, h("cty-icon", { key: 'eb9ae426c45fa31202247c99ebb991bc7ceede55', class: "cty-camera-controls__main-confirm-icon", name: confirmIcon }), h("span", { key: '25afa75bcbda33b8f15c432879712bdec937678c', class: "cty-camera-controls__main-confirm-text" }, confirmText)))), h("slot", { key: '14def885116f251bd8390313d46c661dcc807282', name: "images" }, h("div", { key: '254067237e7506f87bdc762285dc3eaff6591ed6', class: "cty-camera-controls__images flex-align-center" }, pictures.map((item, idx) => (h("div", { class: "cty-camera-controls__image", onClick: () => this.toImageViewer(idx) }, h("img", { class: 'cty-camera-controls__image-img', src: item.url }), h("button", { class: "cty-button-native", onClick: (e) => this.deletePicture(e, idx) }, h("cty-icon", { class: "cty-camera-controls__image-delete", name: closeOutline })))))))), showImageViewer && h("cty-image-viewer", { key: 'e84bcb7a5ce6cbb504dbe55e6538622d3914d334', images: pictures.map(item => item.url), initialSlide: imageViewerIndex, overlayIndex: 100, backdropDismiss: false, closeable: true, onCtyDismiss: (e) => this.closeImageViewer(e) })));
|
|
157
157
|
}
|
|
158
158
|
get el() { return this; }
|
|
159
159
|
static get style() { return cameraCss; }
|
|
@@ -2,9 +2,13 @@ import '@stencil/core/internal/client';
|
|
|
2
2
|
import { i as isPlatform } from './platform.js';
|
|
3
3
|
import { n as network } from './network.js';
|
|
4
4
|
|
|
5
|
-
const formatLocalPreview = (
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const formatLocalPreview = (filePath) => {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
window.resolveLocalFileSystemURL(filePath, (entry) => {
|
|
8
|
+
resolve(entry.toURL());
|
|
9
|
+
}, reject);
|
|
10
|
+
});
|
|
11
|
+
// return (window as any)?.Ionic?.WebView?.convertFileSrc(path);
|
|
8
12
|
};
|
|
9
13
|
function testUserAgent(expression) {
|
|
10
14
|
const nav = window.navigator;
|
|
@@ -112,11 +112,11 @@ class CTYImagePicker {
|
|
|
112
112
|
get isWxSDKAvailable() {
|
|
113
113
|
return !!this._wxSDK;
|
|
114
114
|
}
|
|
115
|
-
formatPictureResult(file, data) {
|
|
115
|
+
async formatPictureResult(file, data) {
|
|
116
116
|
let safeUrl = data;
|
|
117
117
|
if (file) {
|
|
118
118
|
try {
|
|
119
|
-
safeUrl = formatLocalPreview(data);
|
|
119
|
+
safeUrl = await formatLocalPreview(data);
|
|
120
120
|
safeUrl = sanitizeDOMString(safeUrl);
|
|
121
121
|
}
|
|
122
122
|
catch (error) {
|
|
@@ -125,7 +125,7 @@ class CTYImagePicker {
|
|
|
125
125
|
}
|
|
126
126
|
else {
|
|
127
127
|
try {
|
|
128
|
-
safeUrl = sanitizeDOMString(
|
|
128
|
+
safeUrl = sanitizeDOMString(data);
|
|
129
129
|
}
|
|
130
130
|
catch (error) {
|
|
131
131
|
console.error('Error bypassing sanitization:', error);
|
|
@@ -148,9 +148,9 @@ class CTYImagePicker {
|
|
|
148
148
|
sourceType: this._cameraPlugin.PictureSourceType[camera ? 'CAMERA' : 'PHOTOLIBRARY'],
|
|
149
149
|
correctOrientation: false
|
|
150
150
|
};
|
|
151
|
-
this._cameraPlugin.getPicture((data) => {
|
|
151
|
+
this._cameraPlugin.getPicture(async (data) => {
|
|
152
152
|
if (data) {
|
|
153
|
-
const result = this.formatPictureResult(file, data);
|
|
153
|
+
const result = await this.formatPictureResult(file, data);
|
|
154
154
|
resolve([result]);
|
|
155
155
|
}
|
|
156
156
|
else {
|
|
@@ -168,14 +168,16 @@ class CTYImagePicker {
|
|
|
168
168
|
const option = {
|
|
169
169
|
quality: 85
|
|
170
170
|
};
|
|
171
|
-
this._imagePickerPlugin.getPictures((results) => {
|
|
171
|
+
this._imagePickerPlugin.getPictures(async (results) => {
|
|
172
172
|
if (results[0] == 'O' || results[0] == 'K') {
|
|
173
173
|
resolve([]);
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const imageList =
|
|
177
|
-
|
|
178
|
-
|
|
176
|
+
const imageList = [];
|
|
177
|
+
for (const data of results) {
|
|
178
|
+
const result = await this.formatPictureResult(file, data);
|
|
179
|
+
imageList.push(result);
|
|
180
|
+
}
|
|
179
181
|
resolve(imageList);
|
|
180
182
|
}, (error) => { reject(error); }, Object.assign(option, imagePickerOptions, {
|
|
181
183
|
outputType: file ? 0 : 1,
|
|
@@ -15,10 +15,10 @@ class CTYVideoCapture {
|
|
|
15
15
|
return reject('Video capture plugin is not available.');
|
|
16
16
|
}
|
|
17
17
|
try {
|
|
18
|
-
this._videoCapturePlugin.captureVideo((result) => {
|
|
18
|
+
this._videoCapturePlugin.captureVideo(async (result) => {
|
|
19
19
|
if (Array.isArray(result) && result.length > 0) {
|
|
20
20
|
const data = result[0].fullPath;
|
|
21
|
-
const url = formatLocalPreview(sanitizeDOMString(data));
|
|
21
|
+
const url = await formatLocalPreview(sanitizeDOMString(data));
|
|
22
22
|
resolve({ url, data });
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DCK462Hl.js');
|
|
4
|
-
var imagePicker = require('./image-picker-
|
|
5
|
-
var deviceInfo = require('./device-info-
|
|
4
|
+
var imagePicker = require('./image-picker-BaPYPMtN.js');
|
|
5
|
+
var deviceInfo = require('./device-info-CC9Tsjk3.js');
|
|
6
6
|
var overlays = require('./overlays-Cfk4eti-.js');
|
|
7
7
|
var lockController = require('./lock-controller-Dk7it1jt.js');
|
|
8
8
|
var helpers = require('./helpers-Bdo8wX6-.js');
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DCK462Hl.js');
|
|
4
4
|
var cameraPreview = require('./camera-preview-BHobAi2K.js');
|
|
5
|
-
var imagePicker = require('./image-picker-
|
|
5
|
+
var imagePicker = require('./image-picker-BaPYPMtN.js');
|
|
6
6
|
var index$1 = require('./index-o2Vg_VSe.js');
|
|
7
7
|
var dom = require('./dom-B8PDM5o-.js');
|
|
8
8
|
var format = require('./format-BSDO5P-c.js');
|
|
9
|
-
require('./device-info-
|
|
9
|
+
require('./device-info-CC9Tsjk3.js');
|
|
10
10
|
require('./platform-DJmEyHMN.js');
|
|
11
11
|
require('./network-D7xvJurk.js');
|
|
12
12
|
require('./index-6rsnyV5b.js');
|
|
@@ -115,7 +115,7 @@ const Camera = class {
|
|
|
115
115
|
async takePhoto() {
|
|
116
116
|
const { quality, width, height, file } = this;
|
|
117
117
|
const data = await cameraPreview.cameraPreview.takePicture({ width, height, quality });
|
|
118
|
-
const result = imagePicker.imagePicker.formatPictureResult(file, data);
|
|
118
|
+
const result = await imagePicker.imagePicker.formatPictureResult(file, data);
|
|
119
119
|
this.pictures = [...this.pictures, result];
|
|
120
120
|
this.ctyTakePhoto.emit(result);
|
|
121
121
|
return result;
|
|
@@ -148,7 +148,7 @@ const Camera = class {
|
|
|
148
148
|
}
|
|
149
149
|
render() {
|
|
150
150
|
const { title, closeIcon, flash, flipText, flashText, ratioText, ratios, ratioIndex, zoomIndex, zooms, confirmIcon, confirmText, pictures, showImageViewer, imageViewerIndex } = this;
|
|
151
|
-
return (index.h(index.Host, { key: '
|
|
151
|
+
return (index.h(index.Host, { key: '6c0e8aee4840edae99979e2f8fa4fe1f28b91f00', class: "cty-camera", onClick: (e) => e.stopPropagation() }, index.h("cty-nav-bar", { key: '16ed59dc05921a634765cae7e3c8ab817a509b66', title: title, type: "clear" }, index.h("slot", { key: 'dbeb5240503757e7fb35741bfaacfee520e935c5', name: "header-start", slot: "start" }, index.h("ion-button", { key: 'e0258b6b06a50aa10d9903e6a4789d155b1a926b', class: "cty-camera__close", onClick: () => this.close() }, index.h("cty-icon", { key: '48c9f1c506dd13155e2545f1e4d5b8970886bb12', class: "cty-camera__close-icon", name: closeIcon })))), index.h("div", { key: 'a367e170321b0966ab490b9b694eaffe18fb8f6c', class: "cty-camera-widgets", part: "widgets" }, index.h("button", { key: '9f54e594fec181935c988f320158ce8f5754cd5c', class: "cty-button-native cty-camera-widget", part: "widget", onClick: () => this.flipCamera() }, index.h("cty-icon", { key: 'db2e97bd1ec69d82e93c9506fd8976cff560ed24', class: "cty-camera-widget__icon", name: "cty-flip" }), !!flipText && index.h("span", { key: '947fee726ab0e6c514747a2b2eadbf989f5ff91c', class: "cty-camera-widget__text" }, flipText)), index.h("button", { key: '01a10aae9e6745d83033ef5e4441cc3d7e199612', class: "cty-button-native cty-camera-widget", part: "widget", onClick: () => this.toggleFlash() }, index.h("cty-icon", { key: 'd2bd45656aa68309b40f8977e80b15ae7ec29e17', class: "cty-camera-widget__icon", name: flash ? 'cty-flash-on' : 'cty-flash-off' }), !!flashText && index.h("span", { key: 'b4f9d0d5675c6a21483f4bc211b92ba4e7a8f688', class: "cty-camera-widget__text" }, flashText)), index.h("button", { key: 'c36f3a4a1d6d2705ea7c52acb0281f18f7570de9', class: "cty-button-native cty-camera-widget", part: "ratio", onClick: () => this.ratioChange() }, index.h("span", { key: 'ac8cb010492f470ea5e776efa59d2e3b622c031b', class: "cty-camera-widget__ratio flex-center" }, ratios[ratioIndex]), !!ratioText && index.h("span", { key: 'fc2792dd4c5e27b4946db17fc05ca8d1f79ab475', class: "cty-camera-widget__text" }, ratioText))), index.h("div", { key: '2b6cb7cb689119162cba517b5469efdcf173e481', class: "cty-camera-controls safe-area-bottom-padding" }, index.h("slot", { key: '93ba0e977b61d5c5fdd0bd6ab220711064af826d', name: "zooms" }, index.h("div", { key: '2ea4da678fda37ba175c66a72e34fccf1974a521', class: "cty-camera-controls__zooms flex-center" }, zooms.map((item, idx) => (index.h("div", { class: { 'cty-camera-controls__zoom-item flex-center': true, 'cty-camera-controls__zoom-item__active': zoomIndex === idx }, onClick: () => this.setZoom(idx) }, index.h("span", { class: "cty-camera-controls__zoom-text flex-center" }, item, "X")))))), index.h("div", { key: '8f308406f2ceac48cd7cbfd4306a7a65aebce21f', class: "cty-camera-controls__main flex-center" }, index.h("div", { key: 'd3fc1707c8f6ee3d9f968f916e8a50810e580a4b', class: "cty-camera-controls__main-left flex-center" }), index.h("div", { key: 'fa7a8905a22006276b941693c26ac15e6b002976', class: "cty-camera-controls__take-photo flex-center" }, index.h("button", { key: '61536741582da9bef8bcf0fe4fba09e3fefde58e', class: "cty-button-native cty-camera-controls__take-photo-button", part: "take-photo", onClick: () => this.takePhoto() })), index.h("div", { key: '74ef21c9e62c7ac604b11b53f9b6a1126fa0338b', class: "cty-camera-controls__main-confirm flex-center" }, pictures.length > 0 && index.h("button", { key: 'c019b93aab832fadcb3e6d5c77bc98dd8e126b16', class: "cty-button-native flex-column-center", onClick: () => this.confirm() }, index.h("cty-icon", { key: 'eb9ae426c45fa31202247c99ebb991bc7ceede55', class: "cty-camera-controls__main-confirm-icon", name: confirmIcon }), index.h("span", { key: '25afa75bcbda33b8f15c432879712bdec937678c', class: "cty-camera-controls__main-confirm-text" }, confirmText)))), index.h("slot", { key: '14def885116f251bd8390313d46c661dcc807282', name: "images" }, index.h("div", { key: '254067237e7506f87bdc762285dc3eaff6591ed6', class: "cty-camera-controls__images flex-align-center" }, pictures.map((item, idx) => (index.h("div", { class: "cty-camera-controls__image", onClick: () => this.toImageViewer(idx) }, index.h("img", { class: 'cty-camera-controls__image-img', src: item.url }), index.h("button", { class: "cty-button-native", onClick: (e) => this.deletePicture(e, idx) }, index.h("cty-icon", { class: "cty-camera-controls__image-delete", name: index$1.closeOutline })))))))), showImageViewer && index.h("cty-image-viewer", { key: 'e84bcb7a5ce6cbb504dbe55e6538622d3914d334', images: pictures.map(item => item.url), initialSlide: imageViewerIndex, overlayIndex: 100, backdropDismiss: false, closeable: true, onCtyDismiss: (e) => this.closeImageViewer(e) })));
|
|
152
152
|
}
|
|
153
153
|
get el() { return index.getElement(this); }
|
|
154
154
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DCK462Hl.js');
|
|
4
|
-
var deviceInfo = require('./device-info-
|
|
4
|
+
var deviceInfo = require('./device-info-CC9Tsjk3.js');
|
|
5
5
|
var format = require('./format-BSDO5P-c.js');
|
|
6
6
|
require('./platform-DJmEyHMN.js');
|
|
7
7
|
require('./network-D7xvJurk.js');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DCK462Hl.js');
|
|
4
4
|
var keyboard = require('./keyboard-Cuk4m847.js');
|
|
5
|
-
var deviceInfo = require('./device-info-
|
|
5
|
+
var deviceInfo = require('./device-info-CC9Tsjk3.js');
|
|
6
6
|
require('./network-D7xvJurk.js');
|
|
7
7
|
require('./platform-DJmEyHMN.js');
|
|
8
8
|
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DCK462Hl.js');
|
|
4
4
|
var statusBar = require('./status-bar-1jhnFEuR.js');
|
|
5
|
-
var videoCapture = require('./video-capture-
|
|
5
|
+
var videoCapture = require('./video-capture-hurwVr0S.js');
|
|
6
6
|
var index$1 = require('./index-o2Vg_VSe.js');
|
|
7
7
|
require('./config-Bn2x7PFv.js');
|
|
8
8
|
require('./format-BSDO5P-c.js');
|
|
9
9
|
require('./index-6rsnyV5b.js');
|
|
10
|
-
require('./device-info-
|
|
10
|
+
require('./device-info-CC9Tsjk3.js');
|
|
11
11
|
require('./platform-DJmEyHMN.js');
|
|
12
12
|
require('./network-D7xvJurk.js');
|
|
13
13
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DCK462Hl.js');
|
|
4
|
-
var deviceInfo = require('./device-info-
|
|
5
|
-
var audioRecorder = require('./audio-recorder-
|
|
4
|
+
var deviceInfo = require('./device-info-CC9Tsjk3.js');
|
|
5
|
+
var audioRecorder = require('./audio-recorder-DYpLmmqT.js');
|
|
6
6
|
var overlays = require('./overlays-Cfk4eti-.js');
|
|
7
7
|
var lockController = require('./lock-controller-Dk7it1jt.js');
|
|
8
8
|
var helpers = require('./helpers-Bdo8wX6-.js');
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DCK462Hl.js');
|
|
4
4
|
var config = require('./config-Bn2x7PFv.js');
|
|
5
|
-
var deviceInfo = require('./device-info-
|
|
6
|
-
var share = require('./share-
|
|
5
|
+
var deviceInfo = require('./device-info-CC9Tsjk3.js');
|
|
6
|
+
var share = require('./share-DjeE75QU.js');
|
|
7
7
|
var utils = require('./utils-C8Ez-9Oe.js');
|
|
8
8
|
var overlays = require('./overlays-Cfk4eti-.js');
|
|
9
9
|
var lockController = require('./lock-controller-Dk7it1jt.js');
|
|
@@ -5,7 +5,7 @@ var dom = require('./dom-B8PDM5o-.js');
|
|
|
5
5
|
var statusBar = require('./status-bar-1jhnFEuR.js');
|
|
6
6
|
var volumeControl = require('./volume-control-CPf0zISh.js');
|
|
7
7
|
var network = require('./network-D7xvJurk.js');
|
|
8
|
-
var deviceInfo = require('./device-info-
|
|
8
|
+
var deviceInfo = require('./device-info-CC9Tsjk3.js');
|
|
9
9
|
var config = require('./config-Bn2x7PFv.js');
|
|
10
10
|
var index$1 = require('./index-o2Vg_VSe.js');
|
|
11
11
|
var platform = require('./platform-DJmEyHMN.js');
|
|
@@ -4,9 +4,13 @@ require('./index-DCK462Hl.js');
|
|
|
4
4
|
var platform = require('./platform-DJmEyHMN.js');
|
|
5
5
|
var network = require('./network-D7xvJurk.js');
|
|
6
6
|
|
|
7
|
-
const formatLocalPreview = (
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const formatLocalPreview = (filePath) => {
|
|
8
|
+
return new Promise((resolve, reject) => {
|
|
9
|
+
window.resolveLocalFileSystemURL(filePath, (entry) => {
|
|
10
|
+
resolve(entry.toURL());
|
|
11
|
+
}, reject);
|
|
12
|
+
});
|
|
13
|
+
// return (window as any)?.Ionic?.WebView?.convertFileSrc(path);
|
|
10
14
|
};
|
|
11
15
|
function testUserAgent(expression) {
|
|
12
16
|
const nav = window.navigator;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var deviceInfo = require('./device-info-
|
|
3
|
+
var deviceInfo = require('./device-info-CC9Tsjk3.js');
|
|
4
4
|
var index = require('./index-6rsnyV5b.js');
|
|
5
5
|
|
|
6
6
|
exports.MediaSourceType = void 0;
|
|
@@ -48,11 +48,11 @@ class CTYImagePicker {
|
|
|
48
48
|
get isWxSDKAvailable() {
|
|
49
49
|
return !!this._wxSDK;
|
|
50
50
|
}
|
|
51
|
-
formatPictureResult(file, data) {
|
|
51
|
+
async formatPictureResult(file, data) {
|
|
52
52
|
let safeUrl = data;
|
|
53
53
|
if (file) {
|
|
54
54
|
try {
|
|
55
|
-
safeUrl = deviceInfo.formatLocalPreview(data);
|
|
55
|
+
safeUrl = await deviceInfo.formatLocalPreview(data);
|
|
56
56
|
safeUrl = index.sanitizeDOMString(safeUrl);
|
|
57
57
|
}
|
|
58
58
|
catch (error) {
|
|
@@ -61,7 +61,7 @@ class CTYImagePicker {
|
|
|
61
61
|
}
|
|
62
62
|
else {
|
|
63
63
|
try {
|
|
64
|
-
safeUrl = index.sanitizeDOMString(
|
|
64
|
+
safeUrl = index.sanitizeDOMString(data);
|
|
65
65
|
}
|
|
66
66
|
catch (error) {
|
|
67
67
|
console.error('Error bypassing sanitization:', error);
|
|
@@ -84,9 +84,9 @@ class CTYImagePicker {
|
|
|
84
84
|
sourceType: this._cameraPlugin.PictureSourceType[camera ? 'CAMERA' : 'PHOTOLIBRARY'],
|
|
85
85
|
correctOrientation: false
|
|
86
86
|
};
|
|
87
|
-
this._cameraPlugin.getPicture((data) => {
|
|
87
|
+
this._cameraPlugin.getPicture(async (data) => {
|
|
88
88
|
if (data) {
|
|
89
|
-
const result = this.formatPictureResult(file, data);
|
|
89
|
+
const result = await this.formatPictureResult(file, data);
|
|
90
90
|
resolve([result]);
|
|
91
91
|
}
|
|
92
92
|
else {
|
|
@@ -104,14 +104,16 @@ class CTYImagePicker {
|
|
|
104
104
|
const option = {
|
|
105
105
|
quality: 85
|
|
106
106
|
};
|
|
107
|
-
this._imagePickerPlugin.getPictures((results) => {
|
|
107
|
+
this._imagePickerPlugin.getPictures(async (results) => {
|
|
108
108
|
if (results[0] == 'O' || results[0] == 'K') {
|
|
109
109
|
resolve([]);
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
|
-
const imageList =
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
const imageList = [];
|
|
113
|
+
for (const data of results) {
|
|
114
|
+
const result = await this.formatPictureResult(file, data);
|
|
115
|
+
imageList.push(result);
|
|
116
|
+
}
|
|
115
117
|
resolve(imageList);
|
|
116
118
|
}, (error) => { reject(error); }, Object.assign(option, imagePickerOptions, {
|
|
117
119
|
outputType: file ? 0 : 1,
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -9,15 +9,15 @@ var dom = require('./dom-B8PDM5o-.js');
|
|
|
9
9
|
var format = require('./format-BSDO5P-c.js');
|
|
10
10
|
var utils = require('./utils-C8Ez-9Oe.js');
|
|
11
11
|
var validate = require('./validate-Bad0X9vv.js');
|
|
12
|
-
var audioRecorder = require('./audio-recorder-
|
|
12
|
+
var audioRecorder = require('./audio-recorder-DYpLmmqT.js');
|
|
13
13
|
var cameraPreview = require('./camera-preview-BHobAi2K.js');
|
|
14
|
-
var deviceInfo = require('./device-info-
|
|
15
|
-
var imagePicker = require('./image-picker-
|
|
14
|
+
var deviceInfo = require('./device-info-CC9Tsjk3.js');
|
|
15
|
+
var imagePicker = require('./image-picker-BaPYPMtN.js');
|
|
16
16
|
var keyboard = require('./keyboard-Cuk4m847.js');
|
|
17
17
|
var network = require('./network-D7xvJurk.js');
|
|
18
18
|
var volumeControl = require('./volume-control-CPf0zISh.js');
|
|
19
|
-
var share = require('./share-
|
|
20
|
-
var videoCapture = require('./video-capture-
|
|
19
|
+
var share = require('./share-DjeE75QU.js');
|
|
20
|
+
var videoCapture = require('./video-capture-hurwVr0S.js');
|
|
21
21
|
var ctyMuiGlobal = require('./cty-mui-global-CQI_F108.js');
|
|
22
22
|
var overlays = require('./overlays-Cfk4eti-.js');
|
|
23
23
|
require('./index-D3mJ1Cix.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-6rsnyV5b.js');
|
|
4
|
-
var deviceInfo = require('./device-info-
|
|
4
|
+
var deviceInfo = require('./device-info-CC9Tsjk3.js');
|
|
5
5
|
|
|
6
6
|
class CTYVideoCapture {
|
|
7
7
|
get _videoCapturePlugin() {
|
|
@@ -17,10 +17,10 @@ class CTYVideoCapture {
|
|
|
17
17
|
return reject('Video capture plugin is not available.');
|
|
18
18
|
}
|
|
19
19
|
try {
|
|
20
|
-
this._videoCapturePlugin.captureVideo((result) => {
|
|
20
|
+
this._videoCapturePlugin.captureVideo(async (result) => {
|
|
21
21
|
if (Array.isArray(result) && result.length > 0) {
|
|
22
22
|
const data = result[0].fullPath;
|
|
23
|
-
const url = deviceInfo.formatLocalPreview(index.sanitizeDOMString(data));
|
|
23
|
+
const url = await deviceInfo.formatLocalPreview(index.sanitizeDOMString(data));
|
|
24
24
|
resolve({ url, data });
|
|
25
25
|
}
|
|
26
26
|
else {
|
|
@@ -102,7 +102,7 @@ export class Camera {
|
|
|
102
102
|
async takePhoto() {
|
|
103
103
|
const { quality, width, height, file } = this;
|
|
104
104
|
const data = await cameraPreview.takePicture({ width, height, quality });
|
|
105
|
-
const result = imagePicker.formatPictureResult(file, data);
|
|
105
|
+
const result = await imagePicker.formatPictureResult(file, data);
|
|
106
106
|
this.pictures = [...this.pictures, result];
|
|
107
107
|
this.ctyTakePhoto.emit(result);
|
|
108
108
|
return result;
|
|
@@ -135,7 +135,7 @@ export class Camera {
|
|
|
135
135
|
}
|
|
136
136
|
render() {
|
|
137
137
|
const { title, closeIcon, flash, flipText, flashText, ratioText, ratios, ratioIndex, zoomIndex, zooms, confirmIcon, confirmText, pictures, showImageViewer, imageViewerIndex } = this;
|
|
138
|
-
return (h(Host, { key: '
|
|
138
|
+
return (h(Host, { key: '6c0e8aee4840edae99979e2f8fa4fe1f28b91f00', class: "cty-camera", onClick: (e) => e.stopPropagation() }, h("cty-nav-bar", { key: '16ed59dc05921a634765cae7e3c8ab817a509b66', title: title, type: "clear" }, h("slot", { key: 'dbeb5240503757e7fb35741bfaacfee520e935c5', name: "header-start", slot: "start" }, h("ion-button", { key: 'e0258b6b06a50aa10d9903e6a4789d155b1a926b', class: "cty-camera__close", onClick: () => this.close() }, h("cty-icon", { key: '48c9f1c506dd13155e2545f1e4d5b8970886bb12', class: "cty-camera__close-icon", name: closeIcon })))), h("div", { key: 'a367e170321b0966ab490b9b694eaffe18fb8f6c', class: "cty-camera-widgets", part: "widgets" }, h("button", { key: '9f54e594fec181935c988f320158ce8f5754cd5c', class: "cty-button-native cty-camera-widget", part: "widget", onClick: () => this.flipCamera() }, h("cty-icon", { key: 'db2e97bd1ec69d82e93c9506fd8976cff560ed24', class: "cty-camera-widget__icon", name: "cty-flip" }), !!flipText && h("span", { key: '947fee726ab0e6c514747a2b2eadbf989f5ff91c', class: "cty-camera-widget__text" }, flipText)), h("button", { key: '01a10aae9e6745d83033ef5e4441cc3d7e199612', class: "cty-button-native cty-camera-widget", part: "widget", onClick: () => this.toggleFlash() }, h("cty-icon", { key: 'd2bd45656aa68309b40f8977e80b15ae7ec29e17', class: "cty-camera-widget__icon", name: flash ? 'cty-flash-on' : 'cty-flash-off' }), !!flashText && h("span", { key: 'b4f9d0d5675c6a21483f4bc211b92ba4e7a8f688', class: "cty-camera-widget__text" }, flashText)), h("button", { key: 'c36f3a4a1d6d2705ea7c52acb0281f18f7570de9', class: "cty-button-native cty-camera-widget", part: "ratio", onClick: () => this.ratioChange() }, h("span", { key: 'ac8cb010492f470ea5e776efa59d2e3b622c031b', class: "cty-camera-widget__ratio flex-center" }, ratios[ratioIndex]), !!ratioText && h("span", { key: 'fc2792dd4c5e27b4946db17fc05ca8d1f79ab475', class: "cty-camera-widget__text" }, ratioText))), h("div", { key: '2b6cb7cb689119162cba517b5469efdcf173e481', class: "cty-camera-controls safe-area-bottom-padding" }, h("slot", { key: '93ba0e977b61d5c5fdd0bd6ab220711064af826d', name: "zooms" }, h("div", { key: '2ea4da678fda37ba175c66a72e34fccf1974a521', class: "cty-camera-controls__zooms flex-center" }, zooms.map((item, idx) => (h("div", { class: { 'cty-camera-controls__zoom-item flex-center': true, 'cty-camera-controls__zoom-item__active': zoomIndex === idx }, onClick: () => this.setZoom(idx) }, h("span", { class: "cty-camera-controls__zoom-text flex-center" }, item, "X")))))), h("div", { key: '8f308406f2ceac48cd7cbfd4306a7a65aebce21f', class: "cty-camera-controls__main flex-center" }, h("div", { key: 'd3fc1707c8f6ee3d9f968f916e8a50810e580a4b', class: "cty-camera-controls__main-left flex-center" }), h("div", { key: 'fa7a8905a22006276b941693c26ac15e6b002976', class: "cty-camera-controls__take-photo flex-center" }, h("button", { key: '61536741582da9bef8bcf0fe4fba09e3fefde58e', class: "cty-button-native cty-camera-controls__take-photo-button", part: "take-photo", onClick: () => this.takePhoto() })), h("div", { key: '74ef21c9e62c7ac604b11b53f9b6a1126fa0338b', class: "cty-camera-controls__main-confirm flex-center" }, pictures.length > 0 && h("button", { key: 'c019b93aab832fadcb3e6d5c77bc98dd8e126b16', class: "cty-button-native flex-column-center", onClick: () => this.confirm() }, h("cty-icon", { key: 'eb9ae426c45fa31202247c99ebb991bc7ceede55', class: "cty-camera-controls__main-confirm-icon", name: confirmIcon }), h("span", { key: '25afa75bcbda33b8f15c432879712bdec937678c', class: "cty-camera-controls__main-confirm-text" }, confirmText)))), h("slot", { key: '14def885116f251bd8390313d46c661dcc807282', name: "images" }, h("div", { key: '254067237e7506f87bdc762285dc3eaff6591ed6', class: "cty-camera-controls__images flex-align-center" }, pictures.map((item, idx) => (h("div", { class: "cty-camera-controls__image", onClick: () => this.toImageViewer(idx) }, h("img", { class: 'cty-camera-controls__image-img', src: item.url }), h("button", { class: "cty-button-native", onClick: (e) => this.deletePicture(e, idx) }, h("cty-icon", { class: "cty-camera-controls__image-delete", name: closeOutline })))))))), showImageViewer && h("cty-image-viewer", { key: 'e84bcb7a5ce6cbb504dbe55e6538622d3914d334', images: pictures.map(item => item.url), initialSlide: imageViewerIndex, overlayIndex: 100, backdropDismiss: false, closeable: true, onCtyDismiss: (e) => this.closeImageViewer(e) })));
|
|
139
139
|
}
|
|
140
140
|
static get is() { return "cty-camera"; }
|
|
141
141
|
static get encapsulation() { return "shadow"; }
|
|
@@ -46,11 +46,11 @@ export class CTYImagePicker {
|
|
|
46
46
|
get isWxSDKAvailable() {
|
|
47
47
|
return !!this._wxSDK;
|
|
48
48
|
}
|
|
49
|
-
formatPictureResult(file, data) {
|
|
49
|
+
async formatPictureResult(file, data) {
|
|
50
50
|
let safeUrl = data;
|
|
51
51
|
if (file) {
|
|
52
52
|
try {
|
|
53
|
-
safeUrl = formatLocalPreview(data);
|
|
53
|
+
safeUrl = await formatLocalPreview(data);
|
|
54
54
|
safeUrl = sanitizeDOMString(safeUrl);
|
|
55
55
|
}
|
|
56
56
|
catch (error) {
|
|
@@ -59,7 +59,7 @@ export class CTYImagePicker {
|
|
|
59
59
|
}
|
|
60
60
|
else {
|
|
61
61
|
try {
|
|
62
|
-
safeUrl = sanitizeDOMString(
|
|
62
|
+
safeUrl = sanitizeDOMString(data);
|
|
63
63
|
}
|
|
64
64
|
catch (error) {
|
|
65
65
|
console.error('Error bypassing sanitization:', error);
|
|
@@ -82,9 +82,9 @@ export class CTYImagePicker {
|
|
|
82
82
|
sourceType: this._cameraPlugin.PictureSourceType[camera ? 'CAMERA' : 'PHOTOLIBRARY'],
|
|
83
83
|
correctOrientation: false
|
|
84
84
|
};
|
|
85
|
-
this._cameraPlugin.getPicture((data) => {
|
|
85
|
+
this._cameraPlugin.getPicture(async (data) => {
|
|
86
86
|
if (data) {
|
|
87
|
-
const result = this.formatPictureResult(file, data);
|
|
87
|
+
const result = await this.formatPictureResult(file, data);
|
|
88
88
|
resolve([result]);
|
|
89
89
|
}
|
|
90
90
|
else {
|
|
@@ -102,14 +102,16 @@ export class CTYImagePicker {
|
|
|
102
102
|
const option = {
|
|
103
103
|
quality: 85
|
|
104
104
|
};
|
|
105
|
-
this._imagePickerPlugin.getPictures((results) => {
|
|
105
|
+
this._imagePickerPlugin.getPictures(async (results) => {
|
|
106
106
|
if (results[0] == 'O' || results[0] == 'K') {
|
|
107
107
|
resolve([]);
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
const imageList =
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
const imageList = [];
|
|
111
|
+
for (const data of results) {
|
|
112
|
+
const result = await this.formatPictureResult(file, data);
|
|
113
|
+
imageList.push(result);
|
|
114
|
+
}
|
|
113
115
|
resolve(imageList);
|
|
114
116
|
}, (error) => { reject(error); }, Object.assign(option, imagePickerOptions, {
|
|
115
117
|
outputType: file ? 0 : 1,
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { deviceInfo } from "./device-info";
|
|
2
|
-
export const formatLocalPreview = (
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export const formatLocalPreview = (filePath) => {
|
|
3
|
+
return new Promise((resolve, reject) => {
|
|
4
|
+
window.resolveLocalFileSystemURL(filePath, (entry) => {
|
|
5
|
+
resolve(entry.toURL());
|
|
6
|
+
}, reject);
|
|
7
|
+
});
|
|
8
|
+
// return (window as any)?.Ionic?.WebView?.convertFileSrc(path);
|
|
5
9
|
};
|
|
6
10
|
export function testUserAgent(expression) {
|
|
7
11
|
const nav = window.navigator;
|
|
@@ -14,10 +14,10 @@ export class CTYVideoCapture {
|
|
|
14
14
|
return reject('Video capture plugin is not available.');
|
|
15
15
|
}
|
|
16
16
|
try {
|
|
17
|
-
this._videoCapturePlugin.captureVideo((result) => {
|
|
17
|
+
this._videoCapturePlugin.captureVideo(async (result) => {
|
|
18
18
|
if (Array.isArray(result) && result.length > 0) {
|
|
19
19
|
const data = result[0].fullPath;
|
|
20
|
-
const url = formatLocalPreview(sanitizeDOMString(data));
|
|
20
|
+
const url = await formatLocalPreview(sanitizeDOMString(data));
|
|
21
21
|
resolve({ url, data });
|
|
22
22
|
}
|
|
23
23
|
else {
|