Class: Kaltura::KalturaLiveChannelService

Inherits:
KalturaServiceBase show all
Defined in:
lib/kaltura_client.rb

Overview

Live Channel service lets you manage live channels

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaLiveChannelService

Returns a new instance of KalturaLiveChannelService.



2256
2257
2258
# File 'lib/kaltura_client.rb', line 2256

def initialize(client)
	super(client)
end

Instance Method Details

#add(live_channel) ⇒ KalturaLiveChannel

Adds new live channel.

Returns:



2262
2263
2264
2265
2266
2267
2268
2269
2270
# File 'lib/kaltura_client.rb', line 2262

def add(live_channel)
	kparams = {}
	client.add_param(kparams, 'liveChannel', live_channel)
	client.queue_service_action_call('livechannel', 'add', 'KalturaLiveChannel', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#append_recording(entry_id, asset_id, media_server_index, resource, duration, is_last_chunk = false) ⇒ KalturaLiveEntry

Append recorded video to live entry

Returns:



2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
# File 'lib/kaltura_client.rb', line 2274

def append_recording(entry_id, asset_id, media_server_index, resource, duration, is_last_chunk=false)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'assetId', asset_id)
	client.add_param(kparams, 'mediaServerIndex', media_server_index)
	client.add_param(kparams, 'resource', resource)
	client.add_param(kparams, 'duration', duration)
	client.add_param(kparams, 'isLastChunk', is_last_chunk)
	client.queue_service_action_call('livechannel', 'appendRecording', 'KalturaLiveEntry', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#create_recorded_entry(entry_id, media_server_index, live_entry_status) ⇒ KalturaLiveEntry

Create recorded entry id if it doesn’t exist and make sure it happens on the DC that the live entry was created on.

Returns:



2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
# File 'lib/kaltura_client.rb', line 2291

def create_recorded_entry(entry_id, media_server_index, live_entry_status)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'mediaServerIndex', media_server_index)
	client.add_param(kparams, 'liveEntryStatus', live_entry_status)
	client.queue_service_action_call('livechannel', 'createRecordedEntry', 'KalturaLiveEntry', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#delete(id) ⇒ Object

Delete a live channel.

Returns:



2305
2306
2307
2308
2309
2310
2311
2312
2313
# File 'lib/kaltura_client.rb', line 2305

def delete(id)
	kparams = {}
	client.add_param(kparams, 'id', id)
	client.queue_service_action_call('livechannel', 'delete', '', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#get(id) ⇒ KalturaLiveChannel

Get live channel by ID.

Returns:



2317
2318
2319
2320
2321
2322
2323
2324
2325
# File 'lib/kaltura_client.rb', line 2317

def get(id)
	kparams = {}
	client.add_param(kparams, 'id', id)
	client.queue_service_action_call('livechannel', 'get', 'KalturaLiveChannel', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#is_live(id) ⇒ bool

Delivering the status of a live channel (on-air/offline)

Returns:

  • (bool)


2329
2330
2331
2332
2333
2334
2335
2336
2337
# File 'lib/kaltura_client.rb', line 2329

def is_live(id)
	kparams = {}
	client.add_param(kparams, 'id', id)
	client.queue_service_action_call('livechannel', 'isLive', 'bool', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

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

List live channels by filter with paging support.



2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
# File 'lib/kaltura_client.rb', line 2341

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

#register_media_server(entry_id, hostname, media_server_index, application_name = KalturaNotImplemented, live_entry_status = 1, should_create_recorded_entry = true) ⇒ KalturaLiveEntry

Register media server to live entry

Returns:



2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
# File 'lib/kaltura_client.rb', line 2354

def register_media_server(entry_id, hostname, media_server_index, application_name=KalturaNotImplemented, live_entry_status=1, should_create_recorded_entry=true)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'hostname', hostname)
	client.add_param(kparams, 'mediaServerIndex', media_server_index)
	client.add_param(kparams, 'applicationName', application_name)
	client.add_param(kparams, 'liveEntryStatus', live_entry_status)
	client.add_param(kparams, 'shouldCreateRecordedEntry', should_create_recorded_entry)
	client.queue_service_action_call('livechannel', 'registerMediaServer', 'KalturaLiveEntry', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#set_recorded_content(entry_id, media_server_index, resource, duration, recorded_entry_id = KalturaNotImplemented, flavor_params_id = KalturaNotImplemented) ⇒ KalturaLiveEntry

Set recorded video to live entry

Returns:



2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
# File 'lib/kaltura_client.rb', line 2371

def set_recorded_content(entry_id, media_server_index, resource, duration, recorded_entry_id=KalturaNotImplemented, flavor_params_id=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'mediaServerIndex', media_server_index)
	client.add_param(kparams, 'resource', resource)
	client.add_param(kparams, 'duration', duration)
	client.add_param(kparams, 'recordedEntryId', recorded_entry_id)
	client.add_param(kparams, 'flavorParamsId', flavor_params_id)
	client.queue_service_action_call('livechannel', 'setRecordedContent', 'KalturaLiveEntry', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#unregister_media_server(entry_id, hostname, media_server_index) ⇒ KalturaLiveEntry

Unregister media server from live entry

Returns:



2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
# File 'lib/kaltura_client.rb', line 2388

def unregister_media_server(entry_id, hostname, media_server_index)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'hostname', hostname)
	client.add_param(kparams, 'mediaServerIndex', media_server_index)
	client.queue_service_action_call('livechannel', 'unregisterMediaServer', 'KalturaLiveEntry', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#update(id, live_channel) ⇒ KalturaLiveChannel

Update live channel. Only the properties that were set will be updated.

Returns:



2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
# File 'lib/kaltura_client.rb', line 2402

def update(id, live_channel)
	kparams = {}
	client.add_param(kparams, 'id', id)
	client.add_param(kparams, 'liveChannel', live_channel)
	client.queue_service_action_call('livechannel', 'update', 'KalturaLiveChannel', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#validate_registered_media_servers(entry_id) ⇒ Object

Validates all registered media servers

Returns:



2415
2416
2417
2418
2419
2420
2421
2422
2423
# File 'lib/kaltura_client.rb', line 2415

def validate_registered_media_servers(entry_id)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.queue_service_action_call('livechannel', 'validateRegisteredMediaServers', '', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end