Skip to content

Commit

Permalink
Support reduced latency live streaming (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
philcluff authored Jul 17, 2019
1 parent bf90449 commit 57b72ee
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/CreateLiveStreamRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Name | Type | Description | Notes
**new_asset_settings** | [**CreateAssetRequest**](CreateAssetRequest.md) | | [optional]
**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]
**passthrough** | **str** | | [optional]
**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]

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

Expand Down
1 change: 1 addition & 0 deletions docs/LiveStream.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Name | Type | Description | Notes
**new_asset_settings** | [**Asset**](Asset.md) | | [optional]
**passthrough** | **str** | | [optional]
**reconnect_window** | **float** | | [optional]
**reduced_latency** | **bool** | | [optional]

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

Expand Down
2 changes: 1 addition & 1 deletion mux_python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from __future__ import absolute_import

__version__ = "1.2.1"
__version__ = "1.2.2"

# import apis into sdk package
from mux_python.api.assets_api import AssetsApi
Expand Down
2 changes: 1 addition & 1 deletion mux_python/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'Mux Python | 1.2.1'
self.user_agent = 'Mux Python | 1.2.2'

def __del__(self):
if self._pool:
Expand Down
2 changes: 1 addition & 1 deletion mux_python/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,5 +228,5 @@ def to_debug_report(self):
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: v1\n"\
"SDK Package Version: 1.2.1".\
"SDK Package Version: 1.2.2".\
format(env=sys.platform, pyversion=sys.version)
34 changes: 31 additions & 3 deletions mux_python/models/create_live_stream_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,26 @@ class CreateLiveStreamRequest(object):
'playback_policy': 'list[PlaybackPolicy]',
'new_asset_settings': 'CreateAssetRequest',
'reconnect_window': 'float',
'passthrough': 'str'
'passthrough': 'str',
'reduced_latency': 'bool'
}

attribute_map = {
'playback_policy': 'playback_policy',
'new_asset_settings': 'new_asset_settings',
'reconnect_window': 'reconnect_window',
'passthrough': 'passthrough'
'passthrough': 'passthrough',
'reduced_latency': 'reduced_latency'
}

def __init__(self, playback_policy=None, new_asset_settings=None, reconnect_window=60, passthrough=None): # noqa: E501
def __init__(self, playback_policy=None, new_asset_settings=None, reconnect_window=60, passthrough=None, reduced_latency=None): # noqa: E501
"""CreateLiveStreamRequest - a model defined in OpenAPI""" # noqa: E501

self._playback_policy = None
self._new_asset_settings = None
self._reconnect_window = None
self._passthrough = None
self._reduced_latency = None
self.discriminator = None

if playback_policy is not None:
Expand All @@ -52,6 +55,8 @@ def __init__(self, playback_policy=None, new_asset_settings=None, reconnect_wind
self.reconnect_window = reconnect_window
if passthrough is not None:
self.passthrough = passthrough
if reduced_latency is not None:
self.reduced_latency = reduced_latency

@property
def playback_policy(self):
Expand Down Expand Up @@ -143,6 +148,29 @@ def passthrough(self, passthrough):

self._passthrough = passthrough

@property
def reduced_latency(self):
"""Gets the reduced_latency of this CreateLiveStreamRequest. # noqa: E501
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/ # noqa: E501
:return: The reduced_latency of this CreateLiveStreamRequest. # noqa: E501
:rtype: bool
"""
return self._reduced_latency

@reduced_latency.setter
def reduced_latency(self, reduced_latency):
"""Sets the reduced_latency of this CreateLiveStreamRequest.
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/ # noqa: E501
:param reduced_latency: The reduced_latency of this CreateLiveStreamRequest. # noqa: E501
:type: bool
"""

self._reduced_latency = reduced_latency

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
Expand Down
32 changes: 29 additions & 3 deletions mux_python/models/live_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class LiveStream(object):
'playback_ids': 'list[PlaybackID]',
'new_asset_settings': 'Asset',
'passthrough': 'str',
'reconnect_window': 'float'
'reconnect_window': 'float',
'reduced_latency': 'bool'
}

attribute_map = {
Expand All @@ -44,10 +45,11 @@ class LiveStream(object):
'playback_ids': 'playback_ids',
'new_asset_settings': 'new_asset_settings',
'passthrough': 'passthrough',
'reconnect_window': 'reconnect_window'
'reconnect_window': 'reconnect_window',
'reduced_latency': 'reduced_latency'
}

def __init__(self, id=None, created_at=None, stream_key=None, active_asset_id=None, recent_asset_ids=None, status=None, playback_ids=None, new_asset_settings=None, passthrough=None, reconnect_window=None): # noqa: E501
def __init__(self, id=None, created_at=None, stream_key=None, active_asset_id=None, recent_asset_ids=None, status=None, playback_ids=None, new_asset_settings=None, passthrough=None, reconnect_window=None, reduced_latency=None): # noqa: E501
"""LiveStream - a model defined in OpenAPI""" # noqa: E501

self._id = None
Expand All @@ -60,6 +62,7 @@ def __init__(self, id=None, created_at=None, stream_key=None, active_asset_id=No
self._new_asset_settings = None
self._passthrough = None
self._reconnect_window = None
self._reduced_latency = None
self.discriminator = None

if id is not None:
Expand All @@ -82,6 +85,8 @@ def __init__(self, id=None, created_at=None, stream_key=None, active_asset_id=No
self.passthrough = passthrough
if reconnect_window is not None:
self.reconnect_window = reconnect_window
if reduced_latency is not None:
self.reduced_latency = reduced_latency

@property
def id(self):
Expand Down Expand Up @@ -293,6 +298,27 @@ def reconnect_window(self, reconnect_window):

self._reconnect_window = reconnect_window

@property
def reduced_latency(self):
"""Gets the reduced_latency of this LiveStream. # noqa: E501
:return: The reduced_latency of this LiveStream. # noqa: E501
:rtype: bool
"""
return self._reduced_latency

@reduced_latency.setter
def reduced_latency(self, reduced_latency):
"""Sets the reduced_latency of this LiveStream.
:param reduced_latency: The reduced_latency of this LiveStream. # noqa: E501
:type: bool
"""

self._reduced_latency = reduced_latency

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from setuptools import setup, find_packages # noqa: H301

NAME = "mux_python"
VERSION = "1.2.1"
VERSION = "1.2.2"
# To install the library, run the following
#
# python setup.py install
Expand Down

0 comments on commit 57b72ee

Please sign in to comment.