capacitor-community-multilens-camerapreview 0.0.11-a → 6.0.0
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/README.md +0 -10
- package/android/build.gradle +10 -8
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraActivity.java +5 -8
- package/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java +1 -2
- package/dist/esm/definitions.d.ts +4 -3
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +2 -1
- package/dist/esm/web.js +19 -31
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +18 -25
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +19 -26
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/CameraController.swift +3 -54
- package/ios/Plugin/Plugin.m +0 -1
- package/ios/Plugin/Plugin.swift +5 -12
- package/package.json +26 -19
- package/CapacitorCommunityMultilensCamerapreview.podspec +0 -17
- package/dist/docs.json +0 -418
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CameraPreview = registerPlugin('CameraPreview', {\n web: () => import('./web').then((m) => new m.CameraPreviewWeb()),\n});\nexport * from './definitions';\nexport { CameraPreview };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/prefer-for-of */\n/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable no-async-promise-executor */\n/* eslint-disable @typescript-eslint/consistent-type-assertions */\n/* eslint-disable @typescript-eslint/no-inferrable-types */\nimport { WebPlugin, registerWebPlugin } from '@capacitor/core';\nexport class CameraPreviewWeb extends WebPlugin {\n constructor() {\n super({\n name: 'CameraPreview',\n platforms: ['web'],\n });\n /**\n * track which camera is used based on start options\n * used in capture\n */\n this.isBackCamera = false;\n }\n async start(options) {\n return new Promise(async (resolve, reject) => {\n var _a;\n await navigator.mediaDevices\n .getUserMedia({\n audio: !options.disableAudio,\n video: true\n })\n .then((stream) => {\n // Stop any existing stream so we can request media with different constraints based on user input\n stream.getTracks().forEach((track) => track.stop());\n })\n .catch((error) => {\n reject(error);\n });\n const video = document.getElementById('video');\n const parent = document.getElementById(options.parent);\n if (!video) {\n const videoElement = document.createElement('video');\n videoElement.id = 'video';\n videoElement.setAttribute('class', options.className || '');\n // Don't flip video feed if camera is rear facing\n if (options.position !== 'rear') {\n videoElement.setAttribute('style', '-webkit-transform: scaleX(-1); transform: scaleX(-1);');\n }\n const userAgent = navigator.userAgent.toLowerCase();\n const isSafari = userAgent.includes('safari') && !userAgent.includes('chrome');\n // Safari on iOS needs to have the autoplay, muted and playsinline attributes set for video.play() to be successful\n // Without these attributes videoElement.play() will throw a NotAllowedError\n // https://developer.apple.com/documentation/webkit/delivering_video_content_for_safari\n if (isSafari) {\n videoElement.setAttribute('autoplay', 'true');\n videoElement.setAttribute('muted', 'true');\n videoElement.setAttribute('playsinline', 'true');\n }\n if (parent) {\n parent.appendChild(videoElement);\n }\n if ((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia) {\n const constraints = {\n video: {\n width: { ideal: options.width },\n height: { ideal: options.height }\n }\n };\n if (options.position === 'rear') {\n constraints.video.facingMode = 'environment';\n this.isBackCamera = true;\n }\n else {\n this.isBackCamera = false;\n }\n navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {\n //video.src = window.URL.createObjectURL(stream);\n videoElement.srcObject = stream;\n videoElement.play();\n resolve({});\n }, (err) => {\n reject(err);\n });\n }\n }\n else {\n reject({ message: 'camera already started' });\n }\n });\n }\n async stop() {\n const video = document.getElementById('video');\n if (video) {\n video.pause();\n const st = video.srcObject;\n const tracks = st.getTracks();\n for (let i = 0; i < tracks.length; i++) {\n const track = tracks[i];\n track.stop();\n }\n video.remove();\n }\n }\n async capture(options) {\n return new Promise((resolve, _) => {\n const video = document.getElementById('video');\n const canvas = document.createElement('canvas');\n // video.width = video.offsetWidth;\n const context = canvas.getContext('2d');\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n // flip horizontally back camera isn't used\n if (context) {\n if (!this.isBackCamera) {\n context.translate(video.videoWidth, 0);\n context.scale(-1, 1);\n }\n context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);\n }\n let base64EncodedImage;\n if (options.quality != undefined) {\n base64EncodedImage = canvas.toDataURL('image/jpeg', options.quality / 100.0).replace('data:image/jpeg;base64,', '');\n }\n else {\n base64EncodedImage = canvas.toDataURL('image/png').replace('data:image/png;base64,', '');\n }\n resolve({\n value: base64EncodedImage,\n });\n });\n }\n async captureSample(_options) {\n return this.capture(_options);\n }\n async setZoom(_options) {\n throw new Error('set zoom not supported under the web platform');\n }\n async getSupportedFlashModes() {\n throw new Error('getSupportedFlashModes not supported under the web platform');\n }\n getSupportedZoomLevels() {\n throw new Error('getSupportedFlashModes not supported under the web platform.');\n }\n async setFlashMode(_options) {\n throw new Error('setFlashMode not supported under the web platform');\n }\n async flip() {\n throw new Error('flip not supported under the web platform');\n }\n async changeOrientation() {\n throw new Error('changeOrientation not supported under the web platform');\n }\n async setOpacity(_options) {\n const video = document.getElementById('video');\n if (!!video && !!_options['opacity']) {\n video.style.setProperty('opacity', _options['opacity'].toString());\n }\n }\n}\nconst CameraPreview = new CameraPreviewWeb();\nexport { CameraPreview };\nregisterWebPlugin(CameraPreview);\n//# sourceMappingURL=web.js.map"],"names":["CameraPreview","registerPlugin","WebPlugin","registerWebPlugin"],"mappings":";;;AACK,UAACA,eAAa,GAAGC,mBAAc,CAAC,eAAe,EAAE;IACtD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpE,CAAC;;ICHD;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AAC,CAAC;IAC/E,SAAS;IACT,KAAK;IACL,CAAC;IACD,MAAM,aAAa,GAAG,IAAI,gBAAgB,EAAE,CAAC;AAE7CC,0BAAiB,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst CameraPreview = registerPlugin('CameraPreview', {\n web: () => import('./web').then((m) => new m.CameraPreviewWeb()),\n});\nexport * from './definitions';\nexport { CameraPreview };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class CameraPreviewWeb extends WebPlugin {\n constructor() {\n super({\n name: 'CameraPreview',\n platforms: ['web'],\n });\n }\n async start(options) {\n return new Promise(async (resolve, reject) => {\n await navigator.mediaDevices\n .getUserMedia({\n audio: !options.disableAudio,\n video: true,\n })\n .then((stream) => {\n // Stop any existing stream so we can request media with different constraints based on user input\n stream.getTracks().forEach((track) => track.stop());\n })\n .catch((error) => {\n reject(error);\n });\n const video = document.getElementById('video');\n const parent = document.getElementById(options.parent);\n if (!video) {\n const videoElement = document.createElement('video');\n videoElement.id = 'video';\n videoElement.setAttribute('class', options.className || '');\n // Don't flip video feed if camera is rear facing\n if (options.position !== 'rear') {\n videoElement.setAttribute('style', '-webkit-transform: scaleX(-1); transform: scaleX(-1);');\n }\n const userAgent = navigator.userAgent.toLowerCase();\n const isSafari = userAgent.includes('safari') && !userAgent.includes('chrome');\n // Safari on iOS needs to have the autoplay, muted and playsinline attributes set for video.play() to be successful\n // Without these attributes videoElement.play() will throw a NotAllowedError\n // https://developer.apple.com/documentation/webkit/delivering_video_content_for_safari\n if (isSafari) {\n videoElement.setAttribute('autoplay', 'true');\n videoElement.setAttribute('muted', 'true');\n videoElement.setAttribute('playsinline', 'true');\n }\n parent.appendChild(videoElement);\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n const constraints = {\n video: {\n width: { ideal: options.width },\n height: { ideal: options.height },\n },\n };\n if (options.position === 'rear') {\n constraints.video.facingMode = 'environment';\n this.isBackCamera = true;\n }\n else {\n this.isBackCamera = false;\n }\n navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {\n //video.src = window.URL.createObjectURL(stream);\n videoElement.srcObject = stream;\n videoElement.play();\n resolve({});\n }, (err) => {\n reject(err);\n });\n }\n }\n else {\n reject({ message: 'camera already started' });\n }\n });\n }\n async startRecordVideo() {\n throw this.unimplemented('Not implemented on web.');\n }\n async stopRecordVideo() {\n throw this.unimplemented('Not implemented on web.');\n }\n async stop() {\n const video = document.getElementById('video');\n if (video) {\n video.pause();\n const st = video.srcObject;\n const tracks = st.getTracks();\n for (let i = 0; i < tracks.length; i++) {\n const track = tracks[i];\n track.stop();\n }\n video.remove();\n }\n }\n async capture(options) {\n return new Promise((resolve, _) => {\n const video = document.getElementById('video');\n const canvas = document.createElement('canvas');\n // video.width = video.offsetWidth;\n const context = canvas.getContext('2d');\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n // flip horizontally back camera isn't used\n if (!this.isBackCamera) {\n context.translate(video.videoWidth, 0);\n context.scale(-1, 1);\n }\n context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);\n let base64EncodedImage;\n if (options.quality != undefined) {\n base64EncodedImage = canvas\n .toDataURL('image/jpeg', options.quality / 100.0)\n .replace('data:image/jpeg;base64,', '');\n }\n else {\n base64EncodedImage = canvas.toDataURL('image/png').replace('data:image/png;base64,', '');\n }\n resolve({\n value: base64EncodedImage,\n });\n });\n }\n async captureSample(_options) {\n return this.capture(_options);\n }\n async setZoom(_options) {\n throw new Error('set zoom not supported under the web platform');\n }\n async getSupportedFlashModes() {\n throw new Error('getSupportedFlashModes not supported under the web platform');\n }\n getSupportedZoomLevels() {\n throw new Error('getSupportedFlashModes not supported under the web platform.');\n }\n async setFlashMode(_options) {\n throw new Error('setFlashMode not supported under the web platform');\n }\n async flip() {\n throw new Error('flip not supported under the web platform');\n }\n async setOpacity(_options) {\n const video = document.getElementById('video');\n if (!!video && !!_options['opacity']) {\n video.style.setProperty('opacity', _options['opacity'].toString());\n }\n }\n}\nconst CameraPreview = new CameraPreviewWeb();\nexport { CameraPreview };\n//# sourceMappingURL=web.js.map"],"names":["CameraPreview","registerPlugin","WebPlugin"],"mappings":";;;AACK,UAACA,eAAa,GAAGC,mBAAc,CAAC,eAAe,EAAE;IACtD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpE,CAAC;;ICFM,MAAM,gBAAgB,SAASC,cAAS,CAAC;IAChD,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,CAAC;IACd,YAAY,IAAI,EAAE,eAAe;IACjC,YAAY,SAAS,EAAE,CAAC,KAAK,CAAC;IAC9B,SAAS,CAAC,CAAC;IACX,KAAK;IACL,IAAI,MAAM,KAAK,CAAC,OAAO,EAAE;IACzB,QAAQ,OAAO,IAAI,OAAO,CAAC,OAAO,OAAO,EAAE,MAAM,KAAK;IACtD,YAAY,MAAM,SAAS,CAAC,YAAY;IACxC,iBAAiB,YAAY,CAAC;IAC9B,gBAAgB,KAAK,EAAE,CAAC,OAAO,CAAC,YAAY;IAC5C,gBAAgB,KAAK,EAAE,IAAI;IAC3B,aAAa,CAAC;IACd,iBAAiB,IAAI,CAAC,CAAC,MAAM,KAAK;IAClC;IACA,gBAAgB,MAAM,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IACpE,aAAa,CAAC;IACd,iBAAiB,KAAK,CAAC,CAAC,KAAK,KAAK;IAClC,gBAAgB,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,aAAa,CAAC,CAAC;IACf,YAAY,MAAM,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC3D,YAAY,MAAM,MAAM,GAA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AG,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IACvD,QAAQ,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;IAC9C,YAAY,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC/E,SAAS;IACT,KAAK;IACL,CAAC;IACD,MAAM,aAAa,GAAG,IAAI,gBAAgB,EAAE;;;;;;;;;;;;;;;;;;"}
|
|
@@ -66,7 +66,7 @@ extension CameraController {
|
|
|
66
66
|
|
|
67
67
|
try camera.lockForConfiguration()
|
|
68
68
|
if camera.isFocusModeSupported(.continuousAutoFocus){
|
|
69
|
-
|
|
69
|
+
camera.focusMode = .continuousAutoFocus
|
|
70
70
|
}
|
|
71
71
|
camera.unlockForConfiguration()
|
|
72
72
|
}
|
|
@@ -214,7 +214,6 @@ extension CameraController {
|
|
|
214
214
|
dataOutput?.connections.forEach { $0.videoOrientation = videoOrientation }
|
|
215
215
|
photoOutput?.connections.forEach { $0.videoOrientation = videoOrientation }
|
|
216
216
|
}
|
|
217
|
-
|
|
218
217
|
|
|
219
218
|
func switchCameras() throws {
|
|
220
219
|
guard let currentCameraPosition = currentCameraPosition, let captureSession = self.captureSession, captureSession.isRunning else { throw CameraControllerError.captureSessionIsMissing }
|
|
@@ -265,56 +264,6 @@ extension CameraController {
|
|
|
265
264
|
|
|
266
265
|
captureSession.commitConfiguration()
|
|
267
266
|
}
|
|
268
|
-
func changeOrientation() throws {
|
|
269
|
-
guard let currentCameraPosition = currentCameraPosition, let captureSession = self.captureSession, captureSession.isRunning else { throw CameraControllerError.captureSessionIsMissing }
|
|
270
|
-
|
|
271
|
-
captureSession.beginConfiguration()
|
|
272
|
-
|
|
273
|
-
func switchToFrontCamera() throws {
|
|
274
|
-
|
|
275
|
-
guard let rearCameraInput = self.rearCameraInput, captureSession.inputs.contains(rearCameraInput),
|
|
276
|
-
let frontCamera = self.frontCamera else { throw CameraControllerError.invalidOperation }
|
|
277
|
-
|
|
278
|
-
self.frontCameraInput = try AVCaptureDeviceInput(device: frontCamera)
|
|
279
|
-
|
|
280
|
-
captureSession.removeInput(rearCameraInput)
|
|
281
|
-
|
|
282
|
-
if captureSession.canAddInput(self.frontCameraInput!) {
|
|
283
|
-
captureSession.addInput(self.frontCameraInput!)
|
|
284
|
-
|
|
285
|
-
self.currentCameraPosition = .front
|
|
286
|
-
} else {
|
|
287
|
-
throw CameraControllerError.invalidOperation
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
func switchToRearCamera() throws {
|
|
292
|
-
|
|
293
|
-
guard let frontCameraInput = self.frontCameraInput, captureSession.inputs.contains(frontCameraInput),
|
|
294
|
-
let rearCamera = self.rearCamera else { throw CameraControllerError.invalidOperation }
|
|
295
|
-
|
|
296
|
-
self.rearCameraInput = try AVCaptureDeviceInput(device: rearCamera)
|
|
297
|
-
|
|
298
|
-
captureSession.removeInput(frontCameraInput)
|
|
299
|
-
|
|
300
|
-
if captureSession.canAddInput(self.rearCameraInput!) {
|
|
301
|
-
captureSession.addInput(self.rearCameraInput!)
|
|
302
|
-
|
|
303
|
-
self.currentCameraPosition = .rear
|
|
304
|
-
} else { throw CameraControllerError.invalidOperation }
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
switch currentCameraPosition {
|
|
308
|
-
case .front:
|
|
309
|
-
try switchToRearCamera()
|
|
310
|
-
|
|
311
|
-
case .rear:
|
|
312
|
-
try switchToFrontCamera()
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
captureSession.commitConfiguration()
|
|
316
|
-
}
|
|
317
|
-
|
|
318
267
|
func setZoom(lens: String) throws {
|
|
319
268
|
print(lens)
|
|
320
269
|
guard let captureSession = self.captureSession, captureSession.isRunning else { throw CameraControllerError.captureSessionIsMissing }
|
|
@@ -458,7 +407,7 @@ extension CameraController {
|
|
|
458
407
|
}
|
|
459
408
|
return supportedCameras;
|
|
460
409
|
}
|
|
461
|
-
|
|
410
|
+
|
|
462
411
|
func setFlashMode(flashMode: AVCaptureDevice.FlashMode) throws {
|
|
463
412
|
var currentCamera: AVCaptureDevice?
|
|
464
413
|
switch currentCameraPosition {
|
|
@@ -622,7 +571,7 @@ extension CameraController: AVCapturePhotoCaptureDelegate {
|
|
|
622
571
|
public func photoOutput(_ captureOutput: AVCapturePhotoOutput, didFinishProcessingPhoto photoSampleBuffer: CMSampleBuffer?, previewPhoto previewPhotoSampleBuffer: CMSampleBuffer?,
|
|
623
572
|
resolvedSettings: AVCaptureResolvedPhotoSettings, bracketSettings: AVCaptureBracketedStillImageSettings?, error: Swift.Error?) {
|
|
624
573
|
if let error = error { self.photoCaptureCompletionBlock?(nil, error) } else if let buffer = photoSampleBuffer, let data = AVCapturePhotoOutput.jpegPhotoDataRepresentation(forJPEGSampleBuffer: buffer, previewPhotoSampleBuffer: nil),
|
|
625
|
-
|
|
574
|
+
let image = UIImage(data: data) {
|
|
626
575
|
self.photoCaptureCompletionBlock?(image.fixedOrientation(), nil)
|
|
627
576
|
} else {
|
|
628
577
|
self.photoCaptureCompletionBlock?(nil, CameraControllerError.unknown)
|
package/ios/Plugin/Plugin.m
CHANGED
|
@@ -9,7 +9,6 @@ CAP_PLUGIN(CameraPreview, "CameraPreview",
|
|
|
9
9
|
CAP_PLUGIN_METHOD(capture, CAPPluginReturnPromise);
|
|
10
10
|
CAP_PLUGIN_METHOD(captureSample, CAPPluginReturnPromise);
|
|
11
11
|
CAP_PLUGIN_METHOD(flip, CAPPluginReturnPromise);
|
|
12
|
-
CAP_PLUGIN_METHOD(changeOrientation, CAPPluginReturnPromise);
|
|
13
12
|
CAP_PLUGIN_METHOD(setZoom, CAPPluginReturnPromise);
|
|
14
13
|
CAP_PLUGIN_METHOD(getSupportedFlashModes, CAPPluginReturnPromise);
|
|
15
14
|
CAP_PLUGIN_METHOD(getSupportedZoomLevels, CAPPluginReturnPromise);
|
package/ios/Plugin/Plugin.swift
CHANGED
|
@@ -25,7 +25,7 @@ public class CameraPreview: CAPPlugin {
|
|
|
25
25
|
var zoomFactor = String()
|
|
26
26
|
|
|
27
27
|
@objc func rotated() {
|
|
28
|
-
let height = self.paddingBottom != nil ? self.height! - self.paddingBottom!: self.height
|
|
28
|
+
let height = self.paddingBottom != nil ? self.height! - self.paddingBottom!: self.height!
|
|
29
29
|
|
|
30
30
|
if UIApplication.shared.statusBarOrientation.isLandscape {
|
|
31
31
|
self.previewView.frame = CGRect(x: self.y!, y: self.x!, width: max(height, self.width!), height: min(height, self.width!))
|
|
@@ -33,7 +33,7 @@ public class CameraPreview: CAPPlugin {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
if UIApplication.shared.statusBarOrientation.isPortrait {
|
|
36
|
-
if
|
|
36
|
+
if self.previewView != nil && self.x != nil && self.y != nil && self.width != nil && self.height != nil {
|
|
37
37
|
self.previewView.frame = CGRect(x: self.x!, y: self.y!, width: min(height, self.width!), height: max(height, self.width!))
|
|
38
38
|
}
|
|
39
39
|
self.cameraController.previewLayer?.frame = self.previewView.frame
|
|
@@ -47,6 +47,7 @@ public class CameraPreview: CAPPlugin {
|
|
|
47
47
|
self.zoomFactor = call.getString("zoomFactor") ?? "wide"
|
|
48
48
|
self.highResolutionOutput = call.getBool("enableHighResolution") ?? false
|
|
49
49
|
self.cameraController.highResolutionOutput = self.highResolutionOutput
|
|
50
|
+
|
|
50
51
|
if call.getInt("width") != nil {
|
|
51
52
|
self.width = CGFloat(call.getInt("width")!)
|
|
52
53
|
} else {
|
|
@@ -68,7 +69,7 @@ public class CameraPreview: CAPPlugin {
|
|
|
68
69
|
self.storeToFile = call.getBool("storeToFile") ?? false
|
|
69
70
|
self.enableZoom = call.getBool("enableZoom") ?? false
|
|
70
71
|
self.disableAudio = call.getBool("disableAudio") ?? false
|
|
71
|
-
|
|
72
|
+
|
|
72
73
|
AVCaptureDevice.requestAccess(for: .video, completionHandler: { (granted: Bool) in
|
|
73
74
|
guard granted else {
|
|
74
75
|
call.reject("permission failed")
|
|
@@ -120,14 +121,6 @@ public class CameraPreview: CAPPlugin {
|
|
|
120
121
|
call.reject("failed to flip camera")
|
|
121
122
|
}
|
|
122
123
|
}
|
|
123
|
-
@objc func changeOrientation(_ call: CAPPluginCall) {
|
|
124
|
-
do {
|
|
125
|
-
try self.cameraController.changeOrientation()
|
|
126
|
-
call.resolve()
|
|
127
|
-
} catch {
|
|
128
|
-
call.reject("failed to change orientation")
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
124
|
|
|
132
125
|
@objc func stop(_ call: CAPPluginCall) {
|
|
133
126
|
DispatchQueue.main.async {
|
|
@@ -260,7 +253,7 @@ public class CameraPreview: CAPPlugin {
|
|
|
260
253
|
do {
|
|
261
254
|
var flashModeAsEnum: AVCaptureDevice.FlashMode?
|
|
262
255
|
switch flashMode {
|
|
263
|
-
case "off"
|
|
256
|
+
case "off":
|
|
264
257
|
flashModeAsEnum = AVCaptureDevice.FlashMode.off
|
|
265
258
|
case "on":
|
|
266
259
|
flashModeAsEnum = AVCaptureDevice.FlashMode.on
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capacitor-community-multilens-camerapreview",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "fork of capacitor community camera preview with support for switchting lenses",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -32,35 +32,42 @@
|
|
|
32
32
|
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
|
|
33
33
|
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
34
34
|
"verify:web": "npm run build",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
35
|
+
"build": "npm run clean && tsc && rollup -c rollup.config.js",
|
|
36
|
+
"clean": "rimraf './dist'",
|
|
37
|
+
"watch": "tsc --watch",
|
|
38
|
+
"lint": "concurrently -g \"npm:eslint\" \"npm:prettier -- --check\" \"npm run swiftlint -- lint ios\"",
|
|
39
|
+
"fmt": "concurrently -g \"npm:eslint -- --fix\" \"npm:prettier -- --write\" \"npm:swiftlint -- lint --fix --format ios\"",
|
|
37
40
|
"eslint": "eslint . --ext ts",
|
|
38
41
|
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
39
42
|
"swiftlint": "node-swiftlint",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"clean": "rimraf ./dist",
|
|
43
|
-
"watch": "tsc --watch",
|
|
44
|
-
"prepublishOnly": "npm run build"
|
|
43
|
+
"prepublishOnly": "npm run build",
|
|
44
|
+
"prepare": "husky install && npm run build"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@capacitor/android": "^
|
|
48
|
-
"@capacitor/core": "^
|
|
49
|
-
"@capacitor/
|
|
50
|
-
"@capacitor/ios": "^4.0.0",
|
|
47
|
+
"@capacitor/android": "^6.0.0",
|
|
48
|
+
"@capacitor/core": "^6.0.0",
|
|
49
|
+
"@capacitor/ios": "^6.0.0",
|
|
51
50
|
"@ionic/eslint-config": "^0.3.0",
|
|
52
|
-
"@ionic/prettier-config": "^
|
|
51
|
+
"@ionic/prettier-config": "^2.0.0",
|
|
53
52
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
53
|
+
"concurrently": "^7.0.0",
|
|
54
|
+
"eslint": "^7.32.0",
|
|
55
|
+
"husky": "^7.0.4",
|
|
56
|
+
"prettier": "^2.5.1",
|
|
57
|
+
"prettier-plugin-java": "^1.6.1",
|
|
58
|
+
"pretty-quick": "^3.1.3",
|
|
57
59
|
"rimraf": "^3.0.2",
|
|
58
|
-
"rollup": "^2.
|
|
60
|
+
"rollup": "^2.79.1",
|
|
59
61
|
"swiftlint": "^1.0.1",
|
|
60
|
-
"typescript": "
|
|
62
|
+
"typescript": "^4.3.2"
|
|
61
63
|
},
|
|
62
64
|
"peerDependencies": {
|
|
63
|
-
"@capacitor/core": "^
|
|
65
|
+
"@capacitor/core": "^6.0.0"
|
|
66
|
+
},
|
|
67
|
+
"husky": {
|
|
68
|
+
"hooks": {
|
|
69
|
+
"pre-commit": "pretty-quick --staged"
|
|
70
|
+
}
|
|
64
71
|
},
|
|
65
72
|
"prettier": "@ionic/prettier-config",
|
|
66
73
|
"swiftlint": "@ionic/swiftlint-config",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
require 'json'
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
-
|
|
5
|
-
Pod::Spec.new do |s|
|
|
6
|
-
s.name = 'CapacitorCommunityMultilensCamerapreview'
|
|
7
|
-
s.version = package['version']
|
|
8
|
-
s.summary = package['description']
|
|
9
|
-
s.license = package['license']
|
|
10
|
-
s.homepage = package['repository']['url']
|
|
11
|
-
s.author = package['author']
|
|
12
|
-
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
|
-
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
-
s.ios.deployment_target = '13.0'
|
|
15
|
-
s.dependency 'Capacitor'
|
|
16
|
-
s.swift_version = '5.1'
|
|
17
|
-
end
|