Apparence-io / CamerAwesome

📸 Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
906 stars 199 forks source link

video recording can't save in ExternalStorageDirectory #460

Open chaoyifei opened 2 months ago

chaoyifei commented 2 months ago

Steps to Reproduce

video recording can't save in ExternalStorageDirectory on physical but works on virtual device ,and there not have any error

        pathBuilder: (sensors) async {
              final Directory extDir = await getExternalStorageDirectory();
              final testDir = await Directory(
                '${extDir.path}/camerawesome',
              ).create(recursive: true);
              if (sensors.length == 1) {
                final String filePath =
                    '${testDir.path}/${DateTime.now().millisecondsSinceEpoch}.jpg';
                return SingleCaptureRequest(filePath, sensors.first);
              }
              // Separate pictures taken with front and back camera
              return MultipleCaptureRequest(
                {
                  for (final sensor in sensors)
                    sensor:
                        '${testDir.path}/${sensor.position == SensorPosition.front ? 'front_' : "back_"}${DateTime.now().millisecondsSinceEpoch}.jpg',
                },
              );
            },

when i logging Permission.storage.status

 pathBuilder: (sensors) async {
              print(await Permission.storage.status)
              final Directory extDir = await getExternalStorageDirectory();
               ...............

The log is I/flutter (16148): PermissionStatus.denied

Expected results

What it should be

Actual results

What you see

About your device

Brand Model OS
vivo v2338a android u

Your flutter version

Run this in your command line 3.19 android api 34

Paste the result here