website/docs/controls/camera/index.md
import TabItem from '@theme/TabItem'; import Tabs from '@theme/Tabs'; import {ClassAll, CodeExample} from '@site/src/components/crocodocs';
Display a live camera preview, capture photos and videos, and stream camera frames directly in your Flet apps.
Powered by the camera Flutter package.
| Platform | iOS | Android | Web | Windows | macOS | Linux |
|---|---|---|---|---|---|---|
| Supported | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
Add the flet-camera package to your project dependencies:
requirements.txt or pyproject.toml.
</TabItem>
The below sections show the required configurations for each platform.
Configuration to be made to access the camera and optionally the microphone:
android.permission.CAMERA: Allows camera usage.android.permission.RECORD_AUDIO (optional): Allows video recording with audio.Configuration to be made to access the camera and optionally the microphone:
NSCameraUsageDescription: Required for camera usage.NSMicrophoneUsageDescription (optional): Required only for video recording with audio. For example, when enable_audio parameter of Camera.initialize is set to True (default).Additionally/alternatively, you can make use of our predefined cross-platform camera (and optionally microphone)
permission bundles:
<CodeExample path={frontMatter.examples + '/example_1/main.py'} language="python" />