Camera support for custom camera controllers
motion_capture = Motion::Capture.new
motion_capture = Motion::Capture.new(device: :front) # specify camera
preview = motion_capture.capture_preview_view(frame: view.bounds)
view.addSubview(preview) # UIView containing AVCaptureVideoPreviewLayer
motion_capture.toggle_camera # Switch between front/rear cameras
motion_capture.toggle_flash # Switch bettwen flash on/off
motion_capture.turn_flash_on
motion_capture.turn_flash_off
motion_capture.use_camera(:default)
motion_capture.use_camera(:front)
motion_capture.use_camera(:rear)
motion_capture.capture do |image_data|
# Use NSData
end
motion_capture.capture_and_save do |asset_url|
# Use NSURL
end
Add this line to your application's Gemfile:
gem 'motion-capture'
And then execute:
$ bundle
Or install it yourself as:
$ gem install motion-capture
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request