please help solve the problem.
I implemented loading videofiles. I used a gem paperclip-av-transcoder.
model: class Video < ActiveRecord::Base has_attached_file :video, :url => ":localhost/system/:class/:attachment/:id/:style/:filename", :path => ":rails_root/public/system/:class/:attachment/:id/:style/:filename", :styles => { :medium => { :geometry => "640x480", :format => 'flv' }, :thumb => { :geometry => "200x100#", :format => 'jpg', :time => 10 } }, :processors => [:transcoder] validates_attachment_content_type :video, :content_type => ["video/mp4", "video.mov", "video/mpeg","video/mpeg4", "image/jpg", "image/jpeg"] end
controller: def create @video = Video.new(video_params)
if @video.save flash[:success] = :video_created redirect_to @video else flash.now[:error] = :user_not_created redirect_to @video end end
show.html.erb: <video width="320" height="240" controls> <source src="<%= @video.video_file_name %>" type="<%= @video.video_content_type %>"> </video>
resulting video file is loaded into the system, but not displayed.
firebug shows the wrong way: <video width="320" height="240" controls=""> <source src="mmm.mp4" type="video/mp4"> </video>
actual path is: /home/kalinin/rails/vd/public/system/videos/videos/17/medium/mmm.flv
I do not understand how to get the video on the screen.