Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/room_manager/room_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __find_or_create_room(
options = RoomOptions(
max_peers=self.config.max_peers,
webhook_url=self.config.webhook_url,
room_type=room_type.value if room_type else "full_feature",
room_type=room_type.value if room_type else "conference",
)

new_room = self.fishjam_client.create_room(options=options)
Expand Down
8 changes: 4 additions & 4 deletions fishjam/_openapi_client/api/viewer/generate_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def sync_detailed(
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Union[Error, ViewerToken]]:
"""Generate single broadcaster access token
"""Generate single livestream access token

Args:
room_id (str):
Expand Down Expand Up @@ -95,7 +95,7 @@ def sync(
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[Union[Error, ViewerToken]]:
"""Generate single broadcaster access token
"""Generate single livestream access token

Args:
room_id (str):
Expand All @@ -119,7 +119,7 @@ async def asyncio_detailed(
*,
client: Union[AuthenticatedClient, Client],
) -> Response[Union[Error, ViewerToken]]:
"""Generate single broadcaster access token
"""Generate single livestream access token

Args:
room_id (str):
Expand All @@ -146,7 +146,7 @@ async def asyncio(
*,
client: Union[AuthenticatedClient, Client],
) -> Optional[Union[Error, ViewerToken]]:
"""Generate single broadcaster access token
"""Generate single livestream access token

Args:
room_id (str):
Expand Down
4 changes: 2 additions & 2 deletions fishjam/_openapi_client/models/room_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class RoomConfig:

max_peers: Union[Unset, None, int] = UNSET
"""Maximum amount of peers allowed into the room"""
room_type: Union[Unset, RoomConfigRoomType] = RoomConfigRoomType.FULL_FEATURE
"""The use-case of the room. If not provided, this defaults to full_feature."""
room_type: Union[Unset, RoomConfigRoomType] = RoomConfigRoomType.CONFERENCE
"""The use-case of the room. If not provided, this defaults to conference."""
video_codec: Union[Unset, None, RoomConfigVideoCodec] = UNSET
"""Enforces video codec for each peer in the room"""
webhook_url: Union[Unset, None, str] = UNSET
Expand Down
4 changes: 3 additions & 1 deletion fishjam/_openapi_client/models/room_config_room_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@


class RoomConfigRoomType(str, Enum):
"""The use-case of the room. If not provided, this defaults to full_feature."""
"""The use-case of the room. If not provided, this defaults to conference."""

AUDIO_ONLY = "audio_only"
BROADCASTER = "broadcaster"
CONFERENCE = "conference"
FULL_FEATURE = "full_feature"
LIVESTREAM = "livestream"

def __str__(self) -> str:
return str(self.value)
2 changes: 1 addition & 1 deletion fishjam/_openapi_client/models/viewer_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

@_attrs_define
class ViewerToken:
"""Token for authorizing broadcaster viewer connection"""
"""Token for authorizing livestream viewer connection"""

token: str
"""None"""
Expand Down
9 changes: 3 additions & 6 deletions fishjam/api/_fishjam_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ class RoomOptions:
webhook_url: str | None = None
"""URL where Fishjam notifications will be sent"""
room_type: Literal[
"full_feature", "audio_only", "broadcaster", "livestream"
] = "full_feature"
"""The use-case of the room. If not provided, this defaults to full_feature."""
"conference", "audio_only", "livestream", "full_feature", "broadcaster"
] = "conference"
"""The use-case of the room. If not provided, this defaults to conference."""


@dataclass
Expand Down Expand Up @@ -118,9 +118,6 @@ def create_room(self, options: RoomOptions | None = None) -> Room:
if options.video_codec:
codec = RoomConfigVideoCodec(options.video_codec)

if options.room_type == "livestream":
options.room_type = "broadcaster"

config = RoomConfig(
max_peers=options.max_peers,
video_codec=codec,
Expand Down
9 changes: 5 additions & 4 deletions tests/test_room_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
MAX_PEERS = 10
CODEC_H264 = "h264"
AUDIO_ONLY = "audio_only"
FULL_FEATURE = "full_feature"
CONFERENCE = "conference"
LIVESTREAM = "livestream"


class TestAuthentication:
Expand Down Expand Up @@ -65,7 +66,7 @@ def test_no_params(self, room_api):
max_peers=None,
video_codec=None,
webhook_url=None,
room_type=RoomConfigRoomType(FULL_FEATURE),
room_type=RoomConfigRoomType(CONFERENCE),
)
config.__setitem__("roomId", room.config.__getitem__("roomId"))
config.__setitem__(
Expand Down Expand Up @@ -152,7 +153,7 @@ def test_valid(self, room_api: FishjamClient):
max_peers=None,
video_codec=None,
webhook_url=None,
room_type=RoomConfigRoomType(FULL_FEATURE),
room_type=RoomConfigRoomType(CONFERENCE),
)
config.__setitem__("roomId", room.config.__getitem__("roomId"))
config.__setitem__(
Expand Down Expand Up @@ -255,7 +256,7 @@ def test_invalid(self, room_api: FishjamClient):

class TestCreateLivestreamViewerToken:
def test_valid(self, room_api: FishjamClient):
room = room_api.create_room(RoomOptions(room_type="livestream"))
room = room_api.create_room(RoomOptions(room_type=LIVESTREAM))
viewer_token = room_api.create_livestream_viewer_token(room.id)

assert isinstance(viewer_token, str)
Expand Down