4
4
5
5
import 'dart:async' ;
6
6
7
+ import 'package:camera_platform_interface/src/method_channel/method_channel_camera.dart' ;
8
+ import 'package:file_selector_platform_interface/file_selector_platform_interface.dart' ;
7
9
import 'package:flutter/widgets.dart' ;
8
10
import 'package:plugin_platform_interface/plugin_platform_interface.dart' ;
9
- import 'package:camera_platform_interface/src/method_channel/method_channel_camera.dart' ;
10
11
11
12
import '../../camera_platform_interface.dart' ;
12
13
@@ -66,8 +67,8 @@ abstract class CameraPlatform extends PlatformInterface {
66
67
throw UnimplementedError ('onCameraError() is not implemented.' );
67
68
}
68
69
69
- /// Captures an image and saves it to [path] .
70
- Future <void > takePicture (int cameraId, String path ) {
70
+ /// Captures an image and returns the file where it was saved .
71
+ Future <XFile > takePicture (int cameraId) {
71
72
throw UnimplementedError ('takePicture() is not implemented.' );
72
73
}
73
74
@@ -76,19 +77,19 @@ abstract class CameraPlatform extends PlatformInterface {
76
77
throw UnimplementedError ('prepareForVideoRecording() is not implemented.' );
77
78
}
78
79
79
- /// Start a video recording and save the file to [path] .
80
- ///
81
- /// A path can for example be obtained using
82
- /// [path_provider] (https://pub.dartlang.org/packages/path_provider).
80
+ /// Starts a video recording and returns the file where it will be saved.
83
81
///
84
82
/// The file is written on the flight as the video is being recorded.
85
- /// If a file already exists at the provided path an error will be thrown.
86
83
/// The file can be read as soon as [stopVideoRecording] returns.
87
- Future <void > startVideoRecording (int cameraId, String path ) {
84
+ Future <XFile > startVideoRecording (int cameraId) {
88
85
throw UnimplementedError ('startVideoRecording() is not implemented.' );
89
86
}
90
87
91
- /// Stop the video recording.
88
+ /// Stops the video recording.
89
+ ///
90
+ /// When the [stopVideoRecording] method completes successfully the recorded
91
+ /// video can be accessed through the file returned by the
92
+ /// [startVideoRecording] method.
92
93
Future <void > stopVideoRecording (int cameraId) {
93
94
throw UnimplementedError ('stopVideoRecording() is not implemented.' );
94
95
}
0 commit comments