mux_ruby 1.8.1 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/docs/Asset.md +13 -12
- data/docs/AssetErrors.md +2 -2
- data/docs/AssetNonStandardInputReasons.md +9 -9
- data/docs/AssetRecordingTimes.md +2 -2
- data/docs/AssetStaticRenditions.md +1 -1
- data/docs/AssetsApi.md +4 -0
- data/docs/CreateAssetRequest.md +6 -6
- data/docs/CreateTrackRequest.md +4 -4
- data/docs/GetAssetOrLiveStreamIdResponse.md +8 -0
- data/docs/GetAssetOrLiveStreamIdResponseData.md +10 -0
- data/docs/GetAssetOrLiveStreamIdResponseDataObject.md +9 -0
- data/docs/InputSettings.md +9 -7
- data/docs/InputSettingsOverlaySettings.md +7 -7
- data/docs/PlaybackID.md +1 -1
- data/docs/PlaybackIDApi.md +60 -0
- data/docs/Track.md +13 -13
- data/examples/video/exercise-assets.rb +21 -0
- data/examples/video/exercise-live-streams.rb +8 -0
- data/lib/mux_ruby.rb +4 -0
- data/lib/mux_ruby/api/assets_api.rb +4 -0
- data/lib/mux_ruby/api/playback_id_api.rb +69 -0
- data/lib/mux_ruby/api_client.rb +12 -12
- data/lib/mux_ruby/models/asset.rb +38 -4
- data/lib/mux_ruby/models/asset_errors.rb +2 -0
- data/lib/mux_ruby/models/asset_master.rb +35 -0
- data/lib/mux_ruby/models/asset_non_standard_input_reasons.rb +13 -13
- data/lib/mux_ruby/models/asset_recording_times.rb +2 -2
- data/lib/mux_ruby/models/asset_static_renditions.rb +2 -2
- data/lib/mux_ruby/models/asset_static_renditions_files.rb +2 -2
- data/lib/mux_ruby/models/create_asset_request.rb +8 -2
- data/lib/mux_ruby/models/create_track_request.rb +6 -2
- data/lib/mux_ruby/models/get_asset_or_live_stream_id_response.rb +184 -0
- data/lib/mux_ruby/models/get_asset_or_live_stream_id_response_data.rb +203 -0
- data/lib/mux_ruby/models/get_asset_or_live_stream_id_response_data_object.rb +230 -0
- data/lib/mux_ruby/models/input_settings.rb +31 -4
- data/lib/mux_ruby/models/input_settings_overlay_settings.rb +10 -2
- data/lib/mux_ruby/models/playback_id.rb +1 -0
- data/lib/mux_ruby/models/simulcast_target.rb +1 -1
- data/lib/mux_ruby/models/track.rb +27 -2
- data/lib/mux_ruby/models/update_asset_master_access_request.rb +1 -1
- data/lib/mux_ruby/models/update_asset_mp4_support_request.rb +1 -1
- data/lib/mux_ruby/models/upload.rb +1 -1
- data/lib/mux_ruby/version.rb +1 -1
- data/mux_ruby.gemspec +2 -0
- data/spec/api/assets_api_spec.rb +2 -0
- data/spec/api/playback_id_api_spec.rb +40 -0
- data/spec/models/asset_master_spec.rb +4 -0
- data/spec/models/asset_spec.rb +10 -0
- data/spec/models/get_asset_or_live_stream_id_response_data_object_spec.rb +44 -0
- data/spec/models/get_asset_or_live_stream_id_response_data_spec.rb +46 -0
- data/spec/models/get_asset_or_live_stream_id_response_spec.rb +34 -0
- data/spec/models/input_settings_spec.rb +12 -0
- data/spec/models/track_spec.rb +4 -0
- metadata +106 -89
@@ -0,0 +1,230 @@
|
|
1
|
+
=begin
|
2
|
+
# Mux Ruby - Copyright 2019 Mux Inc.
|
3
|
+
# NOTE: This file is auto generated. Do not edit this file manually.
|
4
|
+
=end
|
5
|
+
|
6
|
+
require 'date'
|
7
|
+
|
8
|
+
module MuxRuby
|
9
|
+
# Describes the Asset or LiveStream object associated with the playback ID.
|
10
|
+
class GetAssetOrLiveStreamIdResponseDataObject
|
11
|
+
# The identifier of the object.
|
12
|
+
attr_accessor :id
|
13
|
+
|
14
|
+
# Identifies the object type associated with the playback ID.
|
15
|
+
attr_accessor :type
|
16
|
+
|
17
|
+
class EnumAttributeValidator
|
18
|
+
attr_reader :datatype
|
19
|
+
attr_reader :allowable_values
|
20
|
+
|
21
|
+
def initialize(datatype, allowable_values)
|
22
|
+
@allowable_values = allowable_values.map do |value|
|
23
|
+
case datatype.to_s
|
24
|
+
when /Integer/i
|
25
|
+
value.to_i
|
26
|
+
when /Float/i
|
27
|
+
value.to_f
|
28
|
+
else
|
29
|
+
value
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def valid?(value)
|
35
|
+
!value || allowable_values.include?(value)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
40
|
+
def self.attribute_map
|
41
|
+
{
|
42
|
+
:'id' => :'id',
|
43
|
+
:'type' => :'type'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Attribute type mapping.
|
48
|
+
def self.openapi_types
|
49
|
+
{
|
50
|
+
:'id' => :'String',
|
51
|
+
:'type' => :'String'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# Initializes the object
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
57
|
+
def initialize(attributes = {})
|
58
|
+
return unless attributes.is_a?(Hash)
|
59
|
+
|
60
|
+
# convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
62
|
+
|
63
|
+
if attributes.has_key?(:'id')
|
64
|
+
self.id = attributes[:'id']
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.has_key?(:'type')
|
68
|
+
self.type = attributes[:'type']
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
73
|
+
# @return Array for valid properties with the reasons
|
74
|
+
def list_invalid_properties
|
75
|
+
invalid_properties = Array.new
|
76
|
+
invalid_properties
|
77
|
+
end
|
78
|
+
|
79
|
+
# Check to see if the all the properties in the model are valid
|
80
|
+
# @return true if the model is valid
|
81
|
+
def valid?
|
82
|
+
type_validator = EnumAttributeValidator.new('String', ['asset', 'live_stream'])
|
83
|
+
return false unless type_validator.valid?(@type)
|
84
|
+
true
|
85
|
+
end
|
86
|
+
|
87
|
+
# Custom attribute writer method checking allowed values (enum).
|
88
|
+
# @param [Object] type Object to be assigned
|
89
|
+
def type=(type)
|
90
|
+
validator = EnumAttributeValidator.new('String', ['asset', 'live_stream'])
|
91
|
+
unless validator.valid?(type)
|
92
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
93
|
+
end
|
94
|
+
@type = type
|
95
|
+
end
|
96
|
+
|
97
|
+
# Checks equality by comparing each attribute.
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def ==(o)
|
100
|
+
return true if self.equal?(o)
|
101
|
+
self.class == o.class &&
|
102
|
+
id == o.id &&
|
103
|
+
type == o.type
|
104
|
+
end
|
105
|
+
|
106
|
+
# @see the `==` method
|
107
|
+
# @param [Object] Object to be compared
|
108
|
+
def eql?(o)
|
109
|
+
self == o
|
110
|
+
end
|
111
|
+
|
112
|
+
# Calculates hash code according to all attributes.
|
113
|
+
# @return [Fixnum] Hash code
|
114
|
+
def hash
|
115
|
+
[id, type].hash
|
116
|
+
end
|
117
|
+
|
118
|
+
# Builds the object from hash
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
120
|
+
# @return [Object] Returns the model itself
|
121
|
+
def self.build_from_hash(attributes)
|
122
|
+
new.build_from_hash(attributes)
|
123
|
+
end
|
124
|
+
|
125
|
+
# Builds the object from hash
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
127
|
+
# @return [Object] Returns the model itself
|
128
|
+
def build_from_hash(attributes)
|
129
|
+
return nil unless attributes.is_a?(Hash)
|
130
|
+
self.class.openapi_types.each_pair do |key, type|
|
131
|
+
if type =~ /\AArray<(.*)>/i
|
132
|
+
# check to ensure the input is an array given that the attribute
|
133
|
+
# is documented as an array but the input is not
|
134
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
135
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
136
|
+
end
|
137
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
138
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
139
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
140
|
+
end
|
141
|
+
|
142
|
+
self
|
143
|
+
end
|
144
|
+
|
145
|
+
# Deserializes the data based on type
|
146
|
+
# @param string type Data type
|
147
|
+
# @param string value Value to be deserialized
|
148
|
+
# @return [Object] Deserialized data
|
149
|
+
def _deserialize(type, value)
|
150
|
+
case type.to_sym
|
151
|
+
when :DateTime
|
152
|
+
DateTime.parse(value)
|
153
|
+
when :Date
|
154
|
+
Date.parse(value)
|
155
|
+
when :String
|
156
|
+
value.to_s
|
157
|
+
when :Integer
|
158
|
+
value.to_i
|
159
|
+
when :Float
|
160
|
+
value.to_f
|
161
|
+
when :BOOLEAN
|
162
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
163
|
+
true
|
164
|
+
else
|
165
|
+
false
|
166
|
+
end
|
167
|
+
when :Object
|
168
|
+
# generic object (usually a Hash), return directly
|
169
|
+
value
|
170
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
171
|
+
inner_type = Regexp.last_match[:inner_type]
|
172
|
+
value.map { |v| _deserialize(inner_type, v) }
|
173
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
174
|
+
k_type = Regexp.last_match[:k_type]
|
175
|
+
v_type = Regexp.last_match[:v_type]
|
176
|
+
{}.tap do |hash|
|
177
|
+
value.each do |k, v|
|
178
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
else # model
|
182
|
+
MuxRuby.const_get(type).build_from_hash(value)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the string representation of the object
|
187
|
+
# @return [String] String presentation of the object
|
188
|
+
def to_s
|
189
|
+
to_hash.to_s
|
190
|
+
end
|
191
|
+
|
192
|
+
# to_body is an alias to to_hash (backward compatibility)
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
194
|
+
def to_body
|
195
|
+
to_hash
|
196
|
+
end
|
197
|
+
|
198
|
+
# Returns the object in the form of hash
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
200
|
+
def to_hash
|
201
|
+
hash = {}
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
203
|
+
value = self.send(attr)
|
204
|
+
next if value.nil?
|
205
|
+
hash[param] = _to_hash(value)
|
206
|
+
end
|
207
|
+
hash
|
208
|
+
end
|
209
|
+
|
210
|
+
# Outputs non-array value in the form of hash
|
211
|
+
# For object, use to_hash. Otherwise, just return the value
|
212
|
+
# @param [Object] value Any valid value
|
213
|
+
# @return [Hash] Returns the value in the form of hash
|
214
|
+
def _to_hash(value)
|
215
|
+
if value.is_a?(Array)
|
216
|
+
value.compact.map { |v| _to_hash(v) }
|
217
|
+
elsif value.is_a?(Hash)
|
218
|
+
{}.tap do |hash|
|
219
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
220
|
+
end
|
221
|
+
elsif value.respond_to? :to_hash
|
222
|
+
value.to_hash
|
223
|
+
else
|
224
|
+
value
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
end
|
229
|
+
|
230
|
+
end
|
@@ -6,22 +6,35 @@
|
|
6
6
|
require 'date'
|
7
7
|
|
8
8
|
module MuxRuby
|
9
|
-
#
|
9
|
+
# An array of objects that each describe an input file to be used to create the asset. As a shortcut, `input` can also be a string URL for a file when only one input file is used. See `input[].url` for requirements.
|
10
10
|
class InputSettings
|
11
|
+
# The web address of the file that Mux should download and use. * For subtitles text tracks, the url is the location of subtitle/captions file. Mux supports [SubRip Text (SRT)](https://en.wikipedia.org/wiki/SubRip) and [Web Video Text Tracks](https://www.w3.org/TR/webvtt1/) format for ingesting Subtitles and Closed Captions. * For Watermarking or Overlay, the url is the location of the watermark image. * When creating clips from existing Mux assets, the url is defined with `mux://assets/{asset_id}` template where `asset_id` is the Asset Identifier for creating the clip from.
|
11
12
|
attr_accessor :url
|
12
13
|
|
13
14
|
attr_accessor :overlay_settings
|
14
15
|
|
16
|
+
# The time offset in seconds from the beginning of the video indicating the clip's starting marker. The default value is 0 when not included.
|
17
|
+
attr_accessor :start_time
|
18
|
+
|
19
|
+
# The time offset in seconds from the beginning of the video, indicating the clip's ending marker. The default value is the duration of the video when not included.
|
20
|
+
attr_accessor :end_time
|
21
|
+
|
22
|
+
# This parameter is required for the `text` track type.
|
15
23
|
attr_accessor :type
|
16
24
|
|
25
|
+
# Type of text track. This parameter only supports subtitles value. For more information on Subtitles / Closed Captions, [see this blog post](https://mux.com/blog/subtitles-captions-webvtt-hls-and-those-magic-flags/). This parameter is required for `text` track type.
|
17
26
|
attr_accessor :text_type
|
18
27
|
|
28
|
+
# The language code value must be a valid [BCP 47](https://tools.ietf.org/html/bcp47) specification compliant value. For example, en for English or en-US for the US version of English. This parameter is required for text type and subtitles text type track.
|
19
29
|
attr_accessor :language_code
|
20
30
|
|
31
|
+
# The name of the track containing a human-readable description. This value must be unique across all text type and subtitles `text` type tracks. The hls manifest will associate a subtitle text track with this value. For example, the value should be \"English\" for subtitles text track with language_code as en. This optional parameter should be used only for `text` type and subtitles `text` type track. If this parameter is not included, Mux will auto-populate based on the `input[].language_code` value.
|
21
32
|
attr_accessor :name
|
22
33
|
|
34
|
+
# Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). This optional parameter should be used for `text` type and subtitles `text` type tracks.
|
23
35
|
attr_accessor :closed_captions
|
24
36
|
|
37
|
+
# This optional parameter should be used for `text` type and subtitles `text` type tracks.
|
25
38
|
attr_accessor :passthrough
|
26
39
|
|
27
40
|
class EnumAttributeValidator
|
@@ -51,6 +64,8 @@ module MuxRuby
|
|
51
64
|
{
|
52
65
|
:'url' => :'url',
|
53
66
|
:'overlay_settings' => :'overlay_settings',
|
67
|
+
:'start_time' => :'start_time',
|
68
|
+
:'end_time' => :'end_time',
|
54
69
|
:'type' => :'type',
|
55
70
|
:'text_type' => :'text_type',
|
56
71
|
:'language_code' => :'language_code',
|
@@ -65,6 +80,8 @@ module MuxRuby
|
|
65
80
|
{
|
66
81
|
:'url' => :'String',
|
67
82
|
:'overlay_settings' => :'InputSettingsOverlaySettings',
|
83
|
+
:'start_time' => :'Float',
|
84
|
+
:'end_time' => :'Float',
|
68
85
|
:'type' => :'String',
|
69
86
|
:'text_type' => :'String',
|
70
87
|
:'language_code' => :'String',
|
@@ -90,6 +107,14 @@ module MuxRuby
|
|
90
107
|
self.overlay_settings = attributes[:'overlay_settings']
|
91
108
|
end
|
92
109
|
|
110
|
+
if attributes.has_key?(:'start_time')
|
111
|
+
self.start_time = attributes[:'start_time']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.has_key?(:'end_time')
|
115
|
+
self.end_time = attributes[:'end_time']
|
116
|
+
end
|
117
|
+
|
93
118
|
if attributes.has_key?(:'type')
|
94
119
|
self.type = attributes[:'type']
|
95
120
|
end
|
@@ -137,7 +162,7 @@ module MuxRuby
|
|
137
162
|
def type=(type)
|
138
163
|
validator = EnumAttributeValidator.new('String', ['video', 'audio', 'text'])
|
139
164
|
unless validator.valid?(type)
|
140
|
-
fail ArgumentError,
|
165
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
141
166
|
end
|
142
167
|
@type = type
|
143
168
|
end
|
@@ -147,7 +172,7 @@ module MuxRuby
|
|
147
172
|
def text_type=(text_type)
|
148
173
|
validator = EnumAttributeValidator.new('String', ['subtitles'])
|
149
174
|
unless validator.valid?(text_type)
|
150
|
-
fail ArgumentError,
|
175
|
+
fail ArgumentError, "invalid value for \"text_type\", must be one of #{validator.allowable_values}."
|
151
176
|
end
|
152
177
|
@text_type = text_type
|
153
178
|
end
|
@@ -159,6 +184,8 @@ module MuxRuby
|
|
159
184
|
self.class == o.class &&
|
160
185
|
url == o.url &&
|
161
186
|
overlay_settings == o.overlay_settings &&
|
187
|
+
start_time == o.start_time &&
|
188
|
+
end_time == o.end_time &&
|
162
189
|
type == o.type &&
|
163
190
|
text_type == o.text_type &&
|
164
191
|
language_code == o.language_code &&
|
@@ -176,7 +203,7 @@ module MuxRuby
|
|
176
203
|
# Calculates hash code according to all attributes.
|
177
204
|
# @return [Fixnum] Hash code
|
178
205
|
def hash
|
179
|
-
[url, overlay_settings, type, text_type, language_code, name, closed_captions, passthrough].hash
|
206
|
+
[url, overlay_settings, start_time, end_time, type, text_type, language_code, name, closed_captions, passthrough].hash
|
180
207
|
end
|
181
208
|
|
182
209
|
# Builds the object from hash
|
@@ -6,19 +6,27 @@
|
|
6
6
|
require 'date'
|
7
7
|
|
8
8
|
module MuxRuby
|
9
|
+
# An object that describes how the image file referenced in url should be placed over the video (i.e. watermarking).
|
9
10
|
class InputSettingsOverlaySettings
|
11
|
+
# Where the vertical positioning of the overlay/watermark should begin from. Defaults to `\"top\"`
|
10
12
|
attr_accessor :vertical_align
|
11
13
|
|
14
|
+
# The distance from the vertical_align starting point and the image's closest edge. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). Negative values will move the overlay offscreen. In the case of 'middle', a positive value will shift the overlay towards the bottom and and a negative value will shift it towards the top.
|
12
15
|
attr_accessor :vertical_margin
|
13
16
|
|
17
|
+
# Where the horizontal positioning of the overlay/watermark should begin from.
|
14
18
|
attr_accessor :horizontal_align
|
15
19
|
|
20
|
+
# The distance from the horizontal_align starting point and the image's closest edge. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). Negative values will move the overlay offscreen. In the case of 'center', a positive value will shift the image towards the right and and a negative value will shift it towards the left.
|
16
21
|
attr_accessor :horizontal_margin
|
17
22
|
|
23
|
+
# How wide the overlay should appear. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). If both width and height are left blank the width will be the true pixels of the image, applied as if the video has been scaled to fit a 1920x1080 frame. If height is supplied with no width, the width will scale proportionally to the height.
|
18
24
|
attr_accessor :width
|
19
25
|
|
26
|
+
# How tall the overlay should appear. Can be expressed as a percent (\"10%\") or as a pixel value (\"100px\"). If both width and height are left blank the height will be the true pixels of the image, applied as if the video has been scaled to fit a 1920x1080 frame. If width is supplied with no height, the height will scale proportionally to the width.
|
20
27
|
attr_accessor :height
|
21
28
|
|
29
|
+
# How opaque the overlay should appear, expressed as a percent. (Default 100%)
|
22
30
|
attr_accessor :opacity
|
23
31
|
|
24
32
|
class EnumAttributeValidator
|
@@ -128,7 +136,7 @@ module MuxRuby
|
|
128
136
|
def vertical_align=(vertical_align)
|
129
137
|
validator = EnumAttributeValidator.new('String', ['top', 'middle', 'bottom'])
|
130
138
|
unless validator.valid?(vertical_align)
|
131
|
-
fail ArgumentError,
|
139
|
+
fail ArgumentError, "invalid value for \"vertical_align\", must be one of #{validator.allowable_values}."
|
132
140
|
end
|
133
141
|
@vertical_align = vertical_align
|
134
142
|
end
|
@@ -138,7 +146,7 @@ module MuxRuby
|
|
138
146
|
def horizontal_align=(horizontal_align)
|
139
147
|
validator = EnumAttributeValidator.new('String', ['left', 'center', 'right'])
|
140
148
|
unless validator.valid?(horizontal_align)
|
141
|
-
fail ArgumentError,
|
149
|
+
fail ArgumentError, "invalid value for \"horizontal_align\", must be one of #{validator.allowable_values}."
|
142
150
|
end
|
143
151
|
@horizontal_align = horizontal_align
|
144
152
|
end
|
@@ -115,7 +115,7 @@ module MuxRuby
|
|
115
115
|
def status=(status)
|
116
116
|
validator = EnumAttributeValidator.new('String', ['idle', 'starting', 'broadcasting', 'errored'])
|
117
117
|
unless validator.valid?(status)
|
118
|
-
fail ArgumentError,
|
118
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
119
119
|
end
|
120
120
|
@status = status
|
121
121
|
end
|
@@ -7,30 +7,43 @@ require 'date'
|
|
7
7
|
|
8
8
|
module MuxRuby
|
9
9
|
class Track
|
10
|
+
# Unique identifier for the Track
|
10
11
|
attr_accessor :id
|
11
12
|
|
13
|
+
# The type of track
|
12
14
|
attr_accessor :type
|
13
15
|
|
16
|
+
# The duration in seconds of the track media. This parameter is not set for the `text` type track. This field is optional and may not be set. The top level `duration` field of an asset will always be set.
|
14
17
|
attr_accessor :duration
|
15
18
|
|
19
|
+
# The maximum width in pixels available for the track. Only set for the `video` type track.
|
16
20
|
attr_accessor :max_width
|
17
21
|
|
22
|
+
# The maximum height in pixels available for the track. Only set for the `video` type track.
|
18
23
|
attr_accessor :max_height
|
19
24
|
|
25
|
+
# The maximum frame rate available for the track. Only set for the `video` type track. This field may return `-1` if the frame rate of the input cannot be reliably determined.
|
20
26
|
attr_accessor :max_frame_rate
|
21
27
|
|
28
|
+
# The maximum number of audio channels the track supports. Only set for the `audio` type track.
|
22
29
|
attr_accessor :max_channels
|
23
30
|
|
31
|
+
# Only set for the `audio` type track.
|
24
32
|
attr_accessor :max_channel_layout
|
25
33
|
|
34
|
+
# This parameter is set only for the `text` type track.
|
26
35
|
attr_accessor :text_type
|
27
36
|
|
37
|
+
# The language code value represents [BCP 47](https://tools.ietf.org/html/bcp47) specification compliant value. For example, `en` for English or `en-US` for the US version of English. This parameter is set for `text` type and `subtitles` text type track.
|
28
38
|
attr_accessor :language_code
|
29
39
|
|
40
|
+
# The name of the track containing a human-readable description. The hls manifest will associate a subtitle text track with this value. For example, the value is \"English\" for subtitles text track for the `language_code` value of `en-US`. This parameter is set for the `text` type and `subtitles` text type track.
|
30
41
|
attr_accessor :name
|
31
42
|
|
43
|
+
# Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). This parameter is set for the `text` type and `subtitles` text type track.
|
32
44
|
attr_accessor :closed_captions
|
33
45
|
|
46
|
+
# Arbitrary metadata set for the track either when creating the asset or track. This parameter is set for `text` type and `subtitles` text type track. Max 255 characters.
|
34
47
|
attr_accessor :passthrough
|
35
48
|
|
36
49
|
class EnumAttributeValidator
|
@@ -166,6 +179,8 @@ module MuxRuby
|
|
166
179
|
def valid?
|
167
180
|
type_validator = EnumAttributeValidator.new('String', ['video', 'audio', 'text'])
|
168
181
|
return false unless type_validator.valid?(@type)
|
182
|
+
max_channel_layout_validator = EnumAttributeValidator.new('String', ['mono', 'stereo', '5.2', '7.1'])
|
183
|
+
return false unless max_channel_layout_validator.valid?(@max_channel_layout)
|
169
184
|
text_type_validator = EnumAttributeValidator.new('String', ['subtitles'])
|
170
185
|
return false unless text_type_validator.valid?(@text_type)
|
171
186
|
true
|
@@ -176,17 +191,27 @@ module MuxRuby
|
|
176
191
|
def type=(type)
|
177
192
|
validator = EnumAttributeValidator.new('String', ['video', 'audio', 'text'])
|
178
193
|
unless validator.valid?(type)
|
179
|
-
fail ArgumentError,
|
194
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
180
195
|
end
|
181
196
|
@type = type
|
182
197
|
end
|
183
198
|
|
199
|
+
# Custom attribute writer method checking allowed values (enum).
|
200
|
+
# @param [Object] max_channel_layout Object to be assigned
|
201
|
+
def max_channel_layout=(max_channel_layout)
|
202
|
+
validator = EnumAttributeValidator.new('String', ['mono', 'stereo', '5.2', '7.1'])
|
203
|
+
unless validator.valid?(max_channel_layout)
|
204
|
+
fail ArgumentError, "invalid value for \"max_channel_layout\", must be one of #{validator.allowable_values}."
|
205
|
+
end
|
206
|
+
@max_channel_layout = max_channel_layout
|
207
|
+
end
|
208
|
+
|
184
209
|
# Custom attribute writer method checking allowed values (enum).
|
185
210
|
# @param [Object] text_type Object to be assigned
|
186
211
|
def text_type=(text_type)
|
187
212
|
validator = EnumAttributeValidator.new('String', ['subtitles'])
|
188
213
|
unless validator.valid?(text_type)
|
189
|
-
fail ArgumentError,
|
214
|
+
fail ArgumentError, "invalid value for \"text_type\", must be one of #{validator.allowable_values}."
|
190
215
|
end
|
191
216
|
@text_type = text_type
|
192
217
|
end
|