class ScreenRecorder::Desktop

@since 1.0.0-beta11

Constants

DEFAULT_INPUT_LINUX
DEFAULT_INPUT_MAC
DEFAULT_INPUT_WIN

Public Class Methods

new(output:, input: input_by_os, advanced: {}) click to toggle source

Desktop recording mode.

Calls superclass method ScreenRecorder::Common::new
# File lib/screen-recorder/desktop.rb, line 14
def initialize(output:, input: input_by_os, advanced: {})
  super(input: determine_input(input), output: output, advanced: advanced)
end

Private Instance Methods

determine_input(val) click to toggle source

Returns FFmpeg expected input based on user given value or default for the current OS.

# File lib/screen-recorder/desktop.rb, line 37
def determine_input(val)
  return val if val

  input_by_os
end
input_by_os() click to toggle source

Returns default input value for current OS

# File lib/screen-recorder/desktop.rb, line 23
def input_by_os
  return DEFAULT_INPUT_WIN if OS.windows?

  return DEFAULT_INPUT_LINUX if OS.linux?

  return DEFAULT_INPUT_MAC if OS.mac?

  raise 'Your OS is not supported. Feel free to create an Issue on GitHub.'
end