All Projects → samuelbeek → Recordbutton

samuelbeek / Recordbutton

Licence: mit
A record button in Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Recordbutton

Cameravideobutton
Instagram like animated button for taking photo or recording video.
Stars: ✭ 223 (+120.79%)
Mutual labels:  camera, button
Pbjvision
📸 iOS Media Capture – features touch-to-record video, slow motion, and photography
Stars: ✭ 1,940 (+1820.79%)
Mutual labels:  recording, camera
CAM
macOS camera recording using ffmpeg
Stars: ✭ 43 (-57.43%)
Mutual labels:  camera, recording
Pixelbot
Stars: ✭ 90 (-10.89%)
Mutual labels:  camera
React Native Camera
A Camera component for React Native. Also supports barcode scanning!
Stars: ✭ 9,530 (+9335.64%)
Mutual labels:  camera
Flutter wechat camera picker
A camera picker in WeChat style.
Stars: ✭ 95 (-5.94%)
Mutual labels:  camera
Laser Camera Calibration Toolbox
A Laser-Camera Calibration Toolbox extending from that at http://www.cs.cmu.edu/~ranjith/lcct.html
Stars: ✭ 99 (-1.98%)
Mutual labels:  camera
Zwmusicdownloadview
精仿唱吧App音乐下载进度按钮,完美快速集成使用(A beautiful musical download progress button which can show the progress and click to play Music after finishing)
Stars: ✭ 88 (-12.87%)
Mutual labels:  button
Gradient Screens
🌈 Gradients applied to buttons, texts and backgrounds in Flutter
Stars: ✭ 97 (-3.96%)
Mutual labels:  button
Recordwav
Android手机录制wav/pcm文件,支持暂停,再录制。支持跳过静音区模式。
Stars: ✭ 93 (-7.92%)
Mutual labels:  recording
Homebridge Nest Cam old
Use your Nest Cam as IP camera in HomeKit.
Stars: ✭ 92 (-8.91%)
Mutual labels:  camera
Windows10debloater
Script to remove Windows 10 bloatware.
Stars: ✭ 11,462 (+11248.51%)
Mutual labels:  button
Frigate
NVR with realtime local object detection for IP cameras
Stars: ✭ 1,329 (+1215.84%)
Mutual labels:  camera
Lcamera
A camera app using the new camera2 API in Android Lollipop
Stars: ✭ 1,298 (+1185.15%)
Mutual labels:  camera
Easy Yolo
Yolo (Real time object detection) model training tutorial with deep learning neural networks
Stars: ✭ 98 (-2.97%)
Mutual labels:  camera
Br Hisicam
*WIP* Buildroot based sample firmware with embedded GoHisiCam for HiSilicon`s System-On-a-Chip ip cameras
Stars: ✭ 89 (-11.88%)
Mutual labels:  camera
Python Arlo
Python Arlo is a library written in Python 2.7/3x that exposes the Netgear Arlo cameras as Python objects.
Stars: ✭ 97 (-3.96%)
Mutual labels:  camera
Spbutton
自定义按钮,图片可在上、左、下、右,可调整图文间距,新增属性支持storyBoard/xib,系统按钮的所有属性和方法依然生效
Stars: ✭ 91 (-9.9%)
Mutual labels:  button
Termtosvg
Record terminal sessions as SVG animations
Stars: ✭ 9,310 (+9117.82%)
Mutual labels:  recording
Image Picker
An easy to use, highly configurable image picker for your chat application.
Stars: ✭ 94 (-6.93%)
Mutual labels:  camera

RecordButton

CI Status Version License Platform

A Record Button in Swift. Inspired by SDRecordButton It shows you the recording process when recording. It's great for a video recorder app with a fixed/maximum length like snapchat, vine, instragram.

Screenshot

Requirements

iOS 8 and higher

Example Project

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

RecordButton is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "RecordButton"

Add this line add the top of the file you want to use this module in import RecordButton

Usage

Add a simple RecordButton

Add this to viewDidLoad

let recordButton = RecordButton(frame: CGRectMake(0,0,70,70))
view.addSubview(recordButton) 

Update progress

it's the easiest to just check out the example project for this.

To update progress the RecordButton must be an instance of the class. You should also add a progressTimer and a progress variable, like this:

class ViewController: UIViewController {

	var recordButton : RecordButton!
	var progressTimer : NSTimer!
	var progress : CGFloat! = 0
	
	// rest of viewController 
	

The recordButton needs a target for start and stopping the progress timer. Add this code after initialization of the recordButton (usualy in viewDidLoad())

recordButton.addTarget(self, action: #selector(ViewController.record), for: .touchDown)
recordButton.addTarget(self, action: #selector(ViewController.stop), for: UIControlEvents.touchUpInside)

Finally add these functions to your ViewController

    @objc func record() {
        self.progressTimer = Timer.scheduledTimer(timeInterval: 0.05, target: self, selector: #selector(ViewController.updateProgress), userInfo: nil, repeats: true)
    }
    
    @objc func updateProgress() {
        
        let maxDuration = CGFloat(5) // Max duration of the recordButton
        
        progress = progress + (CGFloat(0.05) / maxDuration)
        recordButton.setProgress(progress)
        
        if progress >= 1 {
            progressTimer.invalidate()
        }
        
    }
    
    @objc func stop() {
        self.progressTimer.invalidate()
    }
    

Support/Issues

If you have any questions, please don't hesitate to create an issue.

To Do

  • Add Carthage Support
  • Add a delegation pattern

Author

samuelbeek - iOS Developer, Consultant and Occasional Designer

Acknowledgements

This button is heavely inspired by SDRecordButton, which is made by Sebyddd

License

RecordButton is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].