Skip to content
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

This PR includes 4 changes #780

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1cbe8b1
show UI for video compression options
Oct 11, 2022
8a32cf9
remove old file else its not deleted from temp folder
Oct 11, 2022
4be3ea9
user default sort descriptor as modificationDate
Oct 11, 2022
7078615
updated version to 5.3.0
Oct 12, 2022
978e3a9
Merge pull request #1 from niralishaha25/dev
niralishaha25 Oct 12, 2022
84318c6
included YPVideoCompressionVC.storyboard in build phase
Nov 1, 2022
f4966c7
fixed crash in YPImagePicker. selected video and then click on cancel
Nov 1, 2022
7f8ccf6
Merge pull request #2 from niralishaha25/dev
niralishaha25 Nov 1, 2022
dd65901
Revert "included YPVideoCompressionVC.storyboard in build phase"
Nov 1, 2022
28c675e
added storyboard to resources
Nov 1, 2022
e06ed7c
Merge pull request #3 from niralishaha25/dev
niralishaha25 Nov 1, 2022
b9843e6
no message
Nov 1, 2022
fcc030c
Merge pull request #4 from niralishaha25/dev
niralishaha25 Nov 1, 2022
e2cb258
added Bundle for YPVideoCompressionVC
Nov 1, 2022
4f69fdb
Merge pull request #5 from niralishaha25/dev
niralishaha25 Nov 1, 2022
7d9e81e
fixed bug in picking multiple videos with compress options
Nov 1, 2022
15d7ff7
Merge pull request #6 from niralishaha25/dev
niralishaha25 Nov 1, 2022
1a1b84b
fix in video compression
Nov 10, 2022
5eaa916
Merge pull request #7 from niralishaha25/dev
niralishaha25 Nov 10, 2022
cb0c721
fix bug in video compression
Nov 10, 2022
ac4c5ff
Merge pull request #8 from niralishaha25/dev
niralishaha25 Nov 10, 2022
a669169
The compression and sorting option is completely configurable
Nov 10, 2022
020dc3d
Merge pull request #9 from niralishaha25/dev
niralishaha25 Nov 10, 2022
52f4446
keep original as default vide compression option
Jan 11, 2023
7e194f9
Merge pull request #10 from niralishaha25/dev
niralishaha25 Jan 11, 2023
97c361f
keep original as default vide compression option
Jan 11, 2023
067431a
Merge pull request #11 from niralishaha25/dev
niralishaha25 Jan 11, 2023
58a0beb
Added option to select more photos
Jan 12, 2023
03e58e0
Merge pull request #12 from niralishaha25/dev
niralishaha25 Jan 12, 2023
ccb78c8
stop spinner when 0 selected items
Jan 12, 2023
e1ebc9a
Merge pull request #13 from niralishaha25/dev
niralishaha25 Jan 12, 2023
dc38032
spinner should be public
Jan 12, 2023
3164db0
Merge pull request #14 from niralishaha25/dev
niralishaha25 Jan 12, 2023
b6b33ff
added see all photos option for limited photo
Jan 17, 2023
b5f8513
Merge pull request #15 from niralishaha25/dev
niralishaha25 Jan 17, 2023
678dc12
fix in added buttons bottom constraint
Jan 18, 2023
b3320f4
Merge pull request #16 from niralishaha25/dev
niralishaha25 Jan 18, 2023
b4ceb52
updated bottom constraint of button
Jan 20, 2023
2340b58
Merge pull request #17 from niralishaha25/dev
niralishaha25 Jan 20, 2023
4d40d0c
fixed bug in showing select more photos options when defaultMultipleS…
Jan 20, 2023
f8db4d2
Merge pull request #18 from niralishaha25/dev
niralishaha25 Jan 20, 2023
767be82
fix bug in select more when no photo selected for limited mode
Jan 20, 2023
8634b0e
Merge pull request #19 from niralishaha25/dev
niralishaha25 Jan 20, 2023
adb12c5
stop spinner if photo permission not given
Jan 30, 2023
3c0f2b9
Merge pull request #20 from niralishaha25/dev
niralishaha25 Jan 30, 2023
736fc0f
Single media in single album deselect crash fix
RonitOfficial Oct 1, 2024
29b66da
Merge pull request #21 from RonitOfficial/master
niralishaha25 Oct 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Example/ExampleViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class ExampleViewController: UIViewController {
/* Choose what media types are available in the library. Defaults to `.photo` */
config.library.mediaType = .photoAndVideo
config.library.itemOverlayType = .grid
config.library.sortingOption = .creationDate
/* Enables selecting the front camera by default, useful for avatars. Defaults to false */
// config.usesFrontCamera = true

Expand Down Expand Up @@ -133,6 +134,8 @@ class ExampleViewController: UIViewController {
/* Defines the time limit for videos from the library.
Defaults to 60 seconds. */
config.video.libraryTimeLimit = 500.0

config.video.compressionOption = [compressionOptions.AVAssetExportPreset640x480,compressionOptions.AVAssetExportPreset1920x1080, compressionOptions.AVAssetExportPresetPassthrough]

/* Adds a Crop step in the photo taking process, after filters. Defaults to .none */
config.showsCrop = .rectangle(ratio: (16/9))
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/freshOS/Stevia",
"state": {
"branch": null,
"revision": "87dd17a86240f16788239a78dd8be11c4b013150",
"version": "4.8.0"
"revision": "cfb1a1d2159277bb553c3dc46f3f742c0275566d",
"version": "5.1.2"
}
}
]
Expand Down
80 changes: 80 additions & 0 deletions Source/Configuration/YPImagePickerConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ public struct YPImagePickerConfiguration {
/// Defines the text colour to be shown when a bottom option is unselected
public var bottomMenuItemUnSelectedTextColour: UIColor = .ypSecondaryLabel

/// Defines the text colour to be shown for selectMoreButton
public var selectMoreButtonBackgroundColour: UIColor = .ypSystemBlue

/// Defines the text colour to be shown for seeAllPhotoButton
public var seeAllPhotosButtonBackgroundColour: UIColor = .ypSystemBlue

/// Defines the max camera zoom factor for camera. Disable camera zoom with 1. Default is 1.
public var maxCameraZoomFactor: CGFloat = 1.0

Expand Down Expand Up @@ -227,6 +233,9 @@ public struct YPConfigLibrary {

/// Set the overlay type shown on top of the selected library item
public var itemOverlayType: YPItemOverlayType = .grid

/// The library items are sorted by time created or modified
public var sortingOption: SortingOption = SortingOption.creationDate
}

/// Encapsulates video specific settings.
Expand All @@ -246,6 +255,9 @@ public struct YPConfigVideo {
*/
public var compression: String = AVAssetExportPresetHighestQuality

/// Choose the different video compression option to be supported
public var compressionOption: [compressionOptions] = [compressionOptions.AVAssetExportPresetPassthrough]

/// Choose the result video extension if you trim or compress a video. Defaults to mov.
public var fileType: AVFileType = .mov

Expand Down Expand Up @@ -304,3 +316,71 @@ public enum YPlibraryMediaType {
case video
case photoAndVideo
}

public enum SortingOption: String {
case modificationDate = "modificationDate"
case creationDate = "creationDate"
}

public enum compressionOptions: String {
case AVAssetExportPresetLowQuality
case AVAssetExportPreset640x480
case AVAssetExportPresetMediumQuality
case AVAssetExportPreset1920x1080
case AVAssetExportPreset1280x720
case AVAssetExportPresetHighestQuality
case AVAssetExportPresetAppleM4A
case AVAssetExportPreset3840x2160
case AVAssetExportPreset960x540
case AVAssetExportPresetPassthrough

func presetID() -> String {
switch self {
case .AVAssetExportPresetLowQuality:
return "AVAssetExportPresetLowQuality"
case .AVAssetExportPreset640x480:
return "AVAssetExportPreset640x480"
case .AVAssetExportPresetMediumQuality:
return "AVAssetExportPresetMediumQuality"
case .AVAssetExportPreset1920x1080:
return "AVAssetExportPreset1920x1080"
case .AVAssetExportPreset1280x720:
return "AVAssetExportPreset1280x720"
case .AVAssetExportPresetHighestQuality:
return "AVAssetExportPresetHighestQuality"
case .AVAssetExportPresetAppleM4A:
return "AVAssetExportPresetAppleM4A"
case .AVAssetExportPreset3840x2160:
return "AVAssetExportPreset3840x2160"
case .AVAssetExportPreset960x540:
return "AVAssetExportPreset960x540"
case .AVAssetExportPresetPassthrough:
return "AVAssetExportPresetPassthrough"
}
}

func getLabel() -> String {
switch self {
case .AVAssetExportPresetLowQuality:
return YPConfig.wordings.textAVAssetExportPresetLowQuality
case .AVAssetExportPreset640x480:
return YPConfig.wordings.textAVAssetExportPreset640x480
case .AVAssetExportPresetMediumQuality:
return YPConfig.wordings.textAVAssetExportPresetMediumQuality
case .AVAssetExportPreset1920x1080:
return YPConfig.wordings.textAVAssetExportPreset1920x1080
case .AVAssetExportPreset1280x720:
return YPConfig.wordings.textAVAssetExportPreset1280x720
case .AVAssetExportPresetHighestQuality:
return YPConfig.wordings.textAVAssetExportPresetHighestQuality
case .AVAssetExportPresetAppleM4A:
return YPConfig.wordings.textAVAssetExportPresetAppleM4A
case .AVAssetExportPreset3840x2160:
return YPConfig.wordings.textAVAssetExportPreset3840x2160
case .AVAssetExportPreset960x540:
return YPConfig.wordings.textAVAssetExportPreset960x540
case .AVAssetExportPresetPassthrough:
return YPConfig.wordings.textAVAssetExportPresetPassthrough
}
}
}
11 changes: 11 additions & 0 deletions Source/Configuration/YPWordings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,15 @@ public struct YPWordings {
public var filter = ypLocalized("YPImagePickerFilter")
public var crop = ypLocalized("YPImagePickerCrop")
public var warningMaxItemsLimit = ypLocalized("YPImagePickerWarningItemsLimit")

public var textAVAssetExportPresetLowQuality = ypLocalized("Low")
public var textAVAssetExportPreset640x480 = ypLocalized("Medium (HD)")
public var textAVAssetExportPresetMediumQuality = ypLocalized("Medium")
public var textAVAssetExportPreset1920x1080 = ypLocalized("High (Full HD)")
public var textAVAssetExportPreset1280x720 = ypLocalized("1280 x 720")
public var textAVAssetExportPresetHighestQuality = ypLocalized("Highest")
public var textAVAssetExportPresetAppleM4A = ypLocalized("Apple M4A")
public var textAVAssetExportPreset3840x2160 = ypLocalized("3840 x 2160")
public var textAVAssetExportPreset960x540 = ypLocalized("960 x 540")
public var textAVAssetExportPresetPassthrough = ypLocalized("Original")
}
Loading