Sha256: 7b21189a7907a334d60a4dc430d81dadc7b2b2afa5f589e846ee9e0302927491

Contents?: true

Size: 904 Bytes

Versions: 2

Compression:

Stored size: 904 Bytes

Contents

class Video < Document
  after_save :videoprocess
  
  has_attached_file :file, 
                    :url => '/:class/:id.:extension',
                    :path => ':rails_root/documents/:class/:id_partition/:style.:extension',
                    :styles => {:webm => {:format => 'webm'},
                                :flv => { :format => 'flv' },
                                :thumb   => {:geometry => "48x48" , :format => 'png', :time => 5},
                                :thumb0  => {:geometry => "130x80", :format => 'png', :time => 5}
                    },:processors => [:ffmpeg]
                    
  def videoprocess
    Resque.enqueue(Videoencoder, self.id)
  end
     
                      
  # Thumbnail file
  def thumb(size, helper)
    if format && IMAGE_FORMATS.include?(format.to_s)
      "#{ size.to_s }/video.png"
    else
      "#{ size.to_s }/video.png"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
social_stream-documents-0.2.0 app/models/video.rb
social_stream-documents-0.1.12 app/models/video.rb