Class: Ankoder::Video

Inherits:
Base
  • Object
show all
Defined in:
lib/ankoder/video.rb

Overview

Get a video from Ankoder

Videos.find(video_id)

Instance Attribute Summary

Attributes inherited from Base

#attributes, #errors

Class Method Summary collapse

Methods inherited from Base

count, create, destroy, #destroy, destroy_all, disconnect!, establish_connection!, find, #id, #include_ankoder_object, #initialize, method_missing, #method_missing, #new_record?, path, path=, #reload, #save, #save!, session, session=, update, #update_attributes

Constructor Details

This class inherits a constructor from Ankoder::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ankoder::Base

Class Method Details

.url_for(video_id, expires_in = nil) ⇒ Object



10
11
12
13
14
# File 'lib/ankoder/video.rb', line 10

def self.url_for(video_id, expires_in = nil)
  message = {:access_key => Configuration::access_key, :expires => expires(expires_in)}.to_json
  encoded_message = Base64.encode64(HMAC::SHA1::digest(Configuration::private_key, message)).strip
  "http://#{Configuration::host}/video/#{video_id}/download/?message=#{CGI.escape(message)}&signature=#{encoded_message}"
end