Camposer
1.0.3-rc01indexedMultifeature camera UI library for capturing photos and videos with zoom, tap-to-focus, flash/torch, exposure control, multi-lens support, 30/60 FPS recording, stabilization, and code scanning.
Multifeature camera UI library for capturing photos and videos with zoom, tap-to-focus, flash/torch, exposure control, multi-lens support, 30/60 FPS recording, stabilization, and code scanning.
📸 A Compose Multiplatform camera library for taking photos, recording videos, controlling flash/torch, zooming, and more.
✨ Check out the sample projects
Add the dependencies to your module build.gradle.kts, then sync your project:
// Android
dependencies {
implementation("io.github.ujizin:camposer:<version>")
}
// Kotlin Multiplatform
sourceSets {
commonMain.dependencies {
implementation("io.github.ujizin:camposer:<version>")
// Required when you want to use code analysis features (e.g., QR code scanning).
implementation("io.github.ujizin:camposer-code-scanner:<version>")
}
}
To show the CameraPreview composable, use the example below:
val controller = remember { CameraController() }
val cameraSession = rememberCameraSession(controller)
var camSelector by remember { mutableStateOf(CamSelector.Back) }
CameraPreview(
cameraSession = cameraSession,
camSelector = camSelector,
) {
// Camera Preview UI
}
Visit the docs to learn more: ujizin.github.io/Camposer
Use CameraSession and call takePicture:
// Capture into a temporary byte array
cameraSession.takePicture { result ->
/* ... */
}
// Capture into a file
cameraSession.takePicture(fileName) { result -> /* ... */ }
Set captureMode = CaptureMode.Video in CameraPreview, then call startRecording and stopRecording.
cameraSession.startRecording(fileName) { result ->
/* ... */
}
cameraSession.stopRecording()
To switch cameras, pass camSelector to CameraPreview (as shown above) and update its state.
// Front camera
camSelector = CamSelector.Front
// Back camera
camSelector = CamSelector.Back
// Toggle camera selector
camSelector = camSelector.inverse
To explore additional features, check the documentation.
Have fun code()! 👨💻
Camposer includes features inspired by react-native-vision-camera.
Copyright 2022 ujizin (Lucas Yuji)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance the License.
You may obtain a copy of the License at
http:
Unless applicable law agreed to writing, software
distributed under the License distributed an BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express implied.
See the License the specific language governing permissions
limitations under the License.
Surfaced from shared tags and platforms — no rankings paid for.