Module: Abrizer::InformationHelpers

Included in:
Canvas, Data
Defined in:
lib/abrizer/information_helpers.rb

Instance Method Summary collapse

Instance Method Details

#durationObject

TODO: Could this be more flexible to potentially use a file other than the mp4_filepath?



6
7
8
9
# File 'lib/abrizer/information_helpers.rb', line 6

def duration
  informer = Abrizer::FfprobeInformer.new(filepath: mp4_filepath, output_directory: @output_directory)
  informer.duration.to_f
end

#max_heightObject



19
20
21
# File 'lib/abrizer/information_helpers.rb', line 19

def max_height
  @adaptations.last.height
end

#max_widthObject



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

def max_width
  @adaptations.last.width
end

#min_heightObject



23
24
25
# File 'lib/abrizer/information_helpers.rb', line 23

def min_height
  @adaptations.first.height
end

#min_widthObject



15
16
17
# File 'lib/abrizer/information_helpers.rb', line 15

def min_width
  @adaptations.first.width
end

#mp4_heightObject



31
32
33
# File 'lib/abrizer/information_helpers.rb', line 31

def mp4_height
  @adaptations[-2].height
end

#mp4_widthObject



27
28
29
# File 'lib/abrizer/information_helpers.rb', line 27

def mp4_width
  @adaptations[-2].width
end