cap-go / camera-preview Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Are there any plans to update the dependencies to Capacitor 5?
I can't match 100% the preview size with the capturaSample size (with capture is even worse)
Currently I start the preview with only
position: "rear",
toBack: true,
and captureSame method with
quality: 100,
You can see the difference in the head of the bottle
( tag, that has the picture is full screen, is not cropped)
Preview:
Hi. What if we use camera preview only for taking photos.
Is it possible to dynamicaly check and request RECORD_AUDIO
permission even if client calls startRecordVideo
function?
Hi,
Camera preview doesn't work with native platforms, only white screen with out preview
IOS logs:
Loading app at capacitor://localhost...
To Native Cordova -> File requestAllPaths File731812688 ⚡️ [log] - onscript loading complete
["options": []]
To Native Cordova -> LottieSplashScreen initialAnimationEnded LottieSplashScreen731812689 ["options": []]
⚡️ WebView loaded
⚡️ To Native -> App addListener 120489526
⚡️ To Native -> Preferences get 120489527
⚡️ To Native -> Preferences get 120489528
⚡️ To Native -> Preferences get 120489529
⚡️ To Native -> Preferences get 120489530
⚡️ To Native -> Preferences get 120489531
⚡️ To Native -> Preferences get 120489532
⚡️ To Native -> CameraPreview start 120489533
⚡️ TO JS {"value":null}
⚡️ TO JS {"value":null}
⚡️ TO JS {"value":null}
⚡️ TO JS {"value":null}
⚡️ TO JS {"value":null}
⚡️ TO JS {"value":null}
⚡️ TO JS undefined
⚡️ To Native -> Preferences get 120489534
⚡️ To Native -> Preferences get 120489535
⚡️ To Native -> Preferences get 120489536
⚡️ TO JS {"value":null}
⚡️ TO JS {"value":null}
⚡️ TO JS {"value":null}
⚡️ To Native -> CameraPreview startRecordVideo 120489537
captureSessionIsMissing
ERROR MESSAGE: {"message":"Capture Session is Missing","errorMessage":"Capture Session is Missing"}
⚡️ [error] - {"message":"Capture Session is Missing","errorMessage":"Capture Session is Missing"}`
Android logs
08-08 16:35:59.912 D/Codec2Client(20974): Surface configure completed
08-08 16:35:59.912 D/SurfaceUtils(20974): disconnecting from surface 0xb4000071363b8470, reason disconnectFromSurface
08-08 16:35:59.912 D/CCodecBufferChannel(20974): [c2.exynos.h264.decoder#599] MediaCodec discarded an unknown buffer
08-08 16:35:59.912 D/CCodecBufferChannel(20974): [c2.exynos.h264.decoder#599] MediaCodec discarded an unknown buffer
08-08 16:35:59.912 D/CCodecBufferChannel(20974): [c2.exynos.h264.decoder#599] MediaCodec discarded an unknown buffer
08-08 16:35:59.912 D/CCodecBufferChannel(20974): [c2.exynos.h264.decoder#599] MediaCodec discarded an unknown buffer
08-08 16:35:59.912 D/CCodecBufferChannel(20974): [c2.exynos.h264.decoder#599] MediaCodec discarded an unknown buffer
08-08 16:35:59.912 D/CCodecBufferChannel(20974): [c2.exynos.h264.decoder#599] MediaCodec discarded an unknown buffer
08-08 16:35:59.912 D/CCodecBufferChannel(20974): [c2.exynos.h264.decoder#599] MediaCodec discarded an unknown buffer
08-08 16:35:59.912 D/CCodecBufferChannel(20974): [c2.exynos.h264.decoder#599] MediaCodec discarded an unknown buffer
08-08 16:35:59.912 D/CCodecBufferChannel(20974): [c2.exynos.h264.decoder#599] MediaCodec discarded an unknown buffer
08-08 16:35:59.913 W/cr_MediaCodecBridge(20974): Codec released
08-08 16:35:59.923 I/hw-BpHwBinder(20974): onLastStrongRef automatically unlinking death recipients
08-08 16:35:59.923 D/SurfaceUtils(20974): disconnecting from surface 0xb4000071362b6ae0, reason disconnectFromSurface
08-08 16:35:59.923 E/BufferQueueProducer(20974): [MediaCodec.release](id:51ee00000007,api:0,p:-1,c:20974) detachBuffer: BufferQueue has no connected producer
08-08 16:36:04.704 D/BufferPoolAccessor2.0(20974): bufferpool2 0xb40000709630f598 : 0(0 size) total buffers - 0(0 size) used buffers - 11/17 (recycle/alloc) - 6/13 (fetch/transfer)
08-08 16:36:04.705 D/BufferPoolAccessor2.0(20974): evictor expired: 1, evicted: 1
08-08 16:36:05.705 D/BufferPoolAccessor2.0(20974): bufferpool2 0xb4000070962e46c8 : 0(0 size) total buffers - 0(0 size) used buffers - 7/12 (recycle/alloc) - 5/8 (fetch/transfer)
08-08 16:36:05.705 D/BufferPoolAccessor2.0(20974): bufferpool2 0xb4000070963088e8 : 0(0 size) total buffers - 0(0 size) used buffers - 12/18 (recycle/alloc) - 6/14 (fetch/transfer)
08-08 16:36:05.705 D/BufferPoolAccessor2.0(20974): evictor expired: 2, evicted: 2
08-08 16:36:07.628 W/cr_media(20974): Requires MODIFY_AUDIO_SETTINGS and RECORD_AUDIO. No audio device will be available for recording
08-08 16:36:07.690 D/Preview (20974): screen is rotated 0deg from natural
08-08 16:36:07.690 D/Preview (20974): back camera is oriented -90deg from natural
08-08 16:36:07.690 D/Preview (20974): need to rotate preview 90deg
08-08 16:36:07.691 D/CameraActivity(20974): cameraCurrentlyLocked:0
08-08 16:36:07.711 I/CameraManagerGlobal(20974): Connecting to camera service
08-08 16:36:07.712 D/Preview (20974): optimal preview size: w: 2048 h: 1536
08-08 16:36:07.712 D/Preview (20974): optimal preview size: w: 2048 h: 1536
08-08 16:36:07.718 D/Preview (20974): center vertically
08-08 16:36:07.718 D/layout (20974): left:0
08-08 16:36:07.718 D/layout (20974): top:-1060
08-08 16:36:07.718 D/layout (20974): right:2401
08-08 16:36:07.718 D/layout (20974): bottom:2141
08-08 16:36:07.718 D/Preview (20974): optimal preview size: w: 176 h: 144
08-08 16:36:07.718 D/Preview (20974): optimal preview size: w: 176 h: 144
08-08 16:36:07.718 D/Preview (20974): optimal preview size: w: 176 h: 144
08-08 16:36:07.720 D/Preview (20974): optimal preview size: w: 2048 h: 1536
08-08 16:36:07.799 W/cr_media(20974): Requires MODIFY_AUDIO_SETTINGS and RECORD_AUDIO. No audio device will be available for recording
08-08 16:36:07.801 D/Preview (20974): optimal preview size: w: 2048 h: 1536
08-08 16:36:07.801 D/Preview (20974): optimal preview size: w: 2048 h: 1536`
full android logs from browser stack:
app-arm64-v8a-release.apk_2023_8_8_16_53_46.log
JS options:
CameraPreviewOptions = {
parent: "style_story_container",
className: "video_container",
width: height,
height: width,
toBack: true,
};
All dependencies
"dependencies": {
"@awesome-cordova-plugins/core": "^6.2.0",
"@awesome-cordova-plugins/lottie-splash-screen": "^6.2.0",
"@capacitor/android": "4.4.0",
"@capacitor/app": "4.1.0",
"@capacitor/camera": "^4.1.4",
"@capacitor/core": "4.4.0",
"@capacitor/filesystem": "^4.1.4",
"@capacitor/haptics": "4.0.1",
"@capacitor/ios": "4.4.0",
"@capacitor/keyboard": "4.0.1",
"@capacitor/preferences": "^4.0.2",
"@capacitor/status-bar": "4.0.1",
"@capgo/camera-preview": "^6.0.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@ffmpeg/core": "^0.11.0",
"@ffmpeg/ffmpeg": "^0.11.6",
"@ionic-native/core": "^5.36.0",
"@ionic-native/lottie-splash-screen": "^5.36.0",
"@ionic-native/media-capture": "^5.36.0",
"@ionic/cli": "^7.1.1",
"@ionic/pwa-elements": "^3.1.1",
"@ionic/react": "^6.0.0",
"@ionic/react-router": "^6.0.0",
"@mui/icons-material": "^5.10.9",
"@mui/material": "^5.10.15",
"@react-oauth/google": "^0.11.0",
"@react-spring/web": "^9.7.2",
"@reduxjs/toolkit": "^1.8.6",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^12.6.3",
"@use-gesture/react": "^10.2.24",
"antd": "^5.7.0",
"axios": "^1.1.3",
"com-sarriaroman-photoviewer": "^1.2.5",
"cordova-plugin-androidx-adapter": "^1.1.3",
"cordova-plugin-file": "^7.0.0",
"cordova-plugin-lottie-splashscreen": "^0.9.6",
"cordova-plugin-media-capture": "^4.0.0",
"dayjs": "^1.11.7",
"draft-js": "^0.11.7",
"draft-js-mention-plugin": "^3.1.5",
"draft-js-plugins-editor": "^3.0.0",
"firebase": "^9.17.2",
"formik": "^2.2.9",
"html2canvas": "^1.4.1",
"i18next": "^22.0.4",
"i18next-browser-languagedetector": "^7.0.1",
"ionicons": "^6.0.3",
"javascript-time-ago": "^2.5.9",
"jimp": "^0.22.8",
"js-sha256": "^0.9.0",
"libphonenumber-js": "1.10.36",
"lottie-web": "^5.10.0",
"patch-package": "^6.5.0",
"react": "^18.2.0",
"react-apple-login": "^1.1.6",
"react-apple-signin-auth": "^1.0.9",
"react-auth-code-input": "^3.2.1",
"react-code-input": "^3.10.1",
"react-convert-image": "^0.5.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.39.4",
"react-i18next": "^12.0.0",
"react-icons": "^4.7.1",
"react-imask": "7.0.1",
"react-inlinesvg": "^3.0.1",
"react-media-recorder": "^1.6.6",
"react-mentions": "^4.4.7",
"react-pin-field": "^3.1.3",
"react-redux": "^8.0.4",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^5.0.0",
"react-simple-keyboard": "^3.5.53",
"react-spring": "^9.7.1",
"react-swipeable": "^7.0.0",
"react-virtuoso": "^4.1.0",
"react-zoom-pan-pinch": "^3.0.7",
"redux-logger": "^3.0.6",
"shortid": "^2.2.16",
"styled-components": "^5.3.6",
"swiper": "^9.1.0",
"typescript": "^4.5.2",
"universal-cookie": "^4.0.4",
"uuid": "^9.0.0",
"web-vitals": "^1.1.2",
"workbox-background-sync": "^5.1.4",
"workbox-broadcast-update": "^5.1.4",
"workbox-cacheable-response": "^5.1.4",
"workbox-core": "^5.1.4",
"workbox-expiration": "^5.1.4",
"workbox-google-analytics": "^5.1.4",
"workbox-navigation-preload": "^5.1.4",
"workbox-precaching": "^5.1.4",
"workbox-range-requests": "^5.1.4",
"workbox-routing": "^5.1.4",
"workbox-strategies": "^5.1.4",
"workbox-streams": "^5.1.4"
},
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are awaiting their schedule. Click on a checkbox to get an update now.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
ios/Podfile
.github/workflows/build.yml
actions/checkout v4
pnpm/action-setup v2
actions/setup-node v3
actions/setup-java v3
actions/checkout v4
pnpm/action-setup v2
actions/setup-node v3
actions/checkout v4
pnpm/action-setup v2
actions/setup-node v3
JS-DevTools/npm-publish v1
JS-DevTools/npm-publish v1
.github/workflows/bump_version.yml
actions/checkout v4
pnpm/action-setup v2
actions/setup-node v3
actions/checkout v4
pnpm/action-setup v2
actions/setup-node v3
.github/workflows/test.yml
actions/checkout v4
pnpm/action-setup v2
actions/setup-node v3
actions/setup-java v3
actions/checkout v4
pnpm/action-setup v2
actions/setup-node v3
actions/checkout v4
pnpm/action-setup v2
actions/setup-node v3
android/gradle.properties
android/settings.gradle
android/build.gradle
com.android.tools.build:gradle 8.4.1
androidx.exifinterface:exifinterface 1.3.7
demo/android/gradle.properties
demo/android/capacitor.settings.gradle
demo/android/settings.gradle
demo/android/variables.gradle
androidx.appcompat:appcompat 1.6.1
androidx.coordinatorlayout:coordinatorlayout 1.2.0
androidx.core:core-splashscreen 1.0.1
junit:junit 4.13.2
androidx.test.ext:junit 1.1.5
androidx.test.espresso:espresso-core 3.5.1
demo/android/build.gradle
com.android.tools.build:gradle 8.4.1
com.google.gms:google-services 4.4.2
demo/android/app/capacitor.build.gradle
demo/android/app/build.gradle
android/gradle/wrapper/gradle-wrapper.properties
gradle 8.8
demo/android/gradle/wrapper/gradle-wrapper.properties
gradle 8.8
demo/package.json
@capacitor/filesystem ^6.0.0
@capacitor/toast ^6.0.0
typescript ^5.0.0
vite ^4.0.0
package.json
@antfu/eslint-config ^2.16.1
@capacitor/android ^6.0.0
@capacitor/cli ^6.0.0
@capacitor/core ^6.0.0
@capacitor/docgen ^0.2.2
@capacitor/ios ^6.0.0
@ionic/prettier-config ^4.0.0
@ionic/swiftlint-config ^1.1.2
eslint ^9.1.1
husky ^9.0.11
prettier ^3.2.5
prettier-plugin-java ^2.6.0
rimraf ^5.0.5
rollup ^4.17.1
swiftlint ^1.0.2
typescript ^5.4.5
@capacitor/core ^6.0.0
Hello,
I'm facing an issue setting captured image size in iOS & Android
I'm using capacitor 6 and plugin version 6.2.13
When i set the image size :
return CameraPreview.capture({
quality: 66,
width: 600,
height: 1000
});
The captured image will never have the resolution i've chosen ! The only thing i can control is the quality
Any solution to this ?
are we getting video recording in iOS?
The plugin uses a deprecated lib to do its job, it could be nice to migrate it to the newest lib.
Any of the 2 options is great if All features work properly
startRecording on android crashed the app.
Demo repo:
Git repo
As described in the release notes of AGP 8, instead of
package="com.ahm.capacitor.camera.preview.capacitorcamerapreview"
in AndroidManifest.xml
it is expected to set the package name in build.gradle as follows:
android {
namespace 'com.ahm.capacitor.camera.preview.capacitorcamerapreview'
...
projects using this plugin cannot upgrade to AGP 8 as outlined in the upgrade guide for Capacitor 5.
Hi,
Thanks for the hard work on updating this library.
I've noticed that the actual types / results for the stopRecordVideo
function doesn't match up with the docs. The actual return type is Promise. So theres no file path of the video once its captured.
An update for this would be greatly appreciated as at the moment the video recording can't be used.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.