Class: DragonflyVideo::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/dragonfly_video/plugin.rb

Instance Method Summary collapse

Instance Method Details

#call(app, _opts = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/dragonfly_video/plugin.rb', line 5

def call(app, _opts = {})
  app.add_analyser :video_properties, DragonflyVideo::Analysers::VideoProperties.new

  [
    DragonflyVideo::Analysers::VideoProperties::VIDEO_PROPS
  ].flatten.each do |analyser|
    app.add_analyser analyser do |content|
      content.analyse(:video_properties)[analyser]
    end
  end

  app.add_processor :screenshot, DragonflyVideo::Processors::Screenshot.new
end