Class: MuxRuby::LiveStreamsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mux_ruby/api/live_streams_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LiveStreamsApi

Returns a new instance of LiveStreamsApi.



19
20
21
# File 'lib/mux_ruby/api/live_streams_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/mux_ruby/api/live_streams_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_live_stream(create_live_stream_request, opts = {}) ⇒ LiveStreamResponse

Create a live stream

Parameters:

Returns:



26
27
28
29
# File 'lib/mux_ruby/api/live_streams_api.rb', line 26

def create_live_stream(create_live_stream_request, opts = {})
  data, _status_code, _headers = create_live_stream_with_http_info(create_live_stream_request, opts)
  data
end

#create_live_stream_playback_id(live_stream_id, create_playback_id_request, opts = {}) ⇒ CreatePlaybackIDResponse

Create a live stream playback ID

Parameters:

  • live_stream_id (String)

    The live stream ID

  • create_playback_id_request (CreatePlaybackIDRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



90
91
92
93
# File 'lib/mux_ruby/api/live_streams_api.rb', line 90

def create_live_stream_playback_id(live_stream_id, create_playback_id_request, opts = {})
  data, _status_code, _headers = create_live_stream_playback_id_with_http_info(live_stream_id, create_playback_id_request, opts)
  data
end

#create_live_stream_playback_id_with_http_info(live_stream_id, create_playback_id_request, opts = {}) ⇒ Array<(CreatePlaybackIDResponse, Integer, Hash)>

Create a live stream playback ID

Parameters:

  • live_stream_id (String)

    The live stream ID

  • create_playback_id_request (CreatePlaybackIDRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CreatePlaybackIDResponse, Integer, Hash)>)

    CreatePlaybackIDResponse data, response status code and response headers



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/mux_ruby/api/live_streams_api.rb', line 100

