Class: Abrizer::TemporaryPoster

Inherits:
Object
  • Object
show all
Includes:
FilepathHelpers
Defined in:
lib/abrizer/temporary_poster.rb

Overview

It is usually better for a human to select a poster image, but we try to select a temporary one. Creating sprites leaves some images around so that is a prerequisite for this step. TODO: selection of a temporary poster image could be improved

Instance Method Summary collapse

Methods included from FilepathHelpers

#adaptations_filepath, #all_media_paths, #audio_filepath, #audio_filepath_fragmented, #basename, #canvas_filepath, #canvas_partial_filepath, #captions_filepath, #data_filepath, #data_partial_filepath, #ffprobe_filepath, #filename_directory, #first_image_filepath, #hlsts_aac_filepath, #hlsts_aac_partial_filepath, #hlsts_filepath, #hlsts_partial_filepath, #mp3_filepath, #mp3_partial_filepath, #mp4_filepath, #mp4_partial_filepath, #mpd_filepath, #mpd_partial_filepath, #output_directory, #output_directory_basename, #poster_filepath, #poster_image_filepath, #poster_partial_filepath, #sprites_filepath, #sprites_partial_filepath, #vp9_filepath, #vp9_partial_filepath, #webvtt_input_filepath

Constructor Details

#initialize(output_dir) ⇒ TemporaryPoster

Returns a new instance of TemporaryPoster.



11
12
13
# File 'lib/abrizer/temporary_poster.rb', line 11

def initialize(output_dir)
  @output_directory = output_dir
end

Instance Method Details

#copyObject



15
16
17
18
19
# File 'lib/abrizer/temporary_poster.rb', line 15

def copy
  FileUtils.cp first_image_filepath, poster_image_filepath
  `jpegoptim #{poster_image_filepath}`
  FileUtils.chmod "ugo+r", poster_image_filepath
end