Module: CloudinarySubtitlesEmbedder
- Defined in:
- lib/cloudinary_subtitles_embedder.rb,
lib/cloudinary_subtitles_embedder/version.rb,
lib/cloudinary_subtitles_embedder/subtitle_line.rb,
lib/cloudinary_subtitles_embedder/subtitle_time.rb
Defined Under Namespace
Classes: SubtitleLine, SubtitleTime
Constant Summary collapse
- VERSION =
"0.1.5"
Class Method Summary collapse
Class Method Details
.add_subtitles_to_video(video_public_id, subtitles, cloud_name = 'candidate-evaluation', display_options = nil) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/cloudinary_subtitles_embedder.rb', line 2 def self.add_subtitles_to_video( video_public_id, subtitles, cloud_name = 'candidate-evaluation', = nil ) to_sub = Proc.new do |s| SubtitleLine.new(s, ) end prefix = "https://res.cloudinary.com/#{cloud_name}/video/upload" subtitle_url = subtitles['subtitles'] .map{|s| to_sub.call(s)} .map(&:to_s) .reduce(&:+) subtitle_url ||= '' prefix + subtitle_url + '/' + video_public_id end |