class Abrizer::Captions
Copies over any WebVTT captions that are beside the original video resource into the destination folder. TODO: This may only be needed if fMP4 derivatives aren’t created since captions are copied over. TODO: Allow for more than one captions/subtitle file to be copied over.
Public Class Methods
new(filename, output_dir)
click to toggle source
# File lib/abrizer/captions.rb, line 10 def initialize(filename, output_dir) @filename = filename @output_directory = output_dir if vtt_dir_glob.length > 0 FileUtils.mkdir_p vtt_output_directory end end
Public Instance Methods
copy()
click to toggle source
# File lib/abrizer/captions.rb, line 18 def copy vtt_dir_glob.each do |vtt| # vtt_basename = File.basename vtt vtt_filename = File.join vtt_output_directory, 'captions.vtt' FileUtils.cp vtt, vtt_filename end end
vtt_dir_glob()
click to toggle source
# File lib/abrizer/captions.rb, line 26 def vtt_dir_glob Dir.glob vtt_file_glob end
vtt_file_glob()
click to toggle source
TODO: actually search for more than one VTT file
# File lib/abrizer/captions.rb, line 31 def vtt_file_glob File.join filename_directory, "#{basename}.vtt" end
vtt_output_directory()
click to toggle source
# File lib/abrizer/captions.rb, line 35 def vtt_output_directory File.join @output_directory, 'vtt' end