Understand the UI-only nature of PryntTrimmerView
masterstartTime, endTime, or getImageCropFrame()) to perform actual video manipulation using frameworks like AVFoundation.repository·master·Indexed 21 days ago
https://github.com/hhk1/prynttrimmerviewA Swift-based UI library for iOS providing specialized views for trimming and cropping videos. It includes TrimmerView for selecting time ranges and VideoCropView for selecting spatial areas. The library handles the user interaction layer only; developers must implement the actual video processing and exporting logic using frameworks such as AVFoundation.
startTime, endTime, or getImageCropFrame()) to perform actual video manipulation using frameworks like AVFoundation.PryntTrimmerView can be installed using Swift Package Manager (SPM), CocoaPods, or Carthage.
Requirements:
### SPM
```swift
dependencies: [
.package(url: "https://github.com/HHK1/PryntTrimmerView.git", .upToNextMajor(from: "4.0.1"))
]pod "PryntTrimmerView"github "HHK1/PryntTrimmerView"The TrimmerView provides a user interface for selecting a time range within a video asset.
Important: This library provides the UI only. It does not contain the logic to perform the actual video trimming/exporting. You must implement the trimming logic yourself (e.g., using AVFoundation).
To use it:
TrimmerView (via code or Interface Builder).asset property.TrimmerViewDelegate to handle updates (e.g., updating an AVPlayer preview).startTime and endTime properties.You can customize the appearance using handleColor, mainColor, and positionBarColor.
trimmerView.asset = asset
trimmerView.delegate = self
// Access selection
let start = trimmerView.startTime
let end = trimmerView.endTime
// Customization
trimmerView.handleColor = UIColor.white
trimmerView.mainColor = UIColor.orange
trimmerView.positionBarColor = UIColor.whiteThe VideoCropView provides a user interface for selecting a spatial area within a video asset for cropping.
Important: This library provides the UI only. It does not perform the actual video cropping/exporting. You must implement the export logic using the retrieved frame.
To use it:
VideoCropView and add it to your view hierarchy.asset property.setAspectRatio(_:) to define the desired aspect ratio for the crop.getImageCropFrame() to retrieve the selected frame coordinates for your export implementation.videoCropView.asset = asset
videoCropView.setAspectRatio(16/9)
// Retrieve the frame for export logic
let cropFrame = videoCropView.getImageCropFrame()