Module: KalturaFu::Entry::ClassMethods
- Defined in:
- lib/kaltura_fu/entry/class_methods.rb
Overview
Class level methods for the Entry module.
Instance Method Summary collapse
- #construct_entry_from_options(options = {}) ⇒ Object
- #find ⇒ Object
-
#upload(upload_object, options = {}) ⇒ String
extend KalturaFu::Entry::Metadata.
- #upload_from_file(upload_object, media_entry) ⇒ Object
Instance Method Details
#construct_entry_from_options(options = {}) ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/kaltura_fu/entry/class_methods.rb', line 50 def (={}) media_entry = Kaltura::MediaEntry.new .each do |key,value| media_entry.send("#{key}=",value) if valid_entry_attribute?(key) end media_entry.media_type = Kaltura::Constants::Media::Type::VIDEO if [:media_type].nil? return media_entry end |
#find ⇒ Object
TODO:
Build find.
35 36 37 |
# File 'lib/kaltura_fu/entry/class_methods.rb', line 35 def find #pending end |
#upload(upload_object, options = {}) ⇒ String
TODO:
Add the other upload types.
extend KalturaFu::Entry::Metadata
Allows you to upload some variety of media into Kaltura.
This isn’t going to be as great to use as one of their flash widgets, and should likely be used “off” the web process to not slow the application down.
24 25 26 27 28 29 30 |
# File 'lib/kaltura_fu/entry/class_methods.rb', line 24 def upload(upload_object,={}) KalturaFu.check_for_client_session #options_for_media_entry = options.delete(:source) media_entry = () upload_from_file(upload_object,media_entry) if [:source] == :file end |
#upload_from_file(upload_object, media_entry) ⇒ Object
42 43 44 45 |
# File 'lib/kaltura_fu/entry/class_methods.rb', line 42 def upload_from_file(upload_object,media_entry) upload_token = KalturaFu.client.media_service.upload(upload_object) KalturaFu.client.media_service.add_from_uploaded_file(media_entry,upload_token).id end |