def create_live_stream_playback_id_with_http_info(live_stream_id, create_playback_id_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LiveStreamsApi.create_live_stream_playback_id ...'
  end
  # verify the required parameter 'live_stream_id' is set
  if @api_client.config.client_side_validation && live_stream_id.nil?
    fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.create_live_stream_playback_id"
  end
  # verify the required parameter 'create_playback_id_request' is set
  if @api_client.config.client_side_validation && create_playback_id_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_playback_id_request' when calling LiveStreamsApi.create_live_stream_playback_id"
  end
  # resource path
  local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids'.sub('{' + 'LIVE_STREAM_ID' + '}', CGI.escape(live_stream_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_playback_id_request)

  # return_type
  return_type = opts[:debug_return_type] || 'CreatePlaybackIDResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"LiveStreamsApi.create_live_stream_playback_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LiveStreamsApi#create_live_stream_playback_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_live_stream_simulcast_target(live_stream_id, create_simulcast_target_request, opts = {}) ⇒ SimulcastTargetResponse

Create a live stream simulcast target Create a simulcast target for the parent live stream. Simulcast target can only be created when the parent live stream is in idle state. Only one simulcast target can be created at a time with this API.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • create_simulcast_target_request (CreateSimulcastTargetRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



160
161
162
163
# File 'lib/mux_ruby/api/live_streams_api.rb', line 160

def create_live_stream_simulcast_target(live_stream_id, create_simulcast_target_request, opts = {})
  data, _status_code, _headers = create_live_stream_simulcast_target_with_http_info(live_stream_id, create_simulcast_target_request, opts)
  data
end

#create_live_stream_simulcast_target_with_http_info(live_stream_id, create_simulcast_target_request, opts = {}) ⇒ Array<(SimulcastTargetResponse, Integer, Hash)>

Create a live stream simulcast target Create a simulcast target for the parent live stream. Simulcast target can only be created when the parent live stream is in idle state. Only one simulcast target can be created at a time with this API.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • create_simulcast_target_request (CreateSimulcastTargetRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(SimulcastTargetResponse, Integer, Hash)>)

    SimulcastTargetResponse data, response status code and response headers



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/mux_ruby/api/live_streams_api.rb', line 171

def create_live_stream_simulcast_target_with_http_info(live_stream_id, create_simulcast_target_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LiveStreamsApi.create_live_stream_simulcast_target ...'
  end
  # verify the required parameter 'live_stream_id' is set
  if @api_client.config.client_side_validation && live_stream_id.nil?
    fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.create_live_stream_simulcast_target"
  end
  # verify the required parameter 'create_simulcast_target_request' is set
  if @api_client.config.client_side_validation && create_simulcast_target_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_simulcast_target_request' when calling LiveStreamsApi.create_live_stream_simulcast_target"
  end
  # resource path
  local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets'.sub('{' + 'LIVE_STREAM_ID' + '}', CGI.escape(live_stream_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_simulcast_target_request)

  # return_type
  return_type = opts[:debug_return_type] || 'SimulcastTargetResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"LiveStreamsApi.create_live_stream_simulcast_target",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LiveStreamsApi#create_live_stream_simulcast_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_live_stream_with_http_info(create_live_stream_request, opts = {}) ⇒ Array<(LiveStreamResponse, Integer, Hash)>

Create a live stream

Parameters:

Returns:

  • (Array<(LiveStreamResponse, Integer, Hash)>)

    LiveStreamResponse data, response status code and response headers



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/mux_ruby/api/live_streams_api.rb', line 35

def create_live_stream_with_http_info(create_live_stream_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LiveStreamsApi.create_live_stream ...'
  end
  # verify the required parameter 'create_live_stream_request' is set
  if @api_client.config.client_side_validation && create_live_stream_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_live_stream_request' when calling LiveStreamsApi.create_live_stream"
  end
  # resource path
  local_var_path = '/video/v1/live-streams'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(create_live_stream_request)

  # return_type
  return_type = opts[:debug_return_type] || 'LiveStreamResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"LiveStreamsApi.create_live_stream",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LiveStreamsApi#create_live_stream\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_live_stream(live_stream_id, opts = {}) ⇒ nil

Delete a live stream

Parameters:

  • live_stream_id (String)

    The live stream ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


229
230
231
232
# File 'lib/mux_ruby/api/live_streams_api.rb', line 229

def delete_live_stream(live_stream_id, opts = {})
  delete_live_stream_with_http_info(live_stream_id, opts)
  nil
end

#delete_live_stream_playback_id(live_stream_id, playback_id, opts = {}) ⇒ nil

Delete a live stream playback ID

Parameters:

  • live_stream_id (String)

    The live stream ID

  • playback_id (String)

    The live stream&#39;s playback ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


289
290
291
292
# File 'lib/mux_ruby/api/live_streams_api.rb', line 289

def delete_live_stream_playback_id(live_stream_id, playback_id, opts = {})
  delete_live_stream_playback_id_with_http_info(live_stream_id, playback_id, opts)
  nil
end

#delete_live_stream_playback_id_with_http_info(live_stream_id, playback_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a live stream playback ID

Parameters:

  • live_stream_id (String)

    The live stream ID

  • playback_id (String)

    The live stream&#39;s playback ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/mux_ruby/api/live_streams_api.rb', line 299

def delete_live_stream_playback_id_with_http_info(live_stream_id, playback_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LiveStreamsApi.delete_live_stream_playback_id ...'
  end
  # verify the required parameter 'live_stream_id' is set
  if @api_client.config.client_side_validation && live_stream_id.nil?
    fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.delete_live_stream_playback_id"
  end
  # verify the required parameter 'playback_id' is set
  if @api_client.config.client_side_validation && playback_id.nil?
    fail ArgumentError, "Missing the required parameter 'playback_id' when calling LiveStreamsApi.delete_live_stream_playback_id"
  end
  # resource path
  local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID}'.sub('{' + 'LIVE_STREAM_ID' + '}', CGI.escape(live_stream_id.to_s)).sub('{' + 'PLAYBACK_ID' + '}', CGI.escape(playback_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"LiveStreamsApi.delete_live_stream_playback_id",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LiveStreamsApi#delete_live_stream_playback_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_live_stream_simulcast_target(live_stream_id, simulcast_target_id, opts = {}) ⇒ nil

Delete a Live Stream Simulcast Target Delete the simulcast target using the simulcast target ID returned when creating the simulcast target. Simulcast Target can only be deleted when the parent live stream is in idle state.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • simulcast_target_id (String)

    The ID of the simulcast target.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


355
356
357
358
# File 'lib/mux_ruby/api/live_streams_api.rb', line 355

def delete_live_stream_simulcast_target(live_stream_id, simulcast_target_id, opts = {})
  delete_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, opts)
  nil
end

#delete_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a Live Stream Simulcast Target Delete the simulcast target using the simulcast target ID returned when creating the simulcast target. Simulcast Target can only be deleted when the parent live stream is in idle state.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • simulcast_target_id (String)

    The ID of the simulcast target.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'lib/mux_ruby/api/live_streams_api.rb', line 366

def delete_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LiveStreamsApi.delete_live_stream_simulcast_target ...'
  end
  # verify the required parameter 'live_stream_id' is set
  if @api_client.config.client_side_validation && live_stream_id.nil?
    fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.delete_live_stream_simulcast_target"
  end
  # verify the required parameter 'simulcast_target_id' is set
  if @api_client.config.client_side_validation && simulcast_target_id.nil?
    fail ArgumentError, "Missing the required parameter 'simulcast_target_id' when calling LiveStreamsApi.delete_live_stream_simulcast_target"
  end
  # resource path
  local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID}'.sub('{' + 'LIVE_STREAM_ID' + '}', CGI.escape(live_stream_id.to_s)).sub('{' + 'SIMULCAST_TARGET_ID' + '}', CGI.escape(simulcast_target_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"LiveStreamsApi.delete_live_stream_simulcast_target",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LiveStreamsApi#delete_live_stream_simulcast_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_live_stream_with_http_info(live_stream_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a live stream

Parameters:

  • live_stream_id (String)

    The live stream ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/mux_ruby/api/live_streams_api.rb', line 238

def delete_live_stream_with_http_info(live_stream_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LiveStreamsApi.delete_live_stream ...'
  end
  # verify the required parameter 'live_stream_id' is set
  if @api_client.config.client_side_validation && live_stream_id.nil?
    fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.delete_live_stream"
  end
  # resource path
  local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}'.sub('{' + 'LIVE_STREAM_ID' + '}', CGI.escape(live_stream_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"LiveStreamsApi.delete_live_stream",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LiveStreamsApi#delete_live_stream\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#disable_live_stream(live_stream_id, opts = {}) ⇒ DisableLiveStreamResponse

Disable a live stream Disables a live stream, making it reject incoming RTMP streams until re-enabled. The API also ends the live stream recording immediately when active. Ending the live stream recording adds the EXT-X-ENDLIST tag to the HLS manifest which notifies the player that this live stream is over. Mux also closes the encoder connection immediately. Any attempt from the encoder to re-establish connection will fail till the live stream is re-enabled.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



421
422
423
424
# File 'lib/mux_ruby/api/live_streams_api.rb', line 421

def disable_live_stream(live_stream_id, opts = {})
  data, _status_code, _headers = disable_live_stream_with_http_info(live_stream_id, opts)
  data
end

#disable_live_stream_with_http_info(live_stream_id, opts = {}) ⇒ Array<(DisableLiveStreamResponse, Integer, Hash)>

Disable a live stream Disables a live stream, making it reject incoming RTMP streams until re-enabled. The API also ends the live stream recording immediately when active. Ending the live stream recording adds the &#x60;EXT-X-ENDLIST&#x60; tag to the HLS manifest which notifies the player that this live stream is over. Mux also closes the encoder connection immediately. Any attempt from the encoder to re-establish connection will fail till the live stream is re-enabled.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DisableLiveStreamResponse, Integer, Hash)>)

    DisableLiveStreamResponse data, response status code and response headers



431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
# File 'lib/mux_ruby/api/live_streams_api.rb', line 431

def disable_live_stream_with_http_info(live_stream_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LiveStreamsApi.disable_live_stream ...'
  end
  # verify the required parameter 'live_stream_id' is set
  if @api_client.config.client_side_validation && live_stream_id.nil?
    fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.disable_live_stream"
  end
  # resource path
  local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/disable'.sub('{' + 'LIVE_STREAM_ID' + '}', CGI.escape(live_stream_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'DisableLiveStreamResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"LiveStreamsApi.disable_live_stream",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LiveStreamsApi#disable_live_stream\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#enable_live_stream(live_stream_id, opts = {}) ⇒ EnableLiveStreamResponse

Enable a live stream Enables a live stream, allowing it to accept an incoming RTMP stream.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



484
485
486
487
# File 'lib/mux_ruby/api/live_streams_api.rb', line 484

def enable_live_stream(live_stream_id, opts = {})
  data, _status_code, _headers = enable_live_stream_with_http_info(live_stream_id, opts)
  data
end

#enable_live_stream_with_http_info(live_stream_id, opts = {}) ⇒ Array<(EnableLiveStreamResponse, Integer, Hash)>

Enable a live stream Enables a live stream, allowing it to accept an incoming RTMP stream.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(EnableLiveStreamResponse, Integer, Hash)>)

    EnableLiveStreamResponse data, response status code and response headers



494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
# File 'lib/mux_ruby/api/live_streams_api.rb', line 494

def enable_live_stream_with_http_info(live_stream_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LiveStreamsApi.enable_live_stream ...'
  end
  # verify the required parameter 'live_stream_id' is set
  if @api_client.config.client_side_validation && live_stream_id.nil?
    fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.enable_live_stream"
  end
  # resource path
  local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/enable'.sub('{' + 'LIVE_STREAM_ID' + '}', CGI.escape(live_stream_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'EnableLiveStreamResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"LiveStreamsApi.enable_live_stream",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LiveStreamsApi#enable_live_stream\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_live_stream(live_stream_id, opts = {}) ⇒ LiveStreamResponse

Retrieve a live stream Retrieves the details of a live stream that has previously been created. Supply the unique live stream ID that was returned from your previous request, and Mux will return the corresponding live stream information. The same information is returned when creating a live stream.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



547
548
549
550
# File 'lib/mux_ruby/api/live_streams_api.rb', line 547

def get_live_stream(live_stream_id, opts = {})
  data, _status_code, _headers = get_live_stream_with_http_info(live_stream_id, opts)
  data
end

#get_live_stream_simulcast_target(live_stream_id, simulcast_target_id, opts = {}) ⇒ SimulcastTargetResponse

Retrieve a Live Stream Simulcast Target Retrieves the details of the simulcast target created for the parent live stream. Supply the unique live stream ID and simulcast target ID that was returned in the response of create simulcast target request, and Mux will return the corresponding information.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • simulcast_target_id (String)

    The ID of the simulcast target.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



611
612
613
614
# File 'lib/mux_ruby/api/live_streams_api.rb', line 611

def get_live_stream_simulcast_target(live_stream_id, simulcast_target_id, opts = {})
  data, _status_code, _headers = get_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, opts)
  data
end

#get_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, opts = {}) ⇒ Array<(SimulcastTargetResponse, Integer, Hash)>

Retrieve a Live Stream Simulcast Target Retrieves the details of the simulcast target created for the parent live stream. Supply the unique live stream ID and simulcast target ID that was returned in the response of create simulcast target request, and Mux will return the corresponding information.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • simulcast_target_id (String)

    The ID of the simulcast target.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(SimulcastTargetResponse, Integer, Hash)>)

    SimulcastTargetResponse data, response status code and response headers



622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
# File 'lib/mux_ruby/api/live_streams_api.rb', line 622

def get_live_stream_simulcast_target_with_http_info(live_stream_id, simulcast_target_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LiveStreamsApi.get_live_stream_simulcast_target ...'
  end
  # verify the required parameter 'live_stream_id' is set
  if @api_client.config.client_side_validation && live_stream_id.nil?
    fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.get_live_stream_simulcast_target"
  end
  # verify the required parameter 'simulcast_target_id' is set
  if @api_client.config.client_side_validation && simulcast_target_id.nil?
    fail ArgumentError, "Missing the required parameter 'simulcast_target_id' when calling LiveStreamsApi.get_live_stream_simulcast_target"
  end
  # resource path
  local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID}'.sub('{' + 'LIVE_STREAM_ID' + '}', CGI.escape(live_stream_id.to_s)).sub('{' + 'SIMULCAST_TARGET_ID' + '}', CGI.escape(simulcast_target_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SimulcastTargetResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"LiveStreamsApi.get_live_stream_simulcast_target",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LiveStreamsApi#get_live_stream_simulcast_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_live_stream_with_http_info(live_stream_id, opts = {}) ⇒ Array<(LiveStreamResponse, Integer, Hash)>

Retrieve a live stream Retrieves the details of a live stream that has previously been created. Supply the unique live stream ID that was returned from your previous request, and Mux will return the corresponding live stream information. The same information is returned when creating a live stream.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(LiveStreamResponse, Integer, Hash)>)

    LiveStreamResponse data, response status code and response headers



