Sha256: 72c8bef5f501127fa429424de36fbf075f4f5811ffb85587192d5937e830d54c
Contents?: true
Size: 840 Bytes
Versions: 3
Compression:
Stored size: 840 Bytes
Contents
require 'erb' $template = ERB.new File.read("control_youtube.rhtml") def combine_arrays array1, array2 array1 ||= [] array2 ||= [] raise unless array1.length == array2.length out = [] array1.each_with_index{|start, idx| start = start.to_f endy = array2[idx].to_f out << "[#{start},#{endy}]" raise "bad #{endy} < #{start}" unless endy > start } out end def render_edited out, incoming_params mutes = combine_arrays incoming_params['mute_start'], incoming_params['mute_end'] splits = combine_arrays incoming_params['skip_start'], incoming_params['skip_end'] video_id = incoming_params['youtube_video_id'][0] out.puts $template.result(binding) # html tag has already been closed... out.puts 'mutes: ' + mutes.join(', ') + ' skips: ' + splits.join(', ') + "\n" end
Version data entries
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
content-editing-movie-player-0.38.0 | www/youtube_edl/render_edited.rb |
sensible-cinema-0.35.3 | www/youtube_edl/render_edited.rb |
sensible-cinema-0.34.0 | www/youtube_edl/render_edited.rb |