Add support for unprotected MPEG-DASH streams (#111)
This commit is contained in:
parent
98a0ffb162
commit
b7a479e585
@ -361,6 +361,8 @@ class ContentApi:
|
|||||||
raise UnavailableException
|
raise UnavailableException
|
||||||
|
|
||||||
if 'videoDash' in data:
|
if 'videoDash' in data:
|
||||||
|
|
||||||
|
if 'drmKey' in data:
|
||||||
# DRM protected stream
|
# DRM protected stream
|
||||||
# See https://docs.unified-streaming.com/documentation/drm/buydrm.html#setting-up-the-client
|
# See https://docs.unified-streaming.com/documentation/drm/buydrm.html#setting-up-the-client
|
||||||
drm_key = data['drmKey']['S']
|
drm_key = data['drmKey']['S']
|
||||||
@ -369,6 +371,7 @@ class ContentApi:
|
|||||||
response_drm = self._get_url(self.API_GOPLAY + '/video/xml/%s' % drm_key, authentication=self._auth.get_token())
|
response_drm = self._get_url(self.API_GOPLAY + '/video/xml/%s' % drm_key, authentication=self._auth.get_token())
|
||||||
data_drm = json.loads(response_drm)
|
data_drm = json.loads(response_drm)
|
||||||
|
|
||||||
|
# DRM protected DASH stream
|
||||||
return ResolvedStream(
|
return ResolvedStream(
|
||||||
uuid=uuid,
|
uuid=uuid,
|
||||||
url=data['videoDash']['S'],
|
url=data['videoDash']['S'],
|
||||||
@ -377,7 +380,14 @@ class ContentApi:
|
|||||||
auth=data_drm.get('auth'),
|
auth=data_drm.get('auth'),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Normal HLS stream
|
# Unprotected DASH stream
|
||||||
|
return ResolvedStream(
|
||||||
|
uuid=uuid,
|
||||||
|
url=data['videoDash']['S'],
|
||||||
|
stream_type=STREAM_DASH,
|
||||||
|
)
|
||||||
|
|
||||||
|
# Unprotected HLS stream
|
||||||
return ResolvedStream(
|
return ResolvedStream(
|
||||||
uuid=uuid,
|
uuid=uuid,
|
||||||
url=data['video']['S'],
|
url=data['video']['S'],
|
||||||
|
Loading…
Reference in New Issue
Block a user