Skip to content

Latest commit

 

History

History
406 lines (256 loc) · 19.3 KB

README.md

File metadata and controls

406 lines (256 loc) · 19.3 KB

Room

(room)

Overview

Operations related to rooms api

Available Operations

  • create - Create a room ⚠️ Deprecated
  • get - Retrieve a room ⚠️ Deprecated
  • delete - Delete a room ⚠️ Deprecated
  • start_egress - Start room RTMP egress ⚠️ Deprecated
  • stop_egress - Stop room RTMP egress ⚠️ Deprecated
  • create_user - Create a room user ⚠️ Deprecated
  • get_user - Get user details ⚠️ Deprecated
  • update_user - Update a room user ⚠️ Deprecated
  • delete_user - Remove a user from the room ⚠️ Deprecated

create

Create a multiparticipant livestreaming room.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.room.create()

if res.create_room_response is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.CreateRoomResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

get

Retrieve a room

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.room.get(id="<id>")

if res.room is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetRoomResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

delete

Delete a room

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.room.delete(id="<id>")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteRoomResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

start_egress

Create a livestream for your room. This allows you to leverage livestreaming features like recording and HLS output.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.room.start_egress(id="<id>", room_egress_payload={
    "stream_id": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9",
})

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
id str ✔️ N/A
room_egress_payload components.RoomEgressPayload ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.StartRoomEgressResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

stop_egress

Stop room RTMP egress

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.room.stop_egress(id="<id>")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.StopRoomEgressResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

create_user

Call this endpoint to add a user to a room, specifying a display name at a minimum. The response will contain a joining URL for Livepeer's default meeting app. Alternatively the joining token can be used with a custom app.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.room.create_user(id="<id>", room_user_payload={
    "name": "name",
    "can_publish": True,
    "can_publish_data": True,
})

if res.room_user_response is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
id str ✔️ N/A
room_user_payload components.RoomUserPayload ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.CreateRoomUserResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

get_user

Get user details

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.room.get_user(id="<id>", user_id="<value>")

if res.get_room_user_response is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
id str ✔️ N/A
user_id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetRoomUserResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

update_user

Update properties for a user.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.room.update_user(id="<id>", user_id="<value>", room_user_update_payload={
    "can_publish": True,
    "can_publish_data": True,
})

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
id str ✔️ N/A
user_id str ✔️ N/A
room_user_update_payload components.RoomUserUpdatePayload ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.UpdateRoomUserResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

delete_user

Remove a user from the room

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

from livepeer import Livepeer

s = Livepeer(
    api_key="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.room.delete_user(id="<id>", user_id="<value>")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
id str ✔️ N/A
user_id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteRoomUserResponse

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /