Skip to content

TitouanVanBelle/VideoEditorKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VideoEditorKit

A video editor kit



Features

  • Adjust speed rate
  • Crop using presets
  • Trim begining and end

How to use

Display the video editor

let asset = Bundle.main.url(forResource: "HongKong", withExtension: "mp4")
    .map(AVAsset.init)!
let outputUrl = ...

let controller = VideoEditorViewController(asset: asset, outputUrl: outputUrl)

let navigationController = UINavigationController(rootViewController: controller)
navigationController.modalPresentationStyle = .fullScreen
navigationController.navigationBar.barTintColor = .white
navigationController.navigationBar.shadowImage = UIImage()

present(navigationController, animated: true)

Get notified on edition complete

controller.onEditCompleted
    .sink { [weak self] _ in
        let item = AVPlayerItem(url: outputUrl)
        self?.editedVideoPlayer.player?.replaceCurrentItem(with: item)
    }

Cropping Presets

| Preset | Width / Height | | vertical| 3/4| | standard | 4/3 | | portrait | 9/16 | | square | 1/1 | | landscape | 16/9 | | instagram | 4/5 |

TODO

  • Add Audio (mute) video control
  • Seek when trimming
  • Prevent trimming handler from going passed each other
  • Trim: Prevent trimming handle from going passed each other
  • Make dismiss button in Video Control bigger and higher
  • Dark Theme

About

A video editor kit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages