truvideo_camera_sdk 1.0.3 copy "truvideo_camera_sdk: ^1.0.3" to clipboard
truvideo_camera_sdk: ^1.0.3 copied to clipboard

Access the device camera to capture photos and videos, saving them in the app’s storage and returning file paths for use.

Truvideo Camera SDK #

This plugin integrates TruvideoCameraSdk for capturing photos and videos.

Supported Platforms #

  • Android
  • iOS

Features #

  • Opens the camera with configurations
  • Supports front/rear camera selection
  • Captures images and records videos
  • Handles camera events
  • AR Camera with augmented reality overlays (iOS: ARKit, Android: ARCore)
  • Smart Scanner QR/barcode detection
  • Check AR hardware support and required AR framework installation

Requirements #

  • Flutter SDK
  • TruvideoCameraSdk Plugin

Setup #

  1. Add TruvideoCameraSdk Plugin to your project.
  2. Install dependencies:
    flutter pub get
    
  3. Ensure proper permissions in AndroidManifest.xml & Info.plist.
  4. Run the app:
    flutter run
    

Usage #

  • Listen to camera events:

    TruvideoCameraSdk.events.listen((event) {
      print("Event: \${event.type}, Data: \${event.data?.toJson()}");
    });
    
  • Open camera:

  Future<void> openCamera(String outputPath) async {
  final config = CameraConfiguration(
    lensFacing: TruvideoSdkCameraLensFacing.back,
    flashMode: TruvideoSdkCameraFlashMode.off,
    orientation: TruvideoSdkCameraOrientation.portrait,
    outputPath: outputPath ?? '',
    mode: CameraMode.videoAndImage(
      videoMaxCount: 3,
      imageMaxCount: 5,
      durationLimit: 5000, // Video duration limit (in Milliseconds),
    ),
  );

  try {
    List<TruvideoSdkCameraMedia> result = await TruvideoCameraSdk.openCamera(
      configuration: config,
    );
    for (var media in result) {
      print('Captured: ${media.filePath} – ${media.type}');
    }
  } on PlatformException catch (e) {
    print('Camera error: ${e.message}');
  }
}
  • Open AR Camera
Future<void> openARCamera(String outputPath) async {
  final config = ArCameraConfiguration(
    orientation: TruvideoSdkCameraOrientation.portrait,
    outputPath: outputPath,
    mode:CameraMode.videoAndImage(),
  );

  try {
    List<TruvideoSdkCameraMedia> result =
    await TruvideoCameraSdk.openArCamera(configuration: config);

    for (var media in result) {
      print('Captured: ${media.filePath} – ${media.type}');
    }
  } on PlatformException catch (e) {
    print('AR Camera error: ${e.message}');
  }
}
  • Open Scanner
Future<void> openScanner() async {
  try {
    String? result = await TruvideoCameraSdk.openScanner();
    if (result != null) {
      print('Result text: $result');
    } else {
      print('Result not found or scanner cancelled by user');
    }
  } on PlatformException catch (e) {
    print('Scanner error: ${e.message}');
  }
}

License #

MIT #

Support #

If you have any questions or suggestions regarding the SDK, please contact us at [email protected].

1
likes
150
points
355
downloads

Publisher

verified publishertruvideo.com

Weekly Downloads

Access the device camera to capture photos and videos, saving them in the app’s storage and returning file paths for use.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on truvideo_camera_sdk

Packages that implement truvideo_camera_sdk