カテゴリー・パッケージ・リポジトリを検索

パッケージ詳細v1.0.0

flutter_camera

iOS および Android 向けの Flutter プラグインで、デバイスのカメラにアクセスして動画を録画できます。

AndroidiOSWeb
30日間ダウンロード
83
いいね数
25
Pub ポイント
120

パッケージをインストール

flutter pub add flutter_camera

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Flutter Camera は、Android、iOS、Web でデバイスのカメラにアクセスして動画を記録できる、Flutter用のクロスプラットフォームプラグインです。画像の撮影、ライブカメラプレビューのストリーミング、高品質な動画の録画を行うためのシンプルなAPIを提供しています。シンプルさとパフォーマンスを重視して設計されており、フォーカス、フラッシュ制御、解像度選択などの一般的なカメラ操作をサポートしています。写真共有、ビデオ通話、拡張現実機能など、リアルタイムでのカメラ統合が必要なアプリケーションに最適です。

用途

  • 動画録画
  • 画像のキャプチャ
  • ライブカメラプレビュー
  • 拡張現実アプリ
  • ビデオ会議
  • 文書スキャン

主な機能

  • クロスプラットフォーム対応
  • ライブカメラストリーミング
  • 動画録画
  • 画像のキャプチャ
  • フォーカスとフラッシュ制御
  • 解像度のカスタマイズ

適している対象

  • モバイルアプリ開発者
  • リアルタイムカメラアプリケーション
  • メディア豊富なアプリ
  • Web とモバイルのハイブリッドプロジェクト
  • AR/VR統合

注意事項

  • Android および iOS でのカメラ権限が必要です
  • 一部のブラウザでのWebカメラ対応が限定的
  • 低性能デバイスではパフォーマンスが異なる場合があります
  • Webデプロイに追加の構成が必要です
  • プラットフォーム固有のエッジケースの処理が必要になる場合があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Flutter Camera

pub package

A Flutter plugin for iOS and Android allowing access to the device cameras and recording of videos.

Note: This plugin is still under development, and some APIs might not be available yet. We are working on a refactor which can be followed here: issue

This package fully depends on flutter camera plugin to provide access to camera.

It only supports Android and IOS for now

Features

  • Display live camera preview in a widget.
  • Snapshots can be captured and path is returned.
  • Device flash light support.
  • Record video from camera.
  • Add access to the image stream from Dart.
  • Live camera flip ( switch between rear & front camera with a click ).
  • Only 3 lines of code

Installation

First, add flutter_camera as a dependency in your pubspec.yaml file.

iOS

The camera plugin functionality works on iOS 10.0 or higher. If compiling for any version lower than 10.0, make sure to programmatically check the version of iOS running on the device before using any camera plugin features. The device_info_plus plugin, for example, can be used to check the iOS version.

Add two rows to the ios/Runner/Info.plist:

  • one with the key Privacy - Camera Usage Description and a usage description.
  • and one with the key Privacy - Microphone Usage Description and a usage description.

Or in text format add the key:

<key>NSCameraUsageDescription</key>
<string>Can I use the camera please?</string>
<key>NSMicrophoneUsageDescription</key>
<string>Can I use the mic please?</string>
Android

Change the minimum Android sdk version to 21 (or higher) in your android/app/build.gradle file.

minSdkVersion 21
Example

Here is a small example flutter app displaying a full screen camera preview with video recording.

import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_camera/flutter_camera.dart';

class CameraPage extends StatefulWidget {
  const CameraPage({Key? key}) : super(key: key);

  @override
  _CameraPageState createState() => _CameraPageState();
}

class _CameraPageState extends State<CameraPage> {
  @override
  Widget build(BuildContext context) {
    return FlutterCamera(
      color: Colors.amber,
      onImageCaptured: (value) {
        final path = value.path;
        print("::::::::::::::::::::::::::::::::: $path");
        if (path.contains('.jpg')) {
          showDialog(
              context: context,
              builder: (context) {
                return AlertDialog(
                  content: Image.file(File(path)),
                );
              });
        }
      },
      onVideoRecorded: (value) {
        final path = value.path;
        print('::::::::::::::::::::::::;; dkdkkd $path');
        ///Show video preview .mp4
      },
    );
    // return Container();
  }
}

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。