Created
September 6, 2016 13:29
-
-
Save scherztc/2429d3a2bc6fdd9d4a09d1856030f7db to your computer and use it in GitHub Desktop.
This file contains 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
module BrowseEverything | |
module Driver | |
class Kaltura < Base | |
require 'kaltura' | |
def icon | |
'kaltura' | |
end | |
def validate_config | |
unless [:partner_id,:administrator_secret,:service_url].all? { |key| config[key].present? } | |
raise BrowseEverything::InitializationError, "Kaltura driver requires :partner_id, :administrator_secret, and :service_url" | |
end | |
end | |
def contents(path='') | |
result = [] | |
@session = ::Kaltura::Session.start | |
@entries = ::Kaltura::MediaEntry.list | |
@entries.each do |item| | |
item.location = item.downloadUrl | |
item.mtime = Time.at(item.updatedAt.to_i) | |
result.push(item) | |
end | |
result | |
end | |
def link_for(path) | |
byebug | |
end | |
def details(path) | |
byebug | |
contents(path).first | |
end | |
def authorized? | |
true | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment