@@ -64,6 +64,9 @@ class Roles(Enum):
6464 """A subscriber can only subscribe to streams."""
6565 publisher = u ("publisher" )
6666 """A publisher can publish streams, subscribe to streams, and signal"""
67+ publisher_only = "publisheronly"
68+ """A client with the `publisher_only` role can only publish streams. It cannot subscribe to
69+ other clients' streams or send signals."""
6770 moderator = u ("moderator" )
6871 """In addition to the privileges granted to a publisher, a moderator can perform
6972 moderation functions, such as forcing clients to disconnect, to stop publishing streams,
@@ -106,7 +109,6 @@ class ArchiveModes(Enum):
106109
107110
108111class Client (object ):
109-
110112 """Use this SDK to create tokens and interface with the server-side portion
111113 of the Opentok API.
112114 """
@@ -187,6 +189,9 @@ def generate_token(
187189 * `Roles.publisher` -- A publisher can publish streams, subscribe to
188190 streams, and signal. (This is the default value if you do not specify a role.)
189191
192+ * `Roles.publisher_only` -- A client with the `publisher_only` role can only publish streams.
193+ It cannot subscribe to other clients' streams or send signals.
194+
190195 * `Roles.moderator` -- In addition to the privileges granted to a
191196 publisher, in clients using the OpenTok.js 2.2 library, a moderator can call the
192197 `forceUnpublish()` and `forceDisconnect()` method of the
@@ -499,9 +504,7 @@ def create_session(
499504 )
500505 )
501506
502- session_id = (
503- dom .getElementsByTagName ("session_id" )[0 ].childNodes [0 ].nodeValue
504- )
507+ session_id = dom .getElementsByTagName ("session_id" )[0 ].childNodes [0 ].nodeValue
505508 return Session (
506509 self ,
507510 session_id ,
@@ -890,9 +893,7 @@ def add_archive_stream(
890893 else :
891894 raise RequestError ("An unexpected error occurred." , response .status_code )
892895
893- def remove_archive_stream (
894- self , archive_id : str , stream_id : str
895- ) -> requests .Response :
896+ def remove_archive_stream (self , archive_id : str , stream_id : str ) -> requests .Response :
896897 """
897898 This method will remove streams from the archive with removeStream.
898899
@@ -1339,9 +1340,7 @@ class names (Strings) to apply to the stream. For example:
13391340 else :
13401341 raise RequestError ("OpenTok server error." , response .status_code )
13411342
1342- def start_broadcast (
1343- self , session_id , options , stream_mode = BroadcastStreamModes .auto
1344- ):
1343+ def start_broadcast (self , session_id , options , stream_mode = BroadcastStreamModes .auto ):
13451344 """
13461345 Use this method to start a live streaming broadcast for an OpenTok session. This broadcasts
13471346 the session to an HLS (HTTP live streaming) or to RTMP streams. To successfully start
@@ -1576,9 +1575,7 @@ def add_broadcast_stream(
15761575 "Your broadcast is configured with a streamMode that does not support stream manipulation."
15771576 )
15781577 elif response .status_code == 409 :
1579- raise BroadcastError (
1580- "The broadcast has already started for the session."
1581- )
1578+ raise BroadcastError ("The broadcast has already started for the session." )
15821579 else :
15831580 raise RequestError ("An unexpected error occurred." , response .status_code )
15841581
@@ -1621,9 +1618,7 @@ def remove_broadcast_stream(
16211618 "Your broadcast is configured with a streamMode that does not support stream manipulation."
16221619 )
16231620 elif response .status_code == 409 :
1624- raise BroadcastError (
1625- "The broadcast has already started for the session."
1626- )
1621+ raise BroadcastError ("The broadcast has already started for the session." )
16271622 else :
16281623 raise RequestError ("OpenTok server error." , response .status_code )
16291624
0 commit comments