mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-23 05:39:05 +00:00
feat: increase daily recording max duration (#801)
* increate daily recording max duration * recording end time: 3h min --------- Co-authored-by: Igor Loskutov <igor.loskutoff@gmail.com>
This commit is contained in:
@@ -91,6 +91,10 @@ class MeetingTokenProperties(BaseModel):
|
||||
start_cloud_recording: bool = Field(
|
||||
default=False, description="Automatically start cloud recording on join"
|
||||
)
|
||||
start_cloud_recording_opts: dict | None = Field(
|
||||
default=None,
|
||||
description="Options for startRecording when start_cloud_recording is true (e.g., maxDuration)",
|
||||
)
|
||||
enable_recording_ui: bool = Field(
|
||||
default=True, description="Show recording controls in UI"
|
||||
)
|
||||
|
||||
@@ -181,11 +181,17 @@ class DailyClient(VideoPlatformClient):
|
||||
enable_recording_ui: bool,
|
||||
user_id: NonEmptyString | None = None,
|
||||
is_owner: bool = False,
|
||||
max_recording_duration_seconds: int | None = None,
|
||||
) -> NonEmptyString:
|
||||
start_cloud_recording_opts = None
|
||||
if start_cloud_recording and max_recording_duration_seconds:
|
||||
start_cloud_recording_opts = {"maxDuration": max_recording_duration_seconds}
|
||||
|
||||
properties = MeetingTokenProperties(
|
||||
room_name=room_name,
|
||||
user_id=user_id,
|
||||
start_cloud_recording=start_cloud_recording,
|
||||
start_cloud_recording_opts=start_cloud_recording_opts,
|
||||
enable_recording_ui=enable_recording_ui,
|
||||
is_owner=is_owner,
|
||||
)
|
||||
|
||||
@@ -578,12 +578,19 @@ async def rooms_join_meeting(
|
||||
enable_recording_ui = meeting.recording_type == "local" or (
|
||||
meeting.recording_type == "cloud" and room.skip_consent
|
||||
)
|
||||
end_date = meeting.end_date
|
||||
if end_date.tzinfo is None:
|
||||
end_date = end_date.replace(tzinfo=timezone.utc)
|
||||
remaining_seconds = min(
|
||||
3 * 60 * 60, int((end_date - current_time).total_seconds())
|
||||
)
|
||||
token = await client.create_meeting_token(
|
||||
meeting.room_name,
|
||||
start_cloud_recording=meeting.recording_type == "cloud",
|
||||
enable_recording_ui=enable_recording_ui,
|
||||
user_id=user_id,
|
||||
is_owner=user_id == room.user_id,
|
||||
max_recording_duration_seconds=remaining_seconds,
|
||||
)
|
||||
meeting = meeting.model_copy()
|
||||
meeting.room_url = add_query_param(meeting.room_url, "t", token)
|
||||
|
||||
Reference in New Issue
Block a user