Class: Headless::VideoRecorder

Inherits:
Object
  • Object
show all
Defined in:
lib/onlyoffice_webdriver_wrapper/helpers/headless_helper/headless_patch.rb

Overview

Class for handling video records

Instance Method Summary collapse

Instance Method Details

#stop_and_save(path) ⇒ nil, String

Stop recording and save it

Parameters:

  • path (String)

    to save

Returns:

  • (nil, String)

    path to result file or nil if error



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/onlyoffice_webdriver_wrapper/helpers/headless_helper/headless_patch.rb', line 33

def stop_and_save(path)
  CliUtil.kill_process(@pid_file_path, :wait => true)
  if File.exist? @tmp_file_path
    begin
      FileUtils.mkdir_p(File.dirname(path))
      FileUtils.mv(@tmp_file_path, path)
    rescue Errno::EINVAL
      nil
    end
  end
end