Module: VideoScreenshoter
- Defined in:
- lib/video_screenshoter.rb,
lib/video_screenshoter/hls.rb,
lib/video_screenshoter/image.rb,
lib/video_screenshoter/video.rb,
lib/video_screenshoter/version.rb,
lib/video_screenshoter/abstract.rb
Defined Under Namespace
Classes: Abstract, Hls, Image, Video
Constant Summary collapse
- VERSION =
"0.2.3"
Class Attribute Summary collapse
-
.ffmpeg ⇒ Object
Returns the value of attribute ffmpeg.
-
.imagemagick ⇒ Object
Returns the value of attribute imagemagick.
-
.output_dir ⇒ Object
Returns the value of attribute output_dir.
-
.output_file ⇒ Object
Returns the value of attribute output_file.
-
.verbose ⇒ Object
Returns the value of attribute verbose.
Class Method Summary collapse
Class Attribute Details
.ffmpeg ⇒ Object
Returns the value of attribute ffmpeg.
11 12 13 |
# File 'lib/video_screenshoter.rb', line 11 def ffmpeg @ffmpeg end |
.imagemagick ⇒ Object
Returns the value of attribute imagemagick.
11 12 13 |
# File 'lib/video_screenshoter.rb', line 11 def imagemagick @imagemagick end |
.output_dir ⇒ Object
Returns the value of attribute output_dir.
11 12 13 |
# File 'lib/video_screenshoter.rb', line 11 def output_dir @output_dir end |
.output_file ⇒ Object
Returns the value of attribute output_file.
11 12 13 |
# File 'lib/video_screenshoter.rb', line 11 def output_file @output_file end |
.verbose ⇒ Object
Returns the value of attribute verbose.
11 12 13 |
# File 'lib/video_screenshoter.rb', line 11 def verbose @verbose end |
Class Method Details
.new(params) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/video_screenshoter.rb', line 19 def self.new params raise ArgumentError.new('Input is needed') unless params[:input] raise ArgumentError.new('Incorrect type param') unless [nil, 'hls', 'video', 'image'].include? params[:type] if params[:type] == 'hls' || File.extname(params[:input]).downcase == '.m3u8' VideoScreenshoter::Hls.new(params) elsif params[:type] == 'image' || ['.gif','.png','.jpg','.jpeg', '.png'].include?(File.extname(params[:input]).downcase) VideoScreenshoter::Image.new(params) else VideoScreenshoter::Video.new(params) end end |