Skip to content

Commit 6d24d5a

Browse files
authored
Delivery Usage, Simulcasting, Audio Normalization, and a variety of bugfixes. (#14)
* Simulcast, Delivery Usage, and a sprinkle of bugfixes * Test Delivery Usage and Simulcast
1 parent d1280a7 commit 6d24d5a

35 files changed

+2102
-12
lines changed

docs/Asset.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Name | Type | Description | Notes
2222
**master** | [**AssetMaster**](AssetMaster.md) | | [optional]
2323
**master_access** | **str** | | [optional] [default to 'none']
2424
**mp4_support** | **str** | | [optional] [default to 'none']
25+
**normalize_audio** | **bool** | | [optional] [default to False]
2526
**static_renditions** | [**AssetStaticRenditions**](AssetStaticRenditions.md) | | [optional]
2627

2728
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

docs/CreateAssetRequest.md

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Name | Type | Description | Notes
99
**per_title_encode** | **bool** | | [optional]
1010
**passthrough** | **str** | | [optional]
1111
**mp4_support** | **str** | | [optional]
12+
**normalize_audio** | **bool** | Normalize the audio track loudness level. This parameter is only applicable to on-demand (not live) assets. | [optional] [default to False]
13+
**master_access** | **str** | | [optional]
1214

1315
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1416

docs/CreateLiveStreamRequest.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**playback_policy** | [**list[PlaybackPolicy]**](PlaybackPolicy.md) | | [optional]
77
**new_asset_settings** | [**CreateAssetRequest**](CreateAssetRequest.md) | | [optional]
8-
**reconnect_window** | **float** | 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. Default: 60 seconds | [optional] [default to 60]
8+
**reconnect_window** | **float** | 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. Defaults to 60 seconds on the API if not specified. | [optional]
99
**passthrough** | **str** | | [optional]
1010
**reduced_latency** | **bool** | Latency is the time from when the streamer does something in real life to when you see it happen 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/ | [optional]
1111

docs/CreateSimulcastTargetRequest.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# CreateSimulcastTargetRequest
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**passthrough** | **str** | Arbitrary metadata set by you when creating a simulcast target. | [optional]
7+
**stream_key** | **str** | Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to. | [optional]
8+
**url** | **str** | RTMP hostname including application name for the third party live streaming service. Example: 'rtmp://live.example.com/app'. |
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+

docs/DeliveryReport.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# DeliveryReport
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**live_stream_id** | **str** | | [optional]
7+
**asset_id** | **str** | | [optional]
8+
**passthrough** | **str** | | [optional]
9+
**created_at** | **str** | | [optional]
10+
**asset_state** | **str** | | [optional]
11+
**asset_duration** | **float** | | [optional]
12+
**delivered_seconds** | **float** | | [optional]
13+
14+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
15+
16+

docs/DeliveryUsageApi.md

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# mux_python.DeliveryUsageApi
2+
3+
All URIs are relative to *https://api.mux.com*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**list_delivery_usage**](DeliveryUsageApi.md#list_delivery_usage) | **GET** /video/v1/delivery-usage | List Usage
8+
9+
10+
# **list_delivery_usage**
11+
> ListDeliveryUsageResponse list_delivery_usage(page=page, limit=limit, asset_id=asset_id, timeframe=timeframe)
12+
13+
List Usage
14+
15+
Returns a list of delivery usage records and their associated Asset IDs or Live Stream IDs.
16+
17+
### Example
18+
19+
* Basic Authentication (accessToken):
20+
```python
21+
from __future__ import print_function
22+
import time
23+
import mux_python
24+
from mux_python.rest import ApiException
25+
from pprint import pprint
26+
configuration = mux_python.Configuration()
27+
# Configure HTTP basic authorization: accessToken
28+
configuration.username = 'YOUR_USERNAME'
29+
configuration.password = 'YOUR_PASSWORD'
30+
31+
# create an instance of the API class
32+
api_instance = mux_python.DeliveryUsageApi(mux_python.ApiClient(configuration))
33+
page = 1 # int | Offset by this many pages, of the size of `limit` (optional) (default to 1)
34+
limit = 100 # int | Number of items to include in the response (optional) (default to 100)
35+
asset_id = 'asset_id_example' # str | Filter response to return delivery usage for this asset only. (optional)
36+
timeframe = ['timeframe_example'] # list[str] | Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. (optional)
37+
38+
try:
39+
# List Usage
40+
api_response = api_instance.list_delivery_usage(page=page, limit=limit, asset_id=asset_id, timeframe=timeframe)
41+
pprint(api_response)
42+
except ApiException as e:
43+
print("Exception when calling DeliveryUsageApi->list_delivery_usage: %s\n" % e)
44+
```
45+
46+
### Parameters
47+
48+
Name | Type | Description | Notes
49+
------------- | ------------- | ------------- | -------------
50+
**page** | **int**| Offset by this many pages, of the size of `limit` | [optional] [default to 1]
51+
**limit** | **int**| Number of items to include in the response | [optional] [default to 100]
52+
**asset_id** | **str**| Filter response to return delivery usage for this asset only. | [optional]
53+
**timeframe** | [**list[str]**](str.md)| Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. | [optional]
54+
55+
### Return type
56+
57+
[**ListDeliveryUsageResponse**](ListDeliveryUsageResponse.md)
58+
59+
### Authorization
60+
61+
[accessToken](../README.md#accessToken)
62+
63+
### HTTP request headers
64+
65+
- **Content-Type**: Not defined
66+
- **Accept**: application/json
67+
68+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
69+

docs/ListDeliveryUsageResponse.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# ListDeliveryUsageResponse
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**data** | [**list[DeliveryReport]**](DeliveryReport.md) | | [optional]
7+
**total_row_count** | **int** | | [optional]
8+
**timeframe** | **list[int]** | | [optional]
9+
**limit** | **int** | Number of assets returned in this response. Default value is 100. | [optional]
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+
13+

docs/LiveStream.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Name | Type | Description | Notes
1414
**passthrough** | **str** | | [optional]
1515
**reconnect_window** | **float** | | [optional]
1616
**reduced_latency** | **bool** | | [optional]
17+
**simulcast_targets** | [**list[SimulcastTarget]**](SimulcastTarget.md) | | [optional]
1718

1819
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1920

docs/LiveStreamsApi.md

+170
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ Method | HTTP request | Description
66
------------- | ------------- | -------------
77
[**create_live_stream**](LiveStreamsApi.md#create_live_stream) | **POST** /video/v1/live-streams | Create a live stream
88
[**create_live_stream_playback_id**](LiveStreamsApi.md#create_live_stream_playback_id) | **POST** /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids | Create a live stream playback ID
9+
[**create_live_stream_simulcast_target**](LiveStreamsApi.md#create_live_stream_simulcast_target) | **POST** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets | Create a live stream simulcast target
910
[**delete_live_stream**](LiveStreamsApi.md#delete_live_stream) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID} | Delete a live stream
1011
[**delete_live_stream_playback_id**](LiveStreamsApi.md#delete_live_stream_playback_id) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID}/playback-ids/{PLAYBACK_ID} | Delete a live stream playback ID
12+
[**delete_live_stream_simulcast_target**](LiveStreamsApi.md#delete_live_stream_simulcast_target) | **DELETE** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Delete a Live Stream Simulcast Target
1113
[**get_live_stream**](LiveStreamsApi.md#get_live_stream) | **GET** /video/v1/live-streams/{LIVE_STREAM_ID} | Retrieve a live stream
14+
[**get_live_stream_simulcast_target**](LiveStreamsApi.md#get_live_stream_simulcast_target) | **GET** /video/v1/live-streams/{LIVE_STREAM_ID}/simulcast-targets/{SIMULCAST_TARGET_ID} | Retrieve a Live Stream Simulcast Target
1215
[**list_live_streams**](LiveStreamsApi.md#list_live_streams) | **GET** /video/v1/live-streams | List live streams
1316
[**reset_stream_key**](LiveStreamsApi.md#reset_stream_key) | **POST** /video/v1/live-streams/{LIVE_STREAM_ID}/reset-stream-key | Reset a live stream’s stream key
1417
[**signal_live_stream_complete**](LiveStreamsApi.md#signal_live_stream_complete) | **PUT** /video/v1/live-streams/{LIVE_STREAM_ID}/complete | Signal a live stream is finished
@@ -120,6 +123,62 @@ Name | Type | Description | Notes
120123

121124
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
122125

126+
# **create_live_stream_simulcast_target**
127+
> SimulcastTargetResponse create_live_stream_simulcast_target(live_stream_id, create_simulcast_target_request)
128+
129+
Create a live stream simulcast target
130+
131+
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.
132+
133+
### Example
134+
135+
* Basic Authentication (accessToken):
136+
```python
137+
from __future__ import print_function
138+
import time
139+
import mux_python
140+
from mux_python.rest import ApiException
141+
from pprint import pprint
142+
configuration = mux_python.Configuration()
143+
# Configure HTTP basic authorization: accessToken
144+
configuration.username = 'YOUR_USERNAME'
145+
configuration.password = 'YOUR_PASSWORD'
146+
147+
# create an instance of the API class
148+
api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration))
149+
live_stream_id = 'live_stream_id_example' # str | The live stream ID
150+
create_simulcast_target_request = mux_python.CreateSimulcastTargetRequest() # CreateSimulcastTargetRequest |
151+
152+
try:
153+
# Create a live stream simulcast target
154+
api_response = api_instance.create_live_stream_simulcast_target(live_stream_id, create_simulcast_target_request)
155+
pprint(api_response)
156+
except ApiException as e:
157+
print("Exception when calling LiveStreamsApi->create_live_stream_simulcast_target: %s\n" % e)
158+
```
159+
160+
### Parameters
161+
162+
Name | Type | Description | Notes
163+
------------- | ------------- | ------------- | -------------
164+
**live_stream_id** | **str**| The live stream ID |
165+
**create_simulcast_target_request** | [**CreateSimulcastTargetRequest**](CreateSimulcastTargetRequest.md)| |
166+
167+
### Return type
168+
169+
[**SimulcastTargetResponse**](SimulcastTargetResponse.md)
170+
171+
### Authorization
172+
173+
[accessToken](../README.md#accessToken)
174+
175+
### HTTP request headers
176+
177+
- **Content-Type**: application/json
178+
- **Accept**: application/json
179+
180+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
181+
123182
# **delete_live_stream**
124183
> delete_live_stream(live_stream_id)
125184
@@ -224,6 +283,61 @@ void (empty response body)
224283

225284
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
226285

286+
# **delete_live_stream_simulcast_target**
287+
> delete_live_stream_simulcast_target(live_stream_id, simulcast_target_id)
288+
289+
Delete a Live Stream Simulcast Target
290+
291+
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.
292+
293+
### Example
294+
295+
* Basic Authentication (accessToken):
296+
```python
297+
from __future__ import print_function
298+
import time
299+
import mux_python
300+
from mux_python.rest import ApiException
301+
from pprint import pprint
302+
configuration = mux_python.Configuration()
303+
# Configure HTTP basic authorization: accessToken
304+
configuration.username = 'YOUR_USERNAME'
305+
configuration.password = 'YOUR_PASSWORD'
306+
307+
# create an instance of the API class
308+
api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration))
309+
live_stream_id = 'live_stream_id_example' # str | The live stream ID
310+
simulcast_target_id = 'simulcast_target_id_example' # str | The ID of the simulcast target.
311+
312+
try:
313+
# Delete a Live Stream Simulcast Target
314+
api_instance.delete_live_stream_simulcast_target(live_stream_id, simulcast_target_id)
315+
except ApiException as e:
316+
print("Exception when calling LiveStreamsApi->delete_live_stream_simulcast_target: %s\n" % e)
317+
```
318+
319+
### Parameters
320+
321+
Name | Type | Description | Notes
322+
------------- | ------------- | ------------- | -------------
323+
**live_stream_id** | **str**| The live stream ID |
324+
**simulcast_target_id** | **str**| The ID of the simulcast target. |
325+
326+
### Return type
327+
328+
void (empty response body)
329+
330+
### Authorization
331+
332+
[accessToken](../README.md#accessToken)
333+
334+
### HTTP request headers
335+
336+
- **Content-Type**: Not defined
337+
- **Accept**: Not defined
338+
339+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
340+
227341
# **get_live_stream**
228342
> LiveStreamResponse get_live_stream(live_stream_id)
229343
@@ -278,6 +392,62 @@ Name | Type | Description | Notes
278392

279393
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
280394

395+
# **get_live_stream_simulcast_target**
396+
> SimulcastTargetResponse get_live_stream_simulcast_target(live_stream_id, simulcast_target_id)
397+
398+
Retrieve a Live Stream Simulcast Target
399+
400+
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.
401+
402+
### Example
403+
404+
* Basic Authentication (accessToken):
405+
```python
406+
from __future__ import print_function
407+
import time
408+
import mux_python
409+
from mux_python.rest import ApiException
410+
from pprint import pprint
411+
configuration = mux_python.Configuration()
412+
# Configure HTTP basic authorization: accessToken
413+
configuration.username = 'YOUR_USERNAME'
414+
configuration.password = 'YOUR_PASSWORD'
415+
416+
# create an instance of the API class
417+
api_instance = mux_python.LiveStreamsApi(mux_python.ApiClient(configuration))
418+
live_stream_id = 'live_stream_id_example' # str | The live stream ID
419+
simulcast_target_id = 'simulcast_target_id_example' # str | The ID of the simulcast target.
420+
421+
try:
422+
# Retrieve a Live Stream Simulcast Target
423+
api_response = api_instance.get_live_stream_simulcast_target(live_stream_id, simulcast_target_id)
424+
pprint(api_response)
425+
except ApiException as e:
426+
print("Exception when calling LiveStreamsApi->get_live_stream_simulcast_target: %s\n" % e)
427+
```
428+
429+
### Parameters
430+
431+
Name | Type | Description | Notes
432+
------------- | ------------- | ------------- | -------------
433+
**live_stream_id** | **str**| The live stream ID |
434+
**simulcast_target_id** | **str**| The ID of the simulcast target. |
435+
436+
### Return type
437+
438+
[**SimulcastTargetResponse**](SimulcastTargetResponse.md)
439+
440+
### Authorization
441+
442+
[accessToken](../README.md#accessToken)
443+
444+
### HTTP request headers
445+
446+
- **Content-Type**: Not defined
447+
- **Accept**: application/json
448+
449+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
450+
281451
# **list_live_streams**
282452
> ListLiveStreamsResponse list_live_streams(limit=limit, page=page)
283453

docs/SigningKeyResponse.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Properties
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
6-
**data** | [**SigningKey**](SigningKey.md) | | [optional]
6+
**data** | [**SigningKey**](.md) | | [optional]
77

88
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
99

docs/SimulcastTarget.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SimulcastTarget
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**id** | **str** | ID of the Simulcast Target | [optional]
7+
**passthrough** | **str** | Arbitrary Metadata set when creating a simulcast target. | [optional]
8+
**status** | **str** | The current status of the simulcast target. See Statuses below for detailed description. * `idle`: Default status. When the parent live stream is in disconnected status, simulcast targets will be idle state. * `starting`: The simulcast target transitions into this state when the parent live stream transition into connected state. * `broadcasting`: The simulcast target has successfully connected to the third party live streaming service and is pushing video to that service. * `errored`: The simulcast target encountered an error either while attempting to connect to the third party live streaming service, or mid-broadcasting. Compared to other errored statuses in the Mux Video API, a simulcast may transition back into the broadcasting state if a connection with the service can be re-established. | [optional]
9+
**stream_key** | **str** | Stream Key represents an stream identifier for the third party live streaming service to simulcast the parent live stream too. | [optional]
10+
**url** | **str** | RTMP hostname including the application name for the third party live streaming service. | [optional]
11+
12+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
13+
14+

docs/SimulcastTargetResponse.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SimulcastTargetResponse
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**data** | [**SimulcastTarget**](.md) | | [optional]
7+
8+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
9+
10+

0 commit comments

Comments
 (0)