-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[image_picker] Add videoQuality parameter - platform_interface #11144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Koichi5
wants to merge
1
commit into
flutter:main
Choose a base branch
from
Koichi5:feat/image_picker_video_quality_platform_interface
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+31
−0
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -241,6 +241,8 @@ abstract class ImagePickerPlatform extends PlatformInterface { | |
| /// The `preferredCameraDevice` is ignored when `source` is [ImageSource.gallery]. It is also ignored if the chosen camera is not supported on the device. | ||
| /// Defaults to [CameraDevice.rear]. | ||
| /// | ||
| /// The [quality] argument specifies the video quality for recording/picking. Defaults to [VideoQuality.high]. | ||
| /// | ||
| /// In Android, the MainActivity can be destroyed for various reasons. If that happens, the result will be lost | ||
| /// in this call. You can then call [getLostData] when your app relaunches to retrieve the lost data. | ||
| /// | ||
|
|
@@ -249,6 +251,7 @@ abstract class ImagePickerPlatform extends PlatformInterface { | |
| required ImageSource source, | ||
| CameraDevice preferredCameraDevice = CameraDevice.rear, | ||
| Duration? maxDuration, | ||
| VideoQuality quality = VideoQuality.high, | ||
| }) { | ||
| throw UnimplementedError('getVideo() has not been implemented.'); | ||
| } | ||
|
|
@@ -390,6 +393,7 @@ abstract class CameraDelegatingImagePickerPlatform extends ImagePickerPlatform { | |
| required ImageSource source, | ||
| CameraDevice preferredCameraDevice = CameraDevice.rear, | ||
| Duration? maxDuration, | ||
| VideoQuality quality = VideoQuality.high, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| }) async { | ||
| if (source == ImageSource.camera) { | ||
| final ImagePickerCameraDelegate? delegate = cameraDelegate; | ||
|
|
@@ -410,6 +414,7 @@ abstract class CameraDelegatingImagePickerPlatform extends ImagePickerPlatform { | |
| source: source, | ||
| preferredCameraDevice: preferredCameraDevice, | ||
| maxDuration: maxDuration, | ||
| quality: quality, | ||
| ); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/image_picker/image_picker_platform_interface/lib/src/types/video_quality.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // Copyright 2013 The Flutter Authors | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| /// Video quality setting for video recording/picking. | ||
| /// | ||
| /// This enum corresponds to `UIImagePickerControllerQualityType` on iOS. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| enum VideoQuality { | ||
| /// Low quality video. | ||
| /// | ||
| /// Corresponds to `UIImagePickerControllerQualityTypeLow` on iOS. | ||
| low, | ||
|
|
||
| /// Medium quality video. | ||
| /// | ||
| /// Corresponds to `UIImagePickerControllerQualityTypeMedium` on iOS. | ||
| medium, | ||
|
|
||
| /// High quality video. | ||
| /// | ||
| /// Corresponds to `UIImagePickerControllerQualityTypeHigh` on iOS. | ||
| /// This is the default quality setting. | ||
| high, | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
qualityparameter is not being used. It needs to be passed down to the native implementation.This will require:
qualityto_getVideoPath._getVideoPathto acceptqualityand pass it to the method channel invocation forpickVideo.