557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
# File 'lib/mux_ruby/api/live_streams_api.rb', line 557

def get_live_stream_with_http_info(live_stream_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LiveStreamsApi.get_live_stream ...'
  end
  # verify the required parameter 'live_stream_id' is set
  if @api_client.config.client_side_validation && live_stream_id.nil?
    fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.get_live_stream"
  end
  # resource path
  local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}'.sub('{' + 'LIVE_STREAM_ID' + '}', CGI.escape(live_stream_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LiveStreamResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"LiveStreamsApi.get_live_stream",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LiveStreamsApi#get_live_stream\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_live_streams(opts = {}) ⇒ ListLiveStreamsResponse

List live streams

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of items to include in the response (default to 25)

  • :page (Integer)

    Offset by this many pages, of the size of &#x60;limit&#x60; (default to 1)

  • :stream_key (String)

    Filter response to return live stream for this stream key only

Returns:



680
681
682
683
# File 'lib/mux_ruby/api/live_streams_api.rb', line 680

def list_live_streams(opts = {})
  data, _status_code, _headers = list_live_streams_with_http_info(opts)
  data
end

#list_live_streams_with_http_info(opts = {}) ⇒ Array<(ListLiveStreamsResponse, Integer, Hash)>

List live streams

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Number of items to include in the response

  • :page (Integer)

    Offset by this many pages, of the size of &#x60;limit&#x60;

  • :stream_key (String)

    Filter response to return live stream for this stream key only

