77
88from dolbyio_rest_apis .communications .internal .http_context import CommunicationsHttpContext
99from dolbyio_rest_apis .communications .internal .urls import get_comms_url_v2
10- from typing import List
10+ from dolbyio_rest_apis . core . helpers import add_if_not_none
1111
1212async def start_rtmp (
1313 access_token : str ,
1414 conference_id : str ,
15- rtmp_urls : List [ str ] ,
15+ rtmp_url : str ,
1616 ) -> None :
1717 r"""
1818 Starts the RTMP live stream for the specified conference. Once the Dolby.io Communications APIs service starts
1919 streaming to the target url, a `Stream.Rtmp.InProgress` Webhook event will be sent.
20- You must use this API if the conference is protected using enhanced conference access control.
2120
2221 See: https://docs.dolby.io/communications-apis/reference/start-rtmp
2322
2423 Args:
2524 access_token: Access token to use for authentication.
2625 conference_id: Identifier of the conference.
27- rtmp_urls: List of the RTMP endpoints where to send the RTMP stream to .
26+ rtmp_url: The destination URI provided by the RTMP service .
2827
2928 Raises:
3029 HttpRequestError: If a client error one occurred.
3130 HTTPError: If one occurred.
3231 """
3332
3433 payload = {
35- 'uri' : '|' . join ( rtmp_urls ) ,
34+ 'uri' : rtmp_url ,
3635 }
3736
3837 async with CommunicationsHttpContext () as http_context :
@@ -47,8 +46,7 @@ async def stop_rtmp(
4746 conference_id : str ,
4847 ) -> None :
4948 r"""
50- Stops an RTMP stream.
51- You must use this API if the conference is protected using enhanced conference access control.
49+ Stops the RTMP stream of the specified conference.
5250
5351 See: https://docs.dolby.io/communications-apis/reference/stop-rtmp
5452
@@ -67,22 +65,28 @@ async def stop_rtmp(
6765 url = f'{ get_comms_url_v2 ()} /conferences/mix/{ conference_id } /rtmp/stop'
6866 )
6967
70- async def start_lls (
68+ async def start_rts (
7169 access_token : str ,
7270 conference_id : str ,
7371 stream_name : str ,
7472 publishing_token : str ,
73+ layout_url : str = None ,
7574 ) -> None :
7675 r"""
77- Starts a Low Latency Stream to Millicast.
76+ Starts real-time streaming using Dolby.io Real-time Streaming services (formerly Millicast) .
7877
79- See: https://docs.dolby.io/communications-apis/reference/start-rtmp
78+ See: https://docs.dolby.io/communications-apis/reference/start-rts
8079
8180 Args:
8281 access_token: Access token to use for authentication.
8382 conference_id: Identifier of the conference.
84- stream_name: The Millicast stream name to which the conference will broadcasted.
85- publishing_token:The Millicast publishing token used to identify the broadcaster.
83+ stream_name: The Dolby.io Real-time Streaming stream name to which the conference is broadcasted.
84+ publishing_token: The publishing token used to identify the broadcaster.
85+ layout_url: Overwrites the layout URL configuration:
86+ null: uses the layout URL configured in the dashboard
87+ (if no URL is set in the dashboard, then uses the Dolby.io default)
88+ default: uses the Dolby.io default layout
89+ URL string: uses this layout URL
8690
8791 Raises:
8892 HttpRequestError: If a client error one occurred.
@@ -93,22 +97,23 @@ async def start_lls(
9397 'stream_name' : stream_name ,
9498 'publishingToken' : publishing_token ,
9599 }
100+ add_if_not_none (payload , 'layoutUrl' , layout_url )
96101
97102 async with CommunicationsHttpContext () as http_context :
98103 await http_context .requests_post (
99104 access_token = access_token ,
100- url = f'{ get_comms_url_v2 ()} /conferences/mix/{ conference_id } /lls /start' ,
105+ url = f'{ get_comms_url_v2 ()} /conferences/mix/{ conference_id } /rts /start' ,
101106 payload = payload ,
102107 )
103108
104- async def stop_lls (
109+ async def stop_rts (
105110 access_token : str ,
106111 conference_id : str ,
107112 ) -> None :
108113 r"""
109- Stops an existing Low Latency Stream to Millicast .
114+ Stops real-time streaming to Dolby.io Real-time Streaming services .
110115
111- See: https://docs.dolby.io/communications-apis/reference/stop-lls
116+ See: https://docs.dolby.io/communications-apis/reference/stop-rts
112117
113118 Args:
114119 access_token: Access token to use for authentication.
@@ -122,5 +127,5 @@ async def stop_lls(
122127 async with CommunicationsHttpContext () as http_context :
123128 await http_context .requests_post (
124129 access_token = access_token ,
125- url = f'{ get_comms_url_v2 ()} /conferences/mix/{ conference_id } /lls /stop'
130+ url = f'{ get_comms_url_v2 ()} /conferences/mix/{ conference_id } /rts /stop'
126131 )
0 commit comments