Created
April 13, 2012 15:03
-
-
Save drale2k/2377493 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Error: invalid API key | |
# lib/video_encoder.rb | |
module VideoEncoder | |
def self.encode(video = nil) | |
response = Zencoder::Job.create({:input => "test.mp4"}) | |
puts response.inspect | |
end | |
end | |
# config/initializers/zencoder.rb | |
Zencoder.api_key = "XXXX" | |
# models/video.rb | |
class Video < ActiveRecord::Base | |
# Associations | |
has_and_belongs_to_many :categories | |
# Validations | |
validates :title, :video, :poster, :categories, :presence => true | |
# CarrierWave Mount Uploaders | |
mount_uploader :poster, VideoPosterUploader | |
VideoEncoder.encode | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment