Code Monkey home page Code Monkey logo

wlphotopicker's Introduction

WLPhotoPicker

iOS图片、视频选择工具。支持图片视频多选。支持导出实况照片、未压缩的视频。支持视频压缩,视频转实况。

Version License Platform Language

截图

image

已实现功能

  • 支持选择照片,动图,视频,实况照片。
  • 支持选择原图和原视频.
  • 自定义主体颜色和提示文字.
  • 适配暗黑模式.
  • 图片,视频和实况预览.
  • 图片编辑(涂鸦,贴图,马赛克,裁剪,滤镜).
  • 视频压缩,视频水印,视频替换音轨.
  • 自定义相机.
  • 视频和实况照片互转.
  • 多语言(简体中文,繁体中文,英文).
  • 相册实时更新.

TODO

  • 自定义相机添加滤镜.
  • 视频编辑.

系统要求

  • iOS 11.0
  • Swift 5.x
  • Xcode 12.x

使用方法

pod 'WLPhotoPicker'

如何使用

class ViewController: UIViewController {
    
    @objc func openPicker() {

        // 选择照片
        let config = WLPhotoConfig()
        let vc = WLPhotoPickerController(config: config)
        vc.pickerDelegate = self
        self.present(vc, animated: true, completion: nil)

        // 视频压缩,水印
        let videoUrl = URL(string: "/demo.video")
        let outputPath = ""
        let manager = VideoCompressManager(avAsset: AVAsset(url: videoUrl), outputPath: outputPath)
        manager.frameDuration = 24
        manager.compressSize = ._960x540
        manager.addWaterMark(image: UIImage.init(named: "bilibili")) { size in
            return CGRect(x: 100, y: 100, width: 100, height: 40)
        }
        manager.exportVideo { videoUrl in
            print(videoUrl)
        }

        // 自定义相机
        let vc = CaptureViewController(captureConfig: CaptureConfig())
        vc.delegate = self
        present(vc, animated: true)

        // 视频转实况
        LivePhotoGenerator.createLivePhotoFrom(videoURL) { progress in
            print(progress)
        } completion: { result in
            print(result.livePhoto)
        }
    }
}

wlphotopicker's People

Contributors

weang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wlphotopicker's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.