Class: Conversant::V3::Services::LMS::Preset

Inherits:
Object
  • Object
show all
Defined in:
lib/conversant/v3/services/lms/preset.rb

Overview

Preset service for live transcoding preset management

Manages transcoding presets which define encoding parameters such as bitrate, resolution, codec settings for live streams.

Examples:

Get all transcoding presets

lms = Conversant::V3.lms(12345)

presets = lms.preset.all
presets.each do |preset|
  puts "#{preset['name']}: #{preset['resolution']} @ #{preset['bitrate']}"
end

Since:

  • 1.0.8

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ Preset

Initialize preset service

Parameters:

  • parent (LMS)

    the parent LMS service instance

Since:

  • 1.0.8



28
29
30
# File 'lib/conversant/v3/services/lms/preset.rb', line 28

def initialize(parent)
  @parent = parent
end

Instance Attribute Details

#parentLMS (readonly)

Returns the parent LMS service instance.

Returns:

  • (LMS)

    the parent LMS service instance

Since:

  • 1.0.8



23
24
25
# File 'lib/conversant/v3/services/lms/preset.rb', line 23

def parent
  @parent
end

Instance Method Details

#allArray<Hash>

Get all available transcoding presets

Retrieves the list of transcoding presets configured for the customer, including encoding parameters like resolution, bitrate, codec settings.

Examples:

Get all presets

presets = lms.preset.all
presets.each do |preset|
  puts "#{preset['name']}: #{preset['resolution']} @ #{preset['bitrate']}"
end

Returns:

  • (Array<Hash>)

    array of preset configurations, or empty array on error

Since:

  • 1.0.8



46
47
48
49
50
51
52
# File 'lib/conversant/v3/services/lms/preset.rb', line 46

def all
  response = JSON.parse(@parent.send(:call, 'GET', '/live/preset/list_page'))
  response&.[]('list') || []
rescue StandardError => e
  @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.message}"
  []
end