Class: KalturaApi::KalturaCaptionAssetService

Inherits:
KalturaServiceBase show all
Defined in:
lib/kaltura_plugins/kaltura_caption_client_plugin.rb

Overview

Retrieve information and invoke actions on caption Asset

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaCaptionAssetService

Returns a new instance of KalturaCaptionAssetService.



173
174
175
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 173

def initialize(client)
	super(client)
end

Instance Method Details

#add(entry_id, caption_asset) ⇒ Object

Add caption asset



179
180
181
182
183
184
185
186
187
188
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 179

def add(entry_id, caption_asset)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id);
	client.add_param(kparams, 'captionAsset', caption_asset);
	client.queue_service_action_call('caption_captionasset', 'add', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#delete(caption_asset_id) ⇒ Object



308
309
310
311
312
313
314
315
316
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 308

def delete(caption_asset_id)
	kparams = {}
	client.add_param(kparams, 'captionAssetId', caption_asset_id);
	client.queue_service_action_call('caption_captionasset', 'delete', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#get(caption_asset_id) ⇒ Object



285
286
287
288
289
290
291
292
293
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 285

def get(caption_asset_id)
	kparams = {}
	client.add_param(kparams, 'captionAssetId', caption_asset_id);
	client.queue_service_action_call('caption_captionasset', 'get', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#get_remote_paths(id) ⇒ Object

Get remote storage existing paths for the asset



242
243
244
245
246
247
248
249
250
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 242

def get_remote_paths(id)
	kparams = {}
	client.add_param(kparams, 'id', id);
	client.queue_service_action_call('caption_captionasset', 'getRemotePaths', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#get_url(id, storage_id = KalturaNotImplemented) ⇒ Object

Get download URL for the asset



229
230
231
232
233
234
235
236
237
238
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 229

def get_url(id, storage_id=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'id', id);
	client.add_param(kparams, 'storageId', storage_id);
	client.queue_service_action_call('caption_captionasset', 'getUrl', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ Object

List caption Assets by filter and pager



297
298
299
300
301
302
303
304
305
306
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 297

def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'filter', filter);
	client.add_param(kparams, 'pager', pager);
	client.queue_service_action_call('caption_captionasset', 'list', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#serve(caption_asset_id) ⇒ Object

Serves caption by its id



254
255
256
257
258
259
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 254

def serve(caption_asset_id)
	kparams = {}
	client.add_param(kparams, 'captionAssetId', caption_asset_id);
	client.queue_service_action_call('caption_captionasset', 'serve', kparams);
	return client.get_serve_url();
end

#serve_by_entry_id(entry_id, caption_param_id = KalturaNotImplemented) ⇒ Object

Serves caption by entry id and thumnail params id



218
219
220
221
222
223
224
225
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 218

def serve_by_entry_id(entry_id, caption_param_id=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id);
	# if not set, default caption will be used.
	client.add_param(kparams, 'captionParamId', caption_param_id);
	client.queue_service_action_call('caption_captionasset', 'serveByEntryId', kparams);
	return client.get_serve_url();
end

#serve_web_vtt(caption_asset_id, segment_duration = 30, segment_index = KalturaNotImplemented, local_timestamp = 10000) ⇒ Object

Serves caption by its id converting it to segmented WebVTT



263
264
265
266
267
268
269
270
271
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 263

def serve_web_vtt(caption_asset_id, segment_duration=30, segment_index=KalturaNotImplemented, local_timestamp=10000)
	kparams = {}
	client.add_param(kparams, 'captionAssetId', caption_asset_id);
	client.add_param(kparams, 'segmentDuration', segment_duration);
	client.add_param(kparams, 'segmentIndex', segment_index);
	client.add_param(kparams, 'localTimestamp', local_timestamp);
	client.queue_service_action_call('caption_captionasset', 'serveWebVTT', kparams);
	return client.get_serve_url();
end

#set_as_default(caption_asset_id) ⇒ Object

Markss the caption as default and removes that mark from all other caption assets of the entry.



275
276
277
278
279
280
281
282
283
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 275

def set_as_default(caption_asset_id)
	kparams = {}
	client.add_param(kparams, 'captionAssetId', caption_asset_id);
	client.queue_service_action_call('caption_captionasset', 'setAsDefault', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#set_content(id, content_resource) ⇒ Object

Update content of caption asset



192
193
194
195
196
197
198
199
200
201
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 192

def set_content(id, content_resource)
	kparams = {}
	client.add_param(kparams, 'id', id);
	client.add_param(kparams, 'contentResource', content_resource);
	client.queue_service_action_call('caption_captionasset', 'setContent', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end

#update(id, caption_asset) ⇒ Object

Update caption asset



205
206
207
208
209
210
211
212
213
214
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 205

def update(id, caption_asset)
	kparams = {}
	client.add_param(kparams, 'id', id);
	client.add_param(kparams, 'captionAsset', caption_asset);
	client.queue_service_action_call('caption_captionasset', 'update', kparams);
	if (client.is_multirequest)
		return nil;
	end
	return client.do_queue();
end