Skip to content

Commit 5c6dd79

Browse files
authored
Update opentok.py
1 parent 2a23a58 commit 5c6dd79

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

opentok/opentok.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,44 +1368,4 @@ def __init__(
13681368
app_version=app_version
13691369
)
13701370

1371-
1372-
1373-
1374-
def mute(self, session_id: str, stream_id: str= "", options: dict = {}) -> requests.Response:
1375-
"""
1376-
Use this method so the moderator can mute all streams or a specific stream for OpenTok.
1377-
Please note that a client is able to unmute themselves.
1378-
This function stays in the OpenTok class and inherits from the Client class.
1379-
1380-
:param session_id gets the session id from another function called get_session()
1381-
1382-
:param stream_id gets the stream id from another function called get_stream(). Note
1383-
that this variable is set to an empty string in the function definition as a specific
1384-
stream may not be chosen.
13851371

1386-
"""
1387-
1388-
try:
1389-
if not stream_id:
1390-
url = self.endpoints.get_mute_all_url(session_id)
1391-
data = {'excludedStream': stream_id}
1392-
else:
1393-
url = self.endpoints.get_stream_url(session_id, stream_id) + "/mute"
1394-
data = None
1395-
1396-
1397-
response = requests.post(url, headers=self.get_headers(), data=data)
1398-
1399-
if response:
1400-
return response
1401-
elif response.status_code == 400:
1402-
raise GetStreamError("Invalid request. This response may indicate that data in your request data is invalid JSON. Or it may indicate that you do not pass in a session ID or you passed in an invalid stream ID.")
1403-
elif response.status_code == 403:
1404-
raise AuthError("Failed to create session, invalid credentials")
1405-
elif response.status_code == 404:
1406-
raise NotFoundError("Mute not found")
1407-
except Exception as e:
1408-
raise OpenTokException(
1409-
("There was an error thrown by the OpenTok SDK, please check that your session_id {0} and stream_id (if exists) {1} are valid").format(
1410-
session_id, stream_id))
1411-

0 commit comments

Comments
 (0)