mux_ruby 2.2.0 → 3.3.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 +4 -4
- data/README.md +4 -4
- data/docs/Asset.md +1 -1
- data/docs/AssetNonStandardInputReasons.md +2 -0
- data/docs/AssetsApi.md +73 -0
- data/docs/CreateAssetRequest.md +1 -1
- data/docs/CreateLiveStreamRequest.md +6 -2
- data/docs/CreatePlaybackRestrictionRequest.md +18 -0
- data/docs/CreateSimulcastTargetRequest.md +1 -1
- data/docs/CreateTrackRequest.md +1 -1
- data/docs/DeliveryUsageApi.md +4 -2
- data/docs/DimensionsApi.md +4 -4
- data/docs/ErrorsApi.md +4 -4
- data/docs/ExportsApi.md +1 -1
- data/docs/FiltersApi.md +6 -6
- data/docs/InputSettings.md +1 -1
- data/docs/LiveStream.md +8 -4
- data/docs/LiveStreamEmbeddedSubtitleSettings.md +24 -0
- data/docs/LiveStreamStatus.md +15 -0
- data/docs/LiveStreamsApi.md +149 -1
- data/docs/MetricsApi.md +20 -20
- data/docs/PlaybackRestriction.md +24 -0
- data/docs/PlaybackRestrictionResponse.md +15 -0
- data/docs/PlaybackRestrictionsApi.md +367 -0
- data/docs/RealTimeApi.md +6 -6
- data/docs/ReferrerDomainRestriction.md +20 -0
- data/docs/SimulcastTarget.md +1 -1
- data/docs/Track.md +1 -1
- data/docs/UpdateAssetRequest.md +18 -0
- data/docs/UpdateLiveStreamEmbeddedSubtitlesRequest.md +18 -0
- data/docs/UpdateLiveStreamRequest.md +22 -0
- data/docs/UpdateReferrerDomainRestrictionRequest.md +15 -0
- data/docs/VideoViewsApi.md +4 -4
- data/examples/data/exercise-errors.rb +0 -2
- data/examples/video/exercise-assets.rb +1 -0
- data/gen/generator-config.json +1 -1
- data/lib/mux_ruby/api/assets_api.rb +71 -0
- data/lib/mux_ruby/api/delivery_usage_api.rb +5 -2
- data/lib/mux_ruby/api/dimensions_api.rb +4 -4
- data/lib/mux_ruby/api/errors_api.rb +4 -4
- data/lib/mux_ruby/api/exports_api.rb +2 -2
- data/lib/mux_ruby/api/filters_api.rb +8 -8
- data/lib/mux_ruby/api/live_streams_api.rb +145 -0
- data/lib/mux_ruby/api/metrics_api.rb +20 -20
- data/lib/mux_ruby/api/playback_restrictions_api.rb +345 -0
- data/lib/mux_ruby/api/real_time_api.rb +6 -6
- data/lib/mux_ruby/api/video_views_api.rb +4 -4
- data/lib/mux_ruby/models/asset.rb +1 -1
- data/lib/mux_ruby/models/asset_non_standard_input_reasons.rb +23 -1
- data/lib/mux_ruby/models/create_asset_request.rb +1 -1
- data/lib/mux_ruby/models/create_live_stream_request.rb +59 -3
- data/lib/mux_ruby/models/create_playback_restriction_request.rb +218 -0
- data/lib/mux_ruby/models/create_simulcast_target_request.rb +1 -1
- data/lib/mux_ruby/models/create_track_request.rb +1 -1
- data/lib/mux_ruby/models/input_settings.rb +1 -1
- data/lib/mux_ruby/models/input_settings_overlay_settings.rb +1 -1
- data/lib/mux_ruby/models/live_stream.rb +35 -14
- data/lib/mux_ruby/models/live_stream_embedded_subtitle_settings.rb +287 -0
- data/lib/mux_ruby/models/live_stream_status.rb +38 -0
- data/lib/mux_ruby/models/playback_restriction.rb +248 -0
- data/lib/mux_ruby/models/playback_restriction_response.rb +209 -0
- data/lib/mux_ruby/models/referrer_domain_restriction.rb +234 -0
- data/lib/mux_ruby/models/simulcast_target.rb +1 -1
- data/lib/mux_ruby/models/track.rb +1 -13
- data/lib/mux_ruby/models/update_asset_request.rb +219 -0
- data/lib/mux_ruby/models/update_live_stream_embedded_subtitles_request.rb +221 -0
- data/lib/mux_ruby/models/update_live_stream_request.rb +297 -0
- data/lib/mux_ruby/models/update_referrer_domain_restriction_request.rb +209 -0
- data/lib/mux_ruby/version.rb +1 -1
- data/lib/mux_ruby.rb +11 -0
- data/spec/api/playback_restrictions_api_spec.rb +97 -0
- data/spec/models/create_playback_restriction_request_spec.rb +34 -0
- data/spec/models/live_stream_embedded_subtitle_settings_spec.rb +56 -0
- data/spec/models/live_stream_status_spec.rb +28 -0
- data/spec/models/playback_restriction_response_spec.rb +28 -0
- data/spec/models/playback_restriction_spec.rb +52 -0
- data/spec/models/referrer_domain_restriction_spec.rb +40 -0
- data/spec/models/update_asset_request_spec.rb +34 -0
- data/spec/models/update_live_stream_embedded_subtitles_request_spec.rb +34 -0
- data/spec/models/update_live_stream_request_spec.rb +50 -0
- data/spec/models/update_referrer_domain_restriction_request_spec.rb +28 -0
- metadata +138 -94
@@ -27,17 +27,45 @@ module MuxRuby
|
|
27
27
|
# Force the live stream to only process the audio track when the value is set to true. Mux drops the video track if broadcasted.
|
28
28
|
attr_accessor :audio_only
|
29
29
|
|
30
|
-
#
|
30
|
+
# Describe the embedded closed caption contents of the incoming live stream.
|
31
|
+
attr_accessor :embedded_subtitles
|
32
|
+
|
33
|
+
# This field is deprecated. Please use latency_mode instead. Latency is the time from when the streamer transmits a frame of video to when you see it in the player. Set this if you want lower latency for your live stream. Note: Reconnect windows are incompatible with Reduced Latency and will always be set to zero (0) seconds. Read more here: https://mux.com/blog/reduced-latency-for-mux-live-streaming-now-available/
|
31
34
|
attr_accessor :reduced_latency
|
32
35
|
|
33
|
-
# Latency is the time from when the streamer
|
36
|
+
# This field is deprecated. Please use latency_mode instead. Latency is the time from when the streamer transmits a frame of video to when you see it in the player. Setting this option will enable compatibility with the LL-HLS specification for low-latency streaming. This typically has lower latency than Reduced Latency streams, and cannot be combined with Reduced Latency. Note: Reconnect windows are incompatible with Low Latency and will always be set to zero (0) seconds.
|
34
37
|
attr_accessor :low_latency
|
35
38
|
|
39
|
+
# Latency is the time from when the streamer transmits a frame of video to when you see it in the player. Set this as an alternative to setting low latency or reduced latency flags. The Low Latency value is a beta feature. Note: Reconnect windows are incompatible with Reduced Latency and Low Latency and will always be set to zero (0) seconds. Read more here: https://mux.com/blog/introducing-low-latency-live-streaming/
|
40
|
+
attr_accessor :latency_mode
|
41
|
+
|
36
42
|
# Marks the live stream as a test live stream when the value is set to true. A test live stream can help evaluate the Mux Video APIs without incurring any cost. There is no limit on number of test live streams created. Test live streams are watermarked with the Mux logo and limited to 5 minutes. The test live stream is disabled after the stream is active for 5 mins and the recorded asset also deleted after 24 hours.
|
37
43
|
attr_accessor :test
|
38
44
|
|
39
45
|
attr_accessor :simulcast_targets
|
40
46
|
|
47
|
+
class EnumAttributeValidator
|
48
|
+
attr_reader :datatype
|
49
|
+
attr_reader :allowable_values
|
50
|
+
|
51
|
+
def initialize(datatype, allowable_values)
|
52
|
+
@allowable_values = allowable_values.map do |value|
|
53
|
+
case datatype.to_s
|
54
|
+
when /Integer/i
|
55
|
+
value.to_i
|
56
|
+
when /Float/i
|
57
|
+
value.to_f
|
58
|
+
else
|
59
|
+
value
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def valid?(value)
|
65
|
+
!value || allowable_values.include?(value)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
41
69
|
# Attribute mapping from ruby-style variable name to JSON key.
|
42
70
|
def self.attribute_map
|
43
71
|
{
|
@@ -46,8 +74,10 @@ module MuxRuby
|
|
46
74
|
:'reconnect_window' => :'reconnect_window',
|
47
75
|
:'passthrough' => :'passthrough',
|
48
76
|
:'audio_only' => :'audio_only',
|
77
|
+
:'embedded_subtitles' => :'embedded_subtitles',
|
49
78
|
:'reduced_latency' => :'reduced_latency',
|
50
79
|
:'low_latency' => :'low_latency',
|
80
|
+
:'latency_mode' => :'latency_mode',
|
51
81
|
:'test' => :'test',
|
52
82
|
:'simulcast_targets' => :'simulcast_targets'
|
53
83
|
}
|
@@ -66,8 +96,10 @@ module MuxRuby
|
|
66
96
|
:'reconnect_window' => :'Float',
|
67
97
|
:'passthrough' => :'String',
|
68
98
|
:'audio_only' => :'Boolean',
|
99
|
+
:'embedded_subtitles' => :'Array<LiveStreamEmbeddedSubtitleSettings>',
|
69
100
|
:'reduced_latency' => :'Boolean',
|
70
101
|
:'low_latency' => :'Boolean',
|
102
|
+
:'latency_mode' => :'String',
|
71
103
|
:'test' => :'Boolean',
|
72
104
|
:'simulcast_targets' => :'Array<CreateSimulcastTargetRequest>'
|
73
105
|
}
|
@@ -116,6 +148,12 @@ module MuxRuby
|
|
116
148
|
self.audio_only = attributes[:'audio_only']
|
117
149
|
end
|
118
150
|
|
151
|
+
if attributes.key?(:'embedded_subtitles')
|
152
|
+
if (value = attributes[:'embedded_subtitles']).is_a?(Array)
|
153
|
+
self.embedded_subtitles = value
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
119
157
|
if attributes.key?(:'reduced_latency')
|
120
158
|
self.reduced_latency = attributes[:'reduced_latency']
|
121
159
|
end
|
@@ -124,6 +162,10 @@ module MuxRuby
|
|
124
162
|
self.low_latency = attributes[:'low_latency']
|
125
163
|
end
|
126
164
|
|
165
|
+
if attributes.key?(:'latency_mode')
|
166
|
+
self.latency_mode = attributes[:'latency_mode']
|
167
|
+
end
|
168
|
+
|
127
169
|
if attributes.key?(:'test')
|
128
170
|
self.test = attributes[:'test']
|
129
171
|
end
|
@@ -155,6 +197,8 @@ module MuxRuby
|
|
155
197
|
def valid?
|
156
198
|
return false if !@reconnect_window.nil? && @reconnect_window > 300
|
157
199
|
return false if !@reconnect_window.nil? && @reconnect_window < 0.1
|
200
|
+
latency_mode_validator = EnumAttributeValidator.new('String', ["low", "reduced", "standard"])
|
201
|
+
return false unless latency_mode_validator.valid?(@latency_mode)
|
158
202
|
true
|
159
203
|
end
|
160
204
|
|
@@ -172,6 +216,16 @@ module MuxRuby
|
|
172
216
|
@reconnect_window = reconnect_window
|
173
217
|
end
|
174
218
|
|
219
|
+
# Custom attribute writer method checking allowed values (enum).
|
220
|
+
# @param [Object] latency_mode Object to be assigned
|
221
|
+
def latency_mode=(latency_mode)
|
222
|
+
validator = EnumAttributeValidator.new('String', ["low", "reduced", "standard"])
|
223
|
+
unless validator.valid?(latency_mode)
|
224
|
+
fail ArgumentError, "invalid value for \"latency_mode\", must be one of #{validator.allowable_values}."
|
225
|
+
end
|
226
|
+
@latency_mode = latency_mode
|
227
|
+
end
|
228
|
+
|
175
229
|
# Checks equality by comparing each attribute.
|
176
230
|
# @param [Object] Object to be compared
|
177
231
|
def ==(o)
|
@@ -182,8 +236,10 @@ module MuxRuby
|
|
182
236
|
reconnect_window == o.reconnect_window &&
|
183
237
|
passthrough == o.passthrough &&
|
184
238
|
audio_only == o.audio_only &&
|
239
|
+
embedded_subtitles == o.embedded_subtitles &&
|
185
240
|
reduced_latency == o.reduced_latency &&
|
186
241
|
low_latency == o.low_latency &&
|
242
|
+
latency_mode == o.latency_mode &&
|
187
243
|
test == o.test &&
|
188
244
|
simulcast_targets == o.simulcast_targets
|
189
245
|
end
|
@@ -197,7 +253,7 @@ module MuxRuby
|
|
197
253
|
# Calculates hash code according to all attributes.
|
198
254
|
# @return [Integer] Hash code
|
199
255
|
def hash
|
200
|
-
[playback_policy, new_asset_settings, reconnect_window, passthrough, audio_only, reduced_latency, low_latency, test, simulcast_targets].hash
|
256
|
+
[playback_policy, new_asset_settings, reconnect_window, passthrough, audio_only, embedded_subtitles, reduced_latency, low_latency, latency_mode, test, simulcast_targets].hash
|
201
257
|
end
|
202
258
|
|
203
259
|
# Builds the object from hash
|
@@ -0,0 +1,218 @@
|
|
1
|
+
=begin
|
2
|
+
#Mux API
|
3
|
+
|
4
|
+
#Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
Contact: devex@mux.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module MuxRuby
|
17
|
+
class CreatePlaybackRestrictionRequest
|
18
|
+
attr_accessor :referrer
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'referrer' => :'referrer'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns all the JSON keys this model knows about
|
28
|
+
def self.acceptable_attributes
|
29
|
+
attribute_map.values
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.openapi_types
|
34
|
+
{
|
35
|
+
:'referrer' => :'ReferrerDomainRestriction'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# List of attributes with nullable: true
|
40
|
+
def self.openapi_nullable
|
41
|
+
Set.new([
|
42
|
+
])
|
43
|
+
end
|
44
|
+
|
45
|
+
# Initializes the object
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
47
|
+
def initialize(attributes = {})
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MuxRuby::CreatePlaybackRestrictionRequest` initialize method"
|
50
|
+
end
|
51
|
+
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MuxRuby::CreatePlaybackRestrictionRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
56
|
+
end
|
57
|
+
h[k.to_sym] = v
|
58
|
+
}
|
59
|
+
|
60
|
+
if attributes.key?(:'referrer')
|
61
|
+
self.referrer = attributes[:'referrer']
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
66
|
+
# @return Array for valid properties with the reasons
|
67
|
+
def list_invalid_properties
|
68
|
+
invalid_properties = Array.new
|
69
|
+
invalid_properties
|
70
|
+
end
|
71
|
+
|
72
|
+
# Check to see if the all the properties in the model are valid
|
73
|
+
# @return true if the model is valid
|
74
|
+
def valid?
|
75
|
+
true
|
76
|
+
end
|
77
|
+
|
78
|
+
# Checks equality by comparing each attribute.
|
79
|
+
# @param [Object] Object to be compared
|
80
|
+
def ==(o)
|
81
|
+
return true if self.equal?(o)
|
82
|
+
self.class == o.class &&
|
83
|
+
referrer == o.referrer
|
84
|
+
end
|
85
|
+
|
86
|
+
# @see the `==` method
|
87
|
+
# @param [Object] Object to be compared
|
88
|
+
def eql?(o)
|
89
|
+
self == o
|
90
|
+
end
|
91
|
+
|
92
|
+
# Calculates hash code according to all attributes.
|
93
|
+
# @return [Integer] Hash code
|
94
|
+
def hash
|
95
|
+
[referrer].hash
|
96
|
+
end
|
97
|
+
|
98
|
+
# Builds the object from hash
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
100
|
+
# @return [Object] Returns the model itself
|
101
|
+
def self.build_from_hash(attributes)
|
102
|
+
new.build_from_hash(attributes)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Builds the object from hash
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
# @return [Object] Returns the model itself
|
108
|
+
def build_from_hash(attributes)
|
109
|
+
return nil unless attributes.is_a?(Hash)
|
110
|
+
self.class.openapi_types.each_pair do |key, type|
|
111
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
112
|
+
self.send("#{key}=", nil)
|
113
|
+
elsif type =~ /\AArray<(.*)>/i
|
114
|
+
# check to ensure the input is an array given that the attribute
|
115
|
+
# is documented as an array but the input is not
|
116
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
117
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
118
|
+
end
|
119
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
120
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
self
|
125
|
+
end
|
126
|
+
|
127
|
+
# Deserializes the data based on type
|
128
|
+
# @param string type Data type
|
129
|
+
# @param string value Value to be deserialized
|
130
|
+
# @return [Object] Deserialized data
|
131
|
+
def _deserialize(type, value)
|
132
|
+
case type.to_sym
|
133
|
+
when :Time
|
134
|
+
Time.parse(value)
|
135
|
+
when :Date
|
136
|
+
Date.parse(value)
|
137
|
+
when :String
|
138
|
+
value.to_s
|
139
|
+
when :Integer
|
140
|
+
value.to_i
|
141
|
+
when :Float
|
142
|
+
value.to_f
|
143
|
+
when :Boolean
|
144
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
145
|
+
true
|
146
|
+
else
|
147
|
+
false
|
148
|
+
end
|
149
|
+
when :Object
|
150
|
+
# generic object (usually a Hash), return directly
|
151
|
+
value
|
152
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
153
|
+
inner_type = Regexp.last_match[:inner_type]
|
154
|
+
value.map { |v| _deserialize(inner_type, v) }
|
155
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
156
|
+
k_type = Regexp.last_match[:k_type]
|
157
|
+
v_type = Regexp.last_match[:v_type]
|
158
|
+
{}.tap do |hash|
|
159
|
+
value.each do |k, v|
|
160
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
else # model
|
164
|
+
# models (e.g. Pet) or oneOf
|
165
|
+
klass = MuxRuby.const_get(type)
|
166
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
# Returns the string representation of the object
|
171
|
+
# @return [String] String presentation of the object
|
172
|
+
def to_s
|
173
|
+
to_hash.to_s
|
174
|
+
end
|
175
|
+
|
176
|
+
# to_body is an alias to to_hash (backward compatibility)
|
177
|
+
# @return [Hash] Returns the object in the form of hash
|
178
|
+
def to_body
|
179
|
+
to_hash
|
180
|
+
end
|
181
|
+
|
182
|
+
# Returns the object in the form of hash
|
183
|
+
# @return [Hash] Returns the object in the form of hash
|
184
|
+
def to_hash
|
185
|
+
hash = {}
|
186
|
+
self.class.attribute_map.each_pair do |attr, param|
|
187
|
+
value = self.send(attr)
|
188
|
+
if value.nil?
|
189
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
190
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
191
|
+
end
|
192
|
+
|
193
|
+
hash[param] = _to_hash(value)
|
194
|
+
end
|
195
|
+
hash
|
196
|
+
end
|
197
|
+
|
198
|
+
# Outputs non-array value in the form of hash
|
199
|
+
# For object, use to_hash. Otherwise, just return the value
|
200
|
+
# @param [Object] value Any valid value
|
201
|
+
# @return [Hash] Returns the value in the form of hash
|
202
|
+
def _to_hash(value)
|
203
|
+
if value.is_a?(Array)
|
204
|
+
value.compact.map { |v| _to_hash(v) }
|
205
|
+
elsif value.is_a?(Hash)
|
206
|
+
{}.tap do |hash|
|
207
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
208
|
+
end
|
209
|
+
elsif value.respond_to? :to_hash
|
210
|
+
value.to_hash
|
211
|
+
else
|
212
|
+
value
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
end
|
217
|
+
|
218
|
+
end
|
@@ -15,7 +15,7 @@ require 'time'
|
|
15
15
|
|
16
16
|
module MuxRuby
|
17
17
|
class CreateSimulcastTargetRequest
|
18
|
-
# Arbitrary metadata set by you when creating a simulcast target.
|
18
|
+
# Arbitrary user-supplied metadata set by you when creating a simulcast target.
|
19
19
|
attr_accessor :passthrough
|
20
20
|
|
21
21
|
# Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to.
|
@@ -30,7 +30,7 @@ module MuxRuby
|
|
30
30
|
# Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH).
|
31
31
|
attr_accessor :closed_captions
|
32
32
|
|
33
|
-
# Arbitrary metadata set for the track either when creating the asset or track.
|
33
|
+
# Arbitrary user-supplied metadata set for the track either when creating the asset or track.
|
34
34
|
attr_accessor :passthrough
|
35
35
|
|
36
36
|
class EnumAttributeValidator
|
@@ -16,7 +16,7 @@ require 'time'
|
|
16
16
|
module MuxRuby
|
17
17
|
# 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.
|
18
18
|
class InputSettings
|
19
|
-
# The
|
19
|
+
# The URL 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.
|
20
20
|
attr_accessor :url
|
21
21
|
|
22
22
|
attr_accessor :overlay_settings
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module MuxRuby
|
17
|
-
# An object that describes how the image file referenced in
|
17
|
+
# An object that describes how the image file referenced in URL should be placed over the video (i.e. watermarking). Ensure that the URL is active and persists the entire lifespan of the video object.
|
18
18
|
class InputSettingsOverlaySettings
|
19
19
|
# Where the vertical positioning of the overlay/watermark should begin from. Defaults to `\"top\"`
|
20
20
|
attr_accessor :vertical_align
|
@@ -30,7 +30,6 @@ module MuxRuby
|
|
30
30
|
# An array of strings with the most recent Assets that were created from this live stream.
|
31
31
|
attr_accessor :recent_asset_ids
|
32
32
|
|
33
|
-
# `idle` indicates that there is no active broadcast. `active` indicates that there is an active broadcast and `disabled` status indicates that no future RTMP streams can be published.
|
34
33
|
attr_accessor :status
|
35
34
|
|
36
35
|
# An array of Playback ID objects. Use these to create HLS playback URLs. See [Play your videos](https://docs.mux.com/guides/video/play-your-videos) for more details.
|
@@ -38,24 +37,30 @@ module MuxRuby
|
|
38
37
|
|
39
38
|
attr_accessor :new_asset_settings
|
40
39
|
|
41
|
-
# Arbitrary metadata set for the asset. Max 255 characters.
|
40
|
+
# Arbitrary user-supplied metadata set for the asset. Max 255 characters.
|
42
41
|
attr_accessor :passthrough
|
43
42
|
|
44
43
|
# The live stream only processes the audio track if the value is set to true. Mux drops the video track if broadcasted.
|
45
44
|
attr_accessor :audio_only
|
46
45
|
|
46
|
+
# Describes the embedded closed caption configuration of the incoming live stream.
|
47
|
+
attr_accessor :embedded_subtitles
|
48
|
+
|
47
49
|
# When live streaming software disconnects from Mux, either intentionally or due to a drop in the network, the Reconnect Window is the time in seconds that Mux should wait for the streaming software to reconnect before considering the live stream finished and completing the recorded asset. **Min**: 0.1s. **Max**: 300s (5 minutes).
|
48
50
|
attr_accessor :reconnect_window
|
49
51
|
|
50
|
-
# Latency is the time from when the streamer
|
52
|
+
# This field is deprecated. Please use latency_mode instead. Latency is the time from when the streamer transmits a frame of video to when you see it in the player. Set this if you want lower latency for your live stream. **Note**: Reconnect windows are incompatible with Reduced Latency and will always be set to zero (0) seconds. See the [Reduce live stream latency guide](https://docs.mux.com/guides/video/reduce-live-stream-latency) to understand the tradeoffs.
|
51
53
|
attr_accessor :reduced_latency
|
52
54
|
|
53
|
-
# Latency is the time from when the streamer
|
55
|
+
# This field is deprecated. Please use latency_mode instead. Latency is the time from when the streamer transmits a frame of video to when you see it in the player. Setting this option will enable compatibility with the LL-HLS specification for low-latency streaming. This typically has lower latency than Reduced Latency streams, and cannot be combined with Reduced Latency. Note: Reconnect windows are incompatible with Low Latency and will always be set to zero (0) seconds.
|
54
56
|
attr_accessor :low_latency
|
55
57
|
|
56
58
|
# Each Simulcast Target contains configuration details to broadcast (or \"restream\") a live stream to a third-party streaming service. [See the Stream live to 3rd party platforms guide](https://docs.mux.com/guides/video/stream-live-to-3rd-party-platforms).
|
57
59
|
attr_accessor :simulcast_targets
|
58
60
|
|
61
|
+
# Latency is the time from when the streamer transmits a frame of video to when you see it in the player. Set this as an alternative to setting low latency or reduced latency flags. The Low Latency value is a beta feature. Note: Reconnect windows are incompatible with Reduced Latency and Low Latency and will always be set to zero (0) seconds. Read more here: https://mux.com/blog/introducing-low-latency-live-streaming/
|
62
|
+
attr_accessor :latency_mode
|
63
|
+
|
59
64
|
# True means this live stream is a test live stream. Test live streams can be used to help evaluate the Mux Video APIs for free. There is no limit on the number of test live streams, but they are watermarked with the Mux logo, and limited to 5 minutes. The test live stream is disabled after the stream is active for 5 mins and the recorded asset also deleted after 24 hours.
|
60
65
|
attr_accessor :test
|
61
66
|
|
@@ -94,10 +99,12 @@ module MuxRuby
|
|
94
99
|
:'new_asset_settings' => :'new_asset_settings',
|
95
100
|
:'passthrough' => :'passthrough',
|
96
101
|
:'audio_only' => :'audio_only',
|
102
|
+
:'embedded_subtitles' => :'embedded_subtitles',
|
97
103
|
:'reconnect_window' => :'reconnect_window',
|
98
104
|
:'reduced_latency' => :'reduced_latency',
|
99
105
|
:'low_latency' => :'low_latency',
|
100
106
|
:'simulcast_targets' => :'simulcast_targets',
|
107
|
+
:'latency_mode' => :'latency_mode',
|
101
108
|
:'test' => :'test'
|
102
109
|
}
|
103
110
|
end
|
@@ -115,15 +122,17 @@ module MuxRuby
|
|
115
122
|
:'stream_key' => :'String',
|
116
123
|
:'active_asset_id' => :'String',
|
117
124
|
:'recent_asset_ids' => :'Array<String>',
|
118
|
-
:'status' => :'
|
125
|
+
:'status' => :'LiveStreamStatus',
|
119
126
|
:'playback_ids' => :'Array<PlaybackID>',
|
120
127
|
:'new_asset_settings' => :'CreateAssetRequest',
|
121
128
|
:'passthrough' => :'String',
|
122
129
|
:'audio_only' => :'Boolean',
|
130
|
+
:'embedded_subtitles' => :'Array<LiveStreamEmbeddedSubtitleSettings>',
|
123
131
|
:'reconnect_window' => :'Float',
|
124
132
|
:'reduced_latency' => :'Boolean',
|
125
133
|
:'low_latency' => :'Boolean',
|
126
134
|
:'simulcast_targets' => :'Array<SimulcastTarget>',
|
135
|
+
:'latency_mode' => :'String',
|
127
136
|
:'test' => :'Boolean'
|
128
137
|
}
|
129
138
|
end
|
@@ -193,6 +202,12 @@ module MuxRuby
|
|
193
202
|
self.audio_only = attributes[:'audio_only']
|
194
203
|
end
|
195
204
|
|
205
|
+
if attributes.key?(:'embedded_subtitles')
|
206
|
+
if (value = attributes[:'embedded_subtitles']).is_a?(Array)
|
207
|
+
self.embedded_subtitles = value
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
196
211
|
if attributes.key?(:'reconnect_window')
|
197
212
|
self.reconnect_window = attributes[:'reconnect_window']
|
198
213
|
else
|
@@ -213,6 +228,10 @@ module MuxRuby
|
|
213
228
|
end
|
214
229
|
end
|
215
230
|
|
231
|
+
if attributes.key?(:'latency_mode')
|
232
|
+
self.latency_mode = attributes[:'latency_mode']
|
233
|
+
end
|
234
|
+
|
216
235
|
if attributes.key?(:'test')
|
217
236
|
self.test = attributes[:'test']
|
218
237
|
end
|
@@ -228,19 +247,19 @@ module MuxRuby
|
|
228
247
|
# Check to see if the all the properties in the model are valid
|
229
248
|
# @return true if the model is valid
|
230
249
|
def valid?
|
231
|
-
|
232
|
-
return false unless
|
250
|
+
latency_mode_validator = EnumAttributeValidator.new('String', ["low", "reduced", "standard"])
|
251
|
+
return false unless latency_mode_validator.valid?(@latency_mode)
|
233
252
|
true
|
234
253
|
end
|
235
254
|
|
236
255
|
# Custom attribute writer method checking allowed values (enum).
|
237
|
-
# @param [Object]
|
238
|
-
def
|
239
|
-
validator = EnumAttributeValidator.new('String', ["
|
240
|
-
unless validator.valid?(
|
241
|
-
fail ArgumentError, "invalid value for \"
|
256
|
+
# @param [Object] latency_mode Object to be assigned
|
257
|
+
def latency_mode=(latency_mode)
|
258
|
+
validator = EnumAttributeValidator.new('String', ["low", "reduced", "standard"])
|
259
|
+
unless validator.valid?(latency_mode)
|
260
|
+
fail ArgumentError, "invalid value for \"latency_mode\", must be one of #{validator.allowable_values}."
|
242
261
|
end
|
243
|
-
@
|
262
|
+
@latency_mode = latency_mode
|
244
263
|
end
|
245
264
|
|
246
265
|
# Checks equality by comparing each attribute.
|
@@ -258,10 +277,12 @@ module MuxRuby
|
|
258
277
|
new_asset_settings == o.new_asset_settings &&
|
259
278
|
passthrough == o.passthrough &&
|
260
279
|
audio_only == o.audio_only &&
|
280
|
+
embedded_subtitles == o.embedded_subtitles &&
|
261
281
|
reconnect_window == o.reconnect_window &&
|
262
282
|
reduced_latency == o.reduced_latency &&
|
263
283
|
low_latency == o.low_latency &&
|
264
284
|
simulcast_targets == o.simulcast_targets &&
|
285
|
+
latency_mode == o.latency_mode &&
|
265
286
|
test == o.test
|
266
287
|
end
|
267
288
|
|
@@ -274,7 +295,7 @@ module MuxRuby
|
|
274
295
|
# Calculates hash code according to all attributes.
|
275
296
|
# @return [Integer] Hash code
|
276
297
|
def hash
|
277
|
-
[id, created_at, stream_key, active_asset_id, recent_asset_ids, status, playback_ids, new_asset_settings, passthrough, audio_only, reconnect_window, reduced_latency, low_latency, simulcast_targets, test].hash
|
298
|
+
[id, created_at, stream_key, active_asset_id, recent_asset_ids, status, playback_ids, new_asset_settings, passthrough, audio_only, embedded_subtitles, reconnect_window, reduced_latency, low_latency, simulcast_targets, latency_mode, test].hash
|
278
299
|
end
|
279
300
|
|
280
301
|
# Builds the object from hash
|