Class: Kaltura::KalturaCaptionAssetService
- Inherits:
-
KalturaServiceBase
- Object
- KalturaServiceBase
- Kaltura::KalturaCaptionAssetService
- 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
Instance Method Summary collapse
-
#add(entry_id, caption_asset) ⇒ KalturaCaptionAsset
Add caption asset.
-
#delete(caption_asset_id) ⇒ Object
[].
-
#export(asset_id, storage_profile_id) ⇒ KalturaFlavorAsset
manually export an asset.
- #get(caption_asset_id) ⇒ KalturaCaptionAsset
-
#get_remote_paths(id) ⇒ KalturaRemotePathListResponse
Get remote storage existing paths for the asset.
-
#get_url(id, storage_id = KalturaNotImplemented) ⇒ string
Get download URL for the asset.
-
#initialize(client) ⇒ KalturaCaptionAssetService
constructor
A new instance of KalturaCaptionAssetService.
-
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ KalturaCaptionAssetListResponse
List caption Assets by filter and pager.
-
#serve(caption_asset_id) ⇒ file
Serves caption by its id.
-
#serve_as_json(caption_asset_id) ⇒ file
Serves caption file as Json by its ID.
-
#serve_by_entry_id(entry_id, caption_param_id = KalturaNotImplemented) ⇒ file
Serves caption by entry id and thumnail params id.
-
#serve_web_vtt(caption_asset_id, segment_duration = 30, segment_index = KalturaNotImplemented, local_timestamp = 10000) ⇒ file
Serves caption by its id converting it to segmented WebVTT.
-
#set_as_default(caption_asset_id) ⇒ Object
Markss the caption as default and removes that mark from all other caption assets of the entry.
-
#set_content(id, content_resource) ⇒ KalturaCaptionAsset
Update content of caption asset.
-
#update(id, caption_asset) ⇒ KalturaCaptionAsset
Update caption asset.
Constructor Details
#initialize(client) ⇒ KalturaCaptionAssetService
Returns a new instance of KalturaCaptionAssetService.
420 421 422 |
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 420 def initialize(client) super(client) end |
Instance Method Details
#add(entry_id, caption_asset) ⇒ KalturaCaptionAsset
Add caption asset
426 427 428 429 430 431 432 433 434 435 |
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 426 def add(entry_id, ) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'captionAsset', ) client.queue_service_action_call('caption_captionasset', 'add', 'KalturaCaptionAsset', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#delete(caption_asset_id) ⇒ Object
Returns [].
438 439 440 441 442 443 444 445 446 |
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 438 def delete() kparams = {} client.add_param(kparams, 'captionAssetId', ) client.queue_service_action_call('caption_captionasset', 'delete', '', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#export(asset_id, storage_profile_id) ⇒ KalturaFlavorAsset
manually export an asset
450 451 452 453 454 455 456 457 458 459 |
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 450 def export(asset_id, storage_profile_id) kparams = {} client.add_param(kparams, 'assetId', asset_id) client.add_param(kparams, 'storageProfileId', storage_profile_id) client.queue_service_action_call('caption_captionasset', 'export', 'KalturaFlavorAsset', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#get(caption_asset_id) ⇒ KalturaCaptionAsset
462 463 464 465 466 467 468 469 470 |
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 462 def get() kparams = {} client.add_param(kparams, 'captionAssetId', ) client.queue_service_action_call('caption_captionasset', 'get', 'KalturaCaptionAsset', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#get_remote_paths(id) ⇒ KalturaRemotePathListResponse
Get remote storage existing paths for the asset
474 475 476 477 478 479 480 481 482 |
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 474 def get_remote_paths(id) kparams = {} client.add_param(kparams, 'id', id) client.queue_service_action_call('caption_captionasset', 'getRemotePaths', 'KalturaRemotePathListResponse', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#get_url(id, storage_id = KalturaNotImplemented) ⇒ string
Get download URL for the asset
486 487 488 489 490 491 492 493 494 495 |
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 486 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', 'string', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ KalturaCaptionAssetListResponse
List caption Assets by filter and pager
499 500 501 502 503 504 505 506 507 508 |
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 499 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', 'KalturaCaptionAssetListResponse', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#serve(caption_asset_id) ⇒ file
Serves caption by its id
512 513 514 515 516 517 |
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 512 def serve() kparams = {} client.add_param(kparams, 'captionAssetId', ) client.queue_service_action_call('caption_captionasset', 'serve', 'file', kparams) return client.get_serve_url() end |
#serve_as_json(caption_asset_id) ⇒ file
Serves caption file as Json by its ID
521 522 523 524 525 526 |
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 521 def serve_as_json() kparams = {} client.add_param(kparams, 'captionAssetId', ) client.queue_service_action_call('caption_captionasset', 'serveAsJson', 'file', kparams) return client.get_serve_url() end |
#serve_by_entry_id(entry_id, caption_param_id = KalturaNotImplemented) ⇒ file
Serves caption by entry id and thumnail params id
530 531 532 533 534 535 536 |
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 530 def serve_by_entry_id(entry_id, =KalturaNotImplemented) kparams = {} client.add_param(kparams, 'entryId', entry_id) client.add_param(kparams, 'captionParamId', ) client.queue_service_action_call('caption_captionasset', 'serveByEntryId', 'file', kparams) return client.get_serve_url() end |
#serve_web_vtt(caption_asset_id, segment_duration = 30, segment_index = KalturaNotImplemented, local_timestamp = 10000) ⇒ file
Serves caption by its id converting it to segmented WebVTT
540 541 542 543 544 545 546 547 548 |
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 540 def serve_web_vtt(, segment_duration=30, segment_index=KalturaNotImplemented, =10000) kparams = {} client.add_param(kparams, 'captionAssetId', ) client.add_param(kparams, 'segmentDuration', segment_duration) client.add_param(kparams, 'segmentIndex', segment_index) client.add_param(kparams, 'localTimestamp', ) client.queue_service_action_call('caption_captionasset', 'serveWebVTT', 'file', 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.
552 553 554 555 556 557 558 559 560 |
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 552 def set_as_default() kparams = {} client.add_param(kparams, 'captionAssetId', ) 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) ⇒ KalturaCaptionAsset
Update content of caption asset
564 565 566 567 568 569 570 571 572 573 |
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 564 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', 'KalturaCaptionAsset', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |
#update(id, caption_asset) ⇒ KalturaCaptionAsset
Update caption asset
577 578 579 580 581 582 583 584 585 586 |
# File 'lib/kaltura_plugins/kaltura_caption_client_plugin.rb', line 577 def update(id, ) kparams = {} client.add_param(kparams, 'id', id) client.add_param(kparams, 'captionAsset', ) client.queue_service_action_call('caption_captionasset', 'update', 'KalturaCaptionAsset', kparams) if (client.is_multirequest) return nil end return client.do_queue() end |