Returns:

  • (Array<(ListLiveStreamsResponse, Integer, Hash)>)

    ListLiveStreamsResponse data, response status code and response headers



691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
# File 'lib/mux_ruby/api/live_streams_api.rb', line 691

def list_live_streams_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LiveStreamsApi.list_live_streams ...'
  end
  # resource path
  local_var_path = '/video/v1/live-streams'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'stream_key'] = opts[:'stream_key'] if !opts[:'stream_key'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListLiveStreamsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"LiveStreamsApi.list_live_streams",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LiveStreamsApi#list_live_streams\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reset_stream_key(live_stream_id, opts = {}) ⇒ LiveStreamResponse

Reset a live stream’s stream key Reset a live stream key if you want to immediately stop the current stream key from working and create a new stream key that can be used for future broadcasts.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



743
744
745
746
# File 'lib/mux_ruby/api/live_streams_api.rb', line 743

def reset_stream_key(live_stream_id, opts = {})
  data, _status_code, _headers = reset_stream_key_with_http_info(live_stream_id, opts)
  data
end

#reset_stream_key_with_http_info(live_stream_id, opts = {}) ⇒ Array<(LiveStreamResponse, Integer, Hash)>

Reset a live stream’s stream key Reset a live stream key if you want to immediately stop the current stream key from working and create a new stream key that can be used for future broadcasts.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(LiveStreamResponse, Integer, Hash)>)

    LiveStreamResponse data, response status code and response headers



