Class: Kaltura::KalturaPlaylistService
- Inherits:
-
KalturaServiceBase
- Object
- KalturaServiceBase
- Kaltura::KalturaPlaylistService
- Defined in:
- lib/kaltura_client.rb
Overview
Playlist service lets you create,manage and play your playlists
Playlists could be static (containing a fixed list of entries) or dynamic (baseed on a filter)
Instance Attribute Summary
Attributes inherited from KalturaServiceBase
Instance Method Summary collapse
-
#add(playlist, update_stats = false) ⇒ Object
Add new playlist Note that all entries used in a playlist will become public and may appear in KalturaNetwork.
-
#clone(id, new_playlist = KalturaNotImplemented) ⇒ Object
Clone an existing playlist.
-
#delete(id) ⇒ Object
Delete existing playlist.
-
#execute(id, detailed = '', playlist_context = KalturaNotImplemented, filter = KalturaNotImplemented) ⇒ Object
Retrieve playlist for playing purpose.
-
#execute_from_content(playlist_type, playlist_content, detailed = '') ⇒ Object
Retrieve playlist for playing purpose, based on content.
-
#execute_from_filters(filters, total_results, detailed = '') ⇒ Object
Revrieve playlist for playing purpose, based on media entry filters.
-
#get(id, version = -1)) ⇒ Object
Retrieve a playlist.
-
#get_stats_from_content(playlist_type, playlist_content) ⇒ Object
Retrieve playlist statistics.
-
#initialize(client) ⇒ KalturaPlaylistService
constructor
A new instance of KalturaPlaylistService.
-
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ Object
List available playlists.
-
#update(id, playlist, update_stats = false) ⇒ Object
Update existing playlist Note - you cannot change playlist type.
Constructor Details
#initialize(client) ⇒ KalturaPlaylistService
Returns a new instance of KalturaPlaylistService.
12374 12375 12376 |
# File 'lib/kaltura_client.rb', line 12374 def initialize(client) super(client) end |
Instance Method Details
#add(playlist, update_stats = false) ⇒ Object
Add new playlist Note that all entries used in a playlist will become public and may appear in KalturaNetwork
12381 12382 12383 12384 12385 12386 12387 12388 12389 12390 12391 |
# File 'lib/kaltura_client.rb', line 12381 def add(playlist, update_stats=false) kparams = {} client.add_param(kparams, 'playlist', playlist); # indicates that the playlist statistics attributes should be updated synchronously now client.add_param(kparams, 'updateStats', update_stats); client.queue_service_action_call('playlist', 'add', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |
#clone(id, new_playlist = KalturaNotImplemented) ⇒ Object
Clone an existing playlist
12436 12437 12438 12439 12440 12441 12442 12443 12444 12445 12446 12447 |
# File 'lib/kaltura_client.rb', line 12436 def clone(id, new_playlist=KalturaNotImplemented) kparams = {} # Id of the playlist to clone client.add_param(kparams, 'id', id); # Parameters defined here will override the ones in the cloned playlist client.add_param(kparams, 'newPlaylist', new_playlist); client.queue_service_action_call('playlist', 'clone', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |
#delete(id) ⇒ Object
Delete existing playlist
12424 12425 12426 12427 12428 12429 12430 12431 12432 |
# File 'lib/kaltura_client.rb', line 12424 def delete(id) kparams = {} client.add_param(kparams, 'id', id); client.queue_service_action_call('playlist', 'delete', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |
#execute(id, detailed = '', playlist_context = KalturaNotImplemented, filter = KalturaNotImplemented) ⇒ Object
Retrieve playlist for playing purpose
12464 12465 12466 12467 12468 12469 12470 12471 12472 12473 12474 12475 |
# File 'lib/kaltura_client.rb', line 12464 def execute(id, detailed='', playlist_context=KalturaNotImplemented, filter=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'id', id); client.add_param(kparams, 'detailed', detailed); client.add_param(kparams, 'playlistContext', playlist_context); client.add_param(kparams, 'filter', filter); client.queue_service_action_call('playlist', 'execute', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |
#execute_from_content(playlist_type, playlist_content, detailed = '') ⇒ Object
Retrieve playlist for playing purpose, based on content
12479 12480 12481 12482 12483 12484 12485 12486 12487 12488 12489 |
# File 'lib/kaltura_client.rb', line 12479 def execute_from_content(playlist_type, playlist_content, detailed='') kparams = {} client.add_param(kparams, 'playlistType', playlist_type); client.add_param(kparams, 'playlistContent', playlist_content); client.add_param(kparams, 'detailed', detailed); client.queue_service_action_call('playlist', 'executeFromContent', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |
#execute_from_filters(filters, total_results, detailed = '') ⇒ Object
Revrieve playlist for playing purpose, based on media entry filters
12493 12494 12495 12496 12497 12498 12499 12500 12501 12502 12503 12504 12505 |
# File 'lib/kaltura_client.rb', line 12493 def execute_from_filters(filters, total_results, detailed='') kparams = {} filters.each do |obj| client.add_param(kparams, 'filters', obj); end client.add_param(kparams, 'totalResults', total_results); client.add_param(kparams, 'detailed', detailed); client.queue_service_action_call('playlist', 'executeFromFilters', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |
#get(id, version = -1)) ⇒ Object
Retrieve a playlist
12395 12396 12397 12398 12399 12400 12401 12402 12403 12404 12405 |
# File 'lib/kaltura_client.rb', line 12395 def get(id, version=-1) kparams = {} client.add_param(kparams, 'id', id); # Desired version of the data client.add_param(kparams, 'version', version); client.queue_service_action_call('playlist', 'get', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |
#get_stats_from_content(playlist_type, playlist_content) ⇒ Object
Retrieve playlist statistics
12509 12510 12511 12512 12513 12514 12515 12516 12517 12518 |
# File 'lib/kaltura_client.rb', line 12509 def get_stats_from_content(playlist_type, playlist_content) kparams = {} client.add_param(kparams, 'playlistType', playlist_type); client.add_param(kparams, 'playlistContent', playlist_content); client.queue_service_action_call('playlist', 'getStatsFromContent', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |
#list(filter = KalturaNotImplemented, pager = KalturaNotImplemented) ⇒ Object
List available playlists
12451 12452 12453 12454 12455 12456 12457 12458 12459 12460 |
# File 'lib/kaltura_client.rb', line 12451 def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented) kparams = {} client.add_param(kparams, 'filter', filter); client.add_param(kparams, 'pager', pager); client.queue_service_action_call('playlist', 'list', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |
#update(id, playlist, update_stats = false) ⇒ Object
Update existing playlist Note - you cannot change playlist type. updated playlist must be of the same type.
12410 12411 12412 12413 12414 12415 12416 12417 12418 12419 12420 |
# File 'lib/kaltura_client.rb', line 12410 def update(id, playlist, update_stats=false) kparams = {} client.add_param(kparams, 'id', id); client.add_param(kparams, 'playlist', playlist); client.add_param(kparams, 'updateStats', update_stats); client.queue_service_action_call('playlist', 'update', kparams); if (client.is_multirequest) return nil; end return client.do_queue(); end |