Sha256: 4327d04f083ea5f2d66443f5dff82253464863da43f19d0cfad03b05359cde5a

Contents?: true

Size: 515 Bytes

Versions: 3

Compression:

Stored size: 515 Bytes

Contents

require 'av_capture'
require 'io/console'

module Camtasy
  class Preview
    def run
      session = AVCapture::Session.new
      dev = AVCapture.devices.find(&:video?)

      session.run_with(dev) do |connection|
        loop do
          case $stdin.getch
          when 'q' then break # quit when you hit 'q'
          else
            IO.popen("open -g -f -a /Applications/Preview.app", 'w') do |f|
              f.write connection.capture
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
camtasy-0.0.3 lib/camtasy/preview.rb
camtasy-0.0.2 lib/camtasy/preview.rb
camtasy-0.0.1 lib/camtasy/preview.rb