753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
# File 'lib/mux_ruby/api/live_streams_api.rb', line 753

def reset_stream_key_with_http_info(live_stream_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LiveStreamsApi.reset_stream_key ...'
  end
  # verify the required parameter 'live_stream_id' is set
  if @api_client.config.client_side_validation && live_stream_id.nil?
    fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.reset_stream_key"
  end
  # resource path
  local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/reset-stream-key'.sub('{' + 'LIVE_STREAM_ID' + '}', CGI.escape(live_stream_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LiveStreamResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"LiveStreamsApi.reset_stream_key",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LiveStreamsApi#reset_stream_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#signal_live_stream_complete(live_stream_id, opts = {}) ⇒ SignalLiveStreamCompleteResponse

Signal a live stream is finished (Optional) End the live stream recording immediately instead of waiting for the reconnect_window. EXT-X-ENDLIST tag is added to the HLS manifest which notifies the player that this live stream is over. Mux does not close the encoder connection immediately. Encoders are often configured to re-establish connections immediately which would result in a new recorded asset. For this reason, Mux waits for 60s before closing the connection with the encoder. This 60s timeframe is meant to give encoder operators a chance to disconnect from their end.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



806
807
808
809
# File 'lib/mux_ruby/api/live_streams_api.rb', line 806

def signal_live_stream_complete(live_stream_id, opts = {})
  data, _status_code, _headers = signal_live_stream_complete_with_http_info(live_stream_id, opts)
  data
end

#signal_live_stream_complete_with_http_info(live_stream_id, opts = {}) ⇒ Array<(SignalLiveStreamCompleteResponse, Integer, Hash)>

Signal a live stream is finished (Optional) End the live stream recording immediately instead of waiting for the reconnect_window. &#x60;EXT-X-ENDLIST&#x60; tag is added to the HLS manifest which notifies the player that this live stream is over. Mux does not close the encoder connection immediately. Encoders are often configured to re-establish connections immediately which would result in a new recorded asset. For this reason, Mux waits for 60s before closing the connection with the encoder. This 60s timeframe is meant to give encoder operators a chance to disconnect from their end.

Parameters:

  • live_stream_id (String)

    The live stream ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
# File 'lib/mux_ruby/api/live_streams_api.rb', line 816

def signal_live_stream_complete_with_http_info(live_stream_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LiveStreamsApi.signal_live_stream_complete ...'
  end
  # verify the required parameter 'live_stream_id' is set
  if @api_client.config.client_side_validation && live_stream_id.nil?
    fail ArgumentError, "Missing the required parameter 'live_stream_id' when calling LiveStreamsApi.signal_live_stream_complete"
  end
  # resource path
  local_var_path = '/video/v1/live-streams/{LIVE_STREAM_ID}/complete'.sub('{' + 'LIVE_STREAM_ID' + '}', CGI.escape(live_stream_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SignalLiveStreamCompleteResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['accessToken']

  new_options = opts.merge(
    :operation => :"LiveStreamsApi.signal_live_stream_complete",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LiveStreamsApi#signal_live_stream_complete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end