# =================================================================================================== # _ __ _ _ # | |/ /__ _| | |_ _ _ _ _ __ _ # | ' . # # @ignore # =================================================================================================== require 'kaltura_client.rb' module Kaltura class KalturaExternalMediaEntryOrderBy CREATED_AT_ASC = "+createdAt" DURATION_ASC = "+duration" END_DATE_ASC = "+endDate" LAST_PLAYED_AT_ASC = "+lastPlayedAt" MEDIA_TYPE_ASC = "+mediaType" MODERATION_COUNT_ASC = "+moderationCount" NAME_ASC = "+name" PARTNER_SORT_VALUE_ASC = "+partnerSortValue" PLAYS_ASC = "+plays" RANK_ASC = "+rank" RECENT_ASC = "+recent" START_DATE_ASC = "+startDate" TOTAL_RANK_ASC = "+totalRank" UPDATED_AT_ASC = "+updatedAt" VIEWS_ASC = "+views" WEIGHT_ASC = "+weight" CREATED_AT_DESC = "-createdAt" DURATION_DESC = "-duration" END_DATE_DESC = "-endDate" LAST_PLAYED_AT_DESC = "-lastPlayedAt" MEDIA_TYPE_DESC = "-mediaType" MODERATION_COUNT_DESC = "-moderationCount" NAME_DESC = "-name" PARTNER_SORT_VALUE_DESC = "-partnerSortValue" PLAYS_DESC = "-plays" RANK_DESC = "-rank" RECENT_DESC = "-recent" START_DATE_DESC = "-startDate" TOTAL_RANK_DESC = "-totalRank" UPDATED_AT_DESC = "-updatedAt" VIEWS_DESC = "-views" WEIGHT_DESC = "-weight" end class KalturaExternalMediaSourceType INTERCALL = "InterCall" YOUTUBE = "YouTube" end class KalturaExternalMediaEntry < KalturaMediaEntry # The source type of the external media # attr_accessor :external_source_type # Comma separated asset params ids that exists for this external media entry # attr_accessor :asset_params_ids def from_xml(xml_element) super self.external_source_type = xml_element.elements['externalSourceType'].text self.asset_params_ids = xml_element.elements['assetParamsIds'].text end end class KalturaExternalMediaEntryListResponse < KalturaListResponse attr_accessor :objects def from_xml(xml_element) super self.objects = KalturaClientBase.object_from_xml(xml_element.elements['objects'], 'KalturaExternalMediaEntry') end end class KalturaExternalMediaEntryBaseFilter < KalturaMediaEntryFilter attr_accessor :external_source_type_equal attr_accessor :external_source_type_in attr_accessor :asset_params_ids_match_or attr_accessor :asset_params_ids_match_and def from_xml(xml_element) super self.external_source_type_equal = xml_element.elements['externalSourceTypeEqual'].text self.external_source_type_in = xml_element.elements['externalSourceTypeIn'].text self.asset_params_ids_match_or = xml_element.elements['assetParamsIdsMatchOr'].text self.asset_params_ids_match_and = xml_element.elements['assetParamsIdsMatchAnd'].text end end class KalturaExternalMediaEntryFilter < KalturaExternalMediaEntryBaseFilter def from_xml(xml_element) super end end # External media service lets you upload and manage embed codes and external playable content # class KalturaExternalMediaService < KalturaServiceBase def initialize(client) super(client) end # Add external media entry # def add(entry) kparams = {} client.add_param(kparams, 'entry', entry) client.queue_service_action_call('externalmedia_externalmedia', 'add', 'KalturaExternalMediaEntry', kparams) if (client.is_multirequest) return nil end return client.do_queue() end # Get external media entry by ID. # def get(id) kparams = {} client.add_param(kparams, 'id', id) client.queue_service_action_call('externalmedia_externalmedia', 'get', 'KalturaExternalMediaEntry', kparams) if (client.is_multirequest) return nil end return client.do_queue() end # Update external media entry. Only the properties that were set will be updated. # def update(id, entry) kparams = {} client.add_param(kparams, 'id', id) client.add_param(kparams, 'entry', entry) client.queue_service_action_call('externalmedia_externalmedia', 'update', 'KalturaExternalMediaEntry', kparams) if (client.is_multirequest) return nil end return client.do_queue() end # Delete a external media entry. # def delete(id) kparams = {} client.add_param(kparams, 'id', id) client.queue_service_action_call('externalmedia_externalmedia', 'delete', '', kparams) if (client.is_multirequest) return nil end return client.do_queue() end # List media entries by filter with paging support. # def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'filter', filter) client.add_param(kparams, 'pager', pager) client.queue_service_action_call('externalmedia_externalmedia', 'list', 'KalturaExternalMediaEntryListResponse', kparams) if (client.is_multirequest) return nil end return client.do_queue() end # Count media entries by filter. # def count(filter=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'filter', filter) client.queue_service_action_call('externalmedia_externalmedia', 'count', 'int', kparams) if (client.is_multirequest) return nil end return client.do_queue() end end class KalturaClient < KalturaClientBase attr_reader :external_media_service def external_media_service if (@external_media_service == nil) @external_media_service = KalturaExternalMediaService.new(self) end return @external_media_service end end end