Class: Kaltura::Service::LiveStreamService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/kaltura/service/live_stream_service.rb

Overview

The live stream service lets you manage live stream channels.

Instance Attribute Summary

Attributes inherited from BaseService

#client

Instance Method Summary collapse

Methods inherited from BaseService

#initialize, #perform_request

Constructor Details

This class inherits a constructor from Kaltura::Service::BaseService

Instance Method Details

#add(live_stream_entry) ⇒ Kaltura::LiveStreamAdminEntry

Adds a new live stream entry. The entry will be queued for provision. Note, this uses a LiveStreamAdminEntry instead of a normal LiveStreamEntry object. LiveStreamAdminEntry is a child class, and adds a few fields pertinent to administering a Live stream.

Parameters:

  • live_stream_entry (Kaltura::LiveStreamAdminEntry)

    The live stream entry metadata. In order to succesfully create a live stream entry you need to have the media_type, encoding_ip1, and encoding_ip2 fields populated.

Returns:

  • (Kaltura::LiveStreamAdminEntry)

    Returns the live stream entry saved on the database. It might be a good idea to save the ID field on return.

Raises:

  • (Kaltura::APIError)

    Raises ‘PROPERTY_VALIDATION_CANNOT_BE_NULL’ if media_type, encoding_ip1, or encoding_ip2 are null.



26
27
28
29
30
# File 'lib/kaltura/service/live_stream_service.rb', line 26

def add(live_stream_entry)
	kparams = {}
	client.add_param(kparams, 'liveStreamEntry', live_stream_entry)
	perform_request('liveStream','add',kparams,false)
end

#delete(entry_id) ⇒ nil

Deletes a live stream entry object.

Parameters:

  • entry_id (String)

    The live stream entry ID.

Returns:

  • (nil)

    Returns nothing

Raises:

  • (Kaltura::APIError)

    Raises ‘ENTRY_ID_NOT_FOUND’ if the entry doesn’t exist.



80
81
82
83
84
# File 'lib/kaltura/service/live_stream_service.rb', line 80

def delete(entry_id)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	perform_request('liveStream','delete',kparams,false)
end

#get(entry_id, version = -1)) ⇒ Kaltura::LiveStreamAdminEntry

Retrieves a live stream entry by ID. The Kaltura API docs indicate that this action will return a LiveStreamEntry object, but the reality is that it will return a LiveStreamAdminEntry object instead.

Parameters:

  • entry_id (String)

    The live stream entry ID.

  • version (Integer) (defaults to: -1))

    The version of the entry.

Returns:

Raises:

  • (Kaltura::APIError)

    Raises ‘ENTRY_ID_NOT_FOUND’ if the entry doesn’t exist.



44
45
46
47
48
49
# File 'lib/kaltura/service/live_stream_service.rb', line 44

def get(entry_id, version=-1)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'version', version)
	perform_request('liveStream','get',kparams,false)
end

#list(filter = nil, pager = nil) ⇒ Kaltura::Response::LiveStreamListResponse

Lists live streams by the filter with paging support for large sets of live streams.

Parameters:

Returns:

Raises:



96
97
98
99
100
101
# File 'lib/kaltura/service/live_stream_service.rb', line 96

def list(filter=nil, pager=nil)
	kparams = {}
	client.add_param(kparams, 'filter', filter)
	client.add_param(kparams, 'pager', pager)
	perform_request('liveStream','list',kparams,false)
end

#update(entry_id, live_stream_entry) ⇒ Kaltura::LiveStreamEntry

Updates a live stream entry object.

Like all of the other Kaltura API update actions it is best to instantiate a new LiveStreamAdminEntry object instead of pulling the existing one and updating its fields.

Parameters:

  • entry_id (String)

    The live stream entry ID.

  • live_stream_entry (Kaltura::LiveStreamEntry)

    A LiveStreamEntry object with the fields you wish to update populated.

Returns:

Raises:

  • (Kaltura::APIError)

    Raises ‘ENTRY_ID_NOT_FOUND’ if the entry doesn’t exist.



64
65
66
67
68
69
# File 'lib/kaltura/service/live_stream_service.rb', line 64

def update(entry_id, live_stream_entry)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'liveStreamEntry', live_stream_entry)
	perform_request('liveStream','update',kparams,false)
end

#update_offline_thumbnail_from_url(entry_id, url) ⇒ Object

‘PERMISSION_DENIED_TO_UPDATE_ENTRY’ if the user is does not own the live stream and isn’t an administrator.



132
133
134
135
136
137
# File 'lib/kaltura/service/live_stream_service.rb', line 132

def update_offline_thumbnail_from_url(entry_id, url)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'url', url)
	perform_request('liveStream','updateOfflineThumbnailFromUrl',kparams,false)
end

#update_offline_thumbnail_jpeg(entry_id, file_data) ⇒ Object

‘PERMISSION_DENIED_TO_UPDATE_ENTRY’ if the user is does not own the live stream and isn’t an administrator.



114
115
116
117
118
119
# File 'lib/kaltura/service/live_stream_service.rb', line 114

def update_offline_thumbnail_jpeg(entry_id, file_data)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'fileData', file_data)
	perform_request('liveStream','updateOfflineThumbnailJpeg',kparams,false)
end