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
Allows you to upload some variety of media into Kaltura.
- #upload_from_file(upload_object, media_entry) ⇒ Object
Instance Method Details
#construct_entry_from_options(options = {}) ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/kaltura_fu/entry/class_methods.rb', line 49 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.
34 35 36 |
# File 'lib/kaltura_fu/entry/class_methods.rb', line 34 def find #pending end |
#upload(upload_object, options = {}) ⇒ String
TODO:
Add the other upload types.
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.
23 24 25 26 27 28 29 |
# File 'lib/kaltura_fu/entry/class_methods.rb', line 23 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
41 42 43 44 |
# File 'lib/kaltura_fu/entry/class_methods.rb', line 41 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 |