Class: Kaltura::KalturaLiveStreamService

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

Overview

Live Stream service lets you manage live stream entries

Instance Attribute Summary

Attributes inherited from KalturaServiceBase

#client

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ KalturaLiveStreamService

Returns a new instance of KalturaLiveStreamService.



2432
2433
2434
# File 'lib/kaltura_client.rb', line 2432

def initialize(client)
	super(client)
end

Instance Method Details

#add(live_stream_entry, source_type = KalturaNotImplemented) ⇒ Object

Adds new live stream entry. The entry will be queued for provision.



2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
# File 'lib/kaltura_client.rb', line 2439

def add(live_stream_entry, source_type=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'liveStreamEntry', live_stream_entry)
	client.add_param(kparams, 'sourceType', source_type)
	client.queue_service_action_call('livestream', 'add', 'KalturaLiveStreamEntry', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#add_live_stream_push_publish_configuration(entry_id, protocol, url = KalturaNotImplemented, live_stream_configuration = KalturaNotImplemented) ⇒ Object

Add new pushPublish configuration to entry



2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
# File 'lib/kaltura_client.rb', line 2556

def add_live_stream_push_publish_configuration(entry_id, protocol, url=KalturaNotImplemented, live_stream_configuration=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'protocol', protocol)
	client.add_param(kparams, 'url', url)
	client.add_param(kparams, 'liveStreamConfiguration', live_stream_configuration)
	client.queue_service_action_call('livestream', 'addLiveStreamPushPublishConfiguration', 'KalturaLiveStreamEntry', 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) ⇒ Object

Append recorded video to live entry



2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
# File 'lib/kaltura_client.rb', line 2584

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('livestream', 'appendRecording', 'KalturaLiveEntry', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#authenticate(entry_id, token) ⇒ Object

Authenticate live-stream entry against stream token and partner limitations



2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
# File 'lib/kaltura_client.rb', line 2465

def authenticate(entry_id, token)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'token', token)
	client.queue_service_action_call('livestream', 'authenticate', 'KalturaLiveStreamEntry', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#create_periodic_sync_points(entry_id, interval, duration) ⇒ Object

Creates perioding metadata sync-point events on a live stream



2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
# File 'lib/kaltura_client.rb', line 2642

def create_periodic_sync_points(entry_id, interval, duration)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'interval', interval)
	client.add_param(kparams, 'duration', duration)
	client.queue_service_action_call('livestream', 'createPeriodicSyncPoints', '', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#delete(entry_id) ⇒ Object

Delete a live stream entry.



2491
2492
2493
2494
2495
2496
2497
2498
2499
# File 'lib/kaltura_client.rb', line 2491

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

#get(entry_id, version = -1)) ⇒ Object

Get live stream entry by ID.



2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
# File 'lib/kaltura_client.rb', line 2452

def get(entry_id, version=-1)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'version', version)
	client.queue_service_action_call('livestream', 'get', 'KalturaLiveStreamEntry', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#is_live(id, protocol) ⇒ Object

Delivering the status of a live stream (on-air/offline) if it is possible



2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
# File 'lib/kaltura_client.rb', line 2543

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

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

List live stream entries by filter with paging support.



2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
# File 'lib/kaltura_client.rb', line 2503

def list(filter=KalturaNotImplemented, pager=KalturaNotImplemented)
	kparams = {}
	client.add_param(kparams, 'filter', filter)
	client.add_param(kparams, 'pager', pager)
	client.queue_service_action_call('livestream', 'list', 'KalturaLiveStreamListResponse', 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) ⇒ Object

Register media server to live entry



2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
# File 'lib/kaltura_client.rb', line 2601

def register_media_server(entry_id, hostname, media_server_index, application_name=KalturaNotImplemented)
	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.queue_service_action_call('livestream', 'registerMediaServer', 'KalturaLiveEntry', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#remove_live_stream_push_publish_configuration(entry_id, protocol) ⇒ Object

Remove push publish configuration from entry



2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
# File 'lib/kaltura_client.rb', line 2571

def remove_live_stream_push_publish_configuration(entry_id, protocol)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'protocol', protocol)
	client.queue_service_action_call('livestream', 'removeLiveStreamPushPublishConfiguration', 'KalturaLiveStreamEntry', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#unregister_media_server(entry_id, hostname, media_server_index) ⇒ Object

Unregister media server from live entry



2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
# File 'lib/kaltura_client.rb', line 2616

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('livestream', 'unregisterMediaServer', 'KalturaLiveEntry', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#update(entry_id, live_stream_entry) ⇒ Object

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



2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
# File 'lib/kaltura_client.rb', line 2478

def update(entry_id, live_stream_entry)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'liveStreamEntry', live_stream_entry)
	client.queue_service_action_call('livestream', 'update', 'KalturaLiveStreamEntry', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#update_offline_thumbnail_from_url(entry_id, url) ⇒ Object

Update entry thumbnail using url



2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
# File 'lib/kaltura_client.rb', line 2530

def update_offline_thumbnail_from_url(entry_id, url)
	kparams = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kparams, 'url', url)
	client.queue_service_action_call('livestream', 'updateOfflineThumbnailFromUrl', 'KalturaLiveStreamEntry', kparams)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#update_offline_thumbnail_jpeg(entry_id, file_data) ⇒ Object

Update live stream entry thumbnail using a raw jpeg file



2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
# File 'lib/kaltura_client.rb', line 2516

def update_offline_thumbnail_jpeg(entry_id, file_data)
	kparams = {}
	kfiles = {}
	client.add_param(kparams, 'entryId', entry_id)
	client.add_param(kfiles, 'fileData', file_data)
	client.queue_service_action_call('livestream', 'updateOfflineThumbnailJpeg', 'KalturaLiveStreamEntry', kparams, kfiles)
	if (client.is_multirequest)
		return nil
	end
	return client.do_queue()
end

#validate_registered_media_servers(entry_id) ⇒ Object

Validates all registered media servers



2630
2631
2632
2633
2634
2635
2636
2637
2638
# File 'lib/kaltura_client.rb', line 2630

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