Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

pause/resume in instant mode on macos (#407)

Brendan Allan1b14990a8bf4
diff --git a/Cargo.lock b/Cargo.lock
index 703486259..177138f4a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6374,7 +6374,7 @@ dependencies = [
[[package]]
name = "scap"
version = "0.0.8"
-source = "git+https://github.com/CapSoftware/scap?rev=212d7a3958662244b9c7218a90c9c770f07c4222#212d7a3958662244b9c7218a90c9c770f07c4222"
+source = "git+https://github.com/CapSoftware/scap?rev=35ece62a0014#35ece62a0014ef74a4fa80ea4985e29e72fe1e9b"
dependencies = [
"cocoa 0.25.0",
"core-foundation 0.10.0",
diff --git a/Cargo.toml b/Cargo.toml
index 8b425a3f9..ad9abc68a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,7 +25,7 @@ specta = { version = "=2.0.0-rc.20", features = [
"uuid",
] }
-scap = { git = "https://github.com/CapSoftware/scap", rev = "212d7a3958662244b9c7218a90c9c770f07c4222" }
+scap = { git = "https://github.com/CapSoftware/scap", rev = "35ece62a0014" }
nokhwa = { git = "https://github.com/CapSoftware/nokhwa", rev = "e309b938ccd6", features = [
"input-native",
"serialize",
diff --git a/apps/desktop/src-tauri/src/lib.rs b/apps/desktop/src-tauri/src/lib.rs
index 1ca77c83d..38c5d2183 100644
--- a/apps/desktop/src-tauri/src/lib.rs
+++ b/apps/desktop/src-tauri/src/lib.rs
@@ -285,6 +285,7 @@ impl App {
self.camera_feed = Some(Arc::new(Mutex::new(feed)));
})
.map_err(|e| e.to_string())?;
+
return Ok(true);
}
@@ -2400,12 +2401,12 @@ pub async fn run(recording_logging_handle: LoggingHandle) {
let state = app.state::<Arc<RwLock<App>>>();
let app_state = &mut *state.write().await;
- app_state.remove_mic_feed();
- app_state.remove_camera_feed();
+ if app_state.current_recording.is_none() {
+ app_state.remove_mic_feed();
- if let Some(camera) = CapWindowId::Camera.get(&app) {
- if app_state.current_recording.is_none() {
+ if let Some(camera) = CapWindowId::Camera.get(&app) {
let _ = camera.close();
+ app_state.remove_camera_feed();
}
}
});
diff --git a/apps/desktop/src-tauri/src/recording.rs b/apps/desktop/src-tauri/src/recording.rs
index 002ee17e1..de8ff511e 100644
--- a/apps/desktop/src-tauri/src/recording.rs
+++ b/apps/desktop/src-tauri/src/recording.rs
@@ -517,7 +517,7 @@ async fn handle_recording_finish(
.await;
match resp {
- Ok(r) if r.status() == 200 => {
+ Ok(r) if r.status() == 204 => {
info!("Screenshot uploaded successfully");
}
Ok(r) => {
diff --git a/apps/desktop/src-tauri/src/upload.rs b/apps/desktop/src-tauri/src/upload.rs
index 5acd49758..9da38d3a5 100644
--- a/apps/desktop/src-tauri/src/upload.rs
+++ b/apps/desktop/src-tauri/src/upload.rs
@@ -933,7 +933,6 @@ impl InstantMultipartUpload {
}
}
}
- dbg!(realtime_is_done);
// Check the file's current size
if !file_path.exists() {
diff --git a/apps/desktop/src-tauri/src/windows.rs b/apps/desktop/src-tauri/src/windows.rs
index f62582398..1d9d2f305 100644
--- a/apps/desktop/src-tauri/src/windows.rs
+++ b/apps/desktop/src-tauri/src/windows.rs
@@ -194,9 +194,7 @@ impl ShowCapWindow {
let state = app.state::<Arc<RwLock<App>>>();
let state = &mut *state.write().await;
- let created_feed = state.create_camera_feed().await.unwrap_or(false);
-
- if created_feed {
+ if state.create_camera_feed().await.unwrap_or(false) {
Box::pin(
Self::Camera {
ws_port: state.camera_ws_port,
diff --git a/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx b/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx
index a9a018f56..a660d5642 100644
--- a/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx
+++ b/apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx
@@ -12,7 +12,9 @@ import { getCurrentWindow } from "@tauri-apps/api/window";
import titlebarState from "~/utils/titlebar-state";
import { cx } from "cva";
-export default function (props: ComponentProps<"div"> & { maximizable?: boolean }) {
+export default function (
+ props: ComponentProps<"div"> & { maximizable?: boolean }
+) {
const [local, otherProps] = splitProps(props, ["class"]);
const currentWindow = getCurrentWindow();
const [focused, setFocus] = createSignal(true);
@@ -47,7 +49,13 @@ export default function (props: ComponentProps<"div"> & { maximizable?: boolean
>
<icons.minimizeWin />
</ControlButton>
- <Show when={titlebarState.maximizable || !titlebarState.hideMaximize || props.maximizable}>
+ <Show
+ when={
+ titlebarState.maximizable ||
+ !titlebarState.hideMaximize ||
+ props.maximizable
+ }
+ >
<ControlButton
disabled={!titlebarState.maximizable || props.maximizable === false}
onClick={
diff --git a/apps/desktop/src/routes/(window-chrome)/settings/integrations/index.tsx b/apps/desktop/src/routes/(window-chrome)/settings/integrations/index.tsx
index fd1f6a2e7..508e9691f 100644
--- a/apps/desktop/src/routes/(window-chrome)/settings/integrations/index.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/settings/integrations/index.tsx
@@ -61,11 +61,11 @@ export default function AppsTab() {
onClick={() => handleAppClick(app)}
disabled={isUpgraded.loading}
>
- {isUpgraded.loading
- ? "Loading..."
- : app.pro && !isUpgraded()
- ? "Upgrade to Pro"
- : "Configure"}
+ {isUpgraded.loading
+ ? "Loading..."
+ : app.pro && !isUpgraded()
+ ? "Upgrade to Pro"
+ : "Configure"}
</Button>
</div>
<div class="p-2">
diff --git a/apps/desktop/src/routes/editor/context.ts b/apps/desktop/src/routes/editor/context.ts
index 5952b7e27..850af21c3 100644
--- a/apps/desktop/src/routes/editor/context.ts
+++ b/apps/desktop/src/routes/editor/context.ts
@@ -85,7 +85,6 @@ export const [EditorContextProvider, useEditorContext] = createContextProvider(
const [playbackTime, setPlaybackTime] = createSignal<number>(0);
const [playing, setPlaying] = createSignal(false);
-
//Export states
const [exportProgress, setExportProgress] = createSignal<{
@@ -122,18 +121,19 @@ export const [EditorContextProvider, useEditorContext] = createContextProvider(
| { type: "link-copied" }
>({ type: "idle" });
-
//This is used in ShareButton.tsx to notify the component that the metadata has changed, from ExportDialog.tsx
//When a video is uploaded, the metadata is updated
-
- const [lastMetaUpdate, setLastMetaUpdate] = createSignal<{ videoId: string; timestamp: number } | null>(null);
+ const [lastMetaUpdate, setLastMetaUpdate] = createSignal<{
+ videoId: string;
+ timestamp: number;
+ } | null>(null);
const metaUpdateStore = {
notifyUpdate: (videoId: string) => {
setLastMetaUpdate({ videoId, timestamp: Date.now() });
},
- getLastUpdate: lastMetaUpdate
+ getLastUpdate: lastMetaUpdate,
};
createEffect(
diff --git a/apps/desktop/src/routes/editor/utils.ts b/apps/desktop/src/routes/editor/utils.ts
index 7fd6d14bd..b8f907d70 100644
--- a/apps/desktop/src/routes/editor/utils.ts
+++ b/apps/desktop/src/routes/editor/utils.ts
@@ -16,13 +16,13 @@ import { getCurrentWindow, ProgressBarStatus } from "@tauri-apps/api/window";
import { createEffect } from "solid-js";
export function createProgressBar(progress: () => number | undefined) {
- const currentWindow = getCurrentWindow();
-
- createEffect(() => {
- const p = progress();
- console.log({ p });
- if (p === undefined)
- currentWindow.setProgressBar({ status: ProgressBarStatus.None });
- else currentWindow.setProgressBar({ progress: Math.round(p) });
- });
- }
\ No newline at end of file
+ const currentWindow = getCurrentWindow();
+
+ createEffect(() => {
+ const p = progress();
+ console.log({ p });
+ if (p === undefined)
+ currentWindow.setProgressBar({ status: ProgressBarStatus.None });
+ else currentWindow.setProgressBar({ progress: Math.round(p) });
+ });
+}
diff --git a/apps/desktop/src/utils/analytics.ts b/apps/desktop/src/utils/analytics.ts
index 966b96e60..28cc656d6 100644
--- a/apps/desktop/src/utils/analytics.ts
+++ b/apps/desktop/src/utils/analytics.ts
@@ -27,7 +27,10 @@ export function identifyUser(userId: string, properties?: Record<string, any>) {
}
}
-export function trackEvent(eventName: string, properties?: Record<string, any>) {
+export function trackEvent(
+ eventName: string,
+ properties?: Record<string, any>
+) {
if (!key || !host) return;
posthog.capture(eventName, properties);
-}
\ No newline at end of file
+}
diff --git a/apps/desktop/src/utils/web-api.ts b/apps/desktop/src/utils/web-api.ts
index 21e904700..152fb113f 100644
--- a/apps/desktop/src/utils/web-api.ts
+++ b/apps/desktop/src/utils/web-api.ts
@@ -46,5 +46,6 @@ export async function maybeProtectedHeaders() {
export async function protectedHeaders() {
const { authorization } = await maybeProtectedHeaders();
if (!authorization) throw new Error("Not authorized");
+ console.log({ authorization });
return { authorization };
}
diff --git a/apps/web/app/api/desktop/s3/config/app.ts b/apps/web/app/api/desktop/s3/config/app.ts
index c7a435e13..4d00abc94 100644
--- a/apps/web/app/api/desktop/s3/config/app.ts
+++ b/apps/web/app/api/desktop/s3/config/app.ts
@@ -176,6 +176,7 @@ app.post(
clearTimeout(timeoutId);
} catch (error) {
+ console.log(error);
clearTimeout(timeoutId);
let errorMessage = "Failed to connect to S3";
diff --git a/apps/web/app/api/download/route.ts b/apps/web/app/api/download/route.ts
index 7eeeb2ca6..94b15e8ea 100644
--- a/apps/web/app/api/download/route.ts
+++ b/apps/web/app/api/download/route.ts
@@ -6,10 +6,10 @@ export const revalidate = 0;
export async function GET(request: NextRequest) {
// Get the user agent string
const userAgent = request.headers.get("user-agent") || "";
-
+
// Determine the platform based on the user agent
let platform = "apple-silicon"; // Default to Apple Silicon
-
+
if (userAgent.includes("Windows")) {
platform = "windows";
} else if (userAgent.includes("Mac")) {
@@ -21,7 +21,7 @@ export async function GET(request: NextRequest) {
platform = "apple-silicon";
}
}
-
+
// Redirect to the appropriate platform-specific download route
return NextResponse.redirect(new URL(`/download/${platform}`, request.url));
-}
\ No newline at end of file
+}
diff --git a/apps/web/app/api/email/new-comment/route.ts b/apps/web/app/api/email/new-comment/route.ts
index ea7aaaa56..0e12f8e73 100644
--- a/apps/web/app/api/email/new-comment/route.ts
+++ b/apps/web/app/api/email/new-comment/route.ts
@@ -40,20 +40,26 @@ export async function POST(request: NextRequest) {
if (!commentDetails || commentDetails.length === 0) {
console.error(`Comment not found for commentId: ${commentId}`);
- return Response.json(
- { error: "Comment not found" },
- { status: 404 }
- );
+ return Response.json({ error: "Comment not found" }, { status: 404 });
}
const comment = commentDetails[0];
if (comment) {
- console.log(`Found comment: ${comment.id}, type: ${comment.type}, videoId: ${comment.videoId}`);
+ console.log(
+ `Found comment: ${comment.id}, type: ${comment.type}, videoId: ${comment.videoId}`
+ );
}
// Only send email notifications for text comments
- if (!comment || comment.type !== "text" || !comment.videoId || !comment.content) {
- console.log("Skipping email notification - invalid comment data or non-text comment");
+ if (
+ !comment ||
+ comment.type !== "text" ||
+ !comment.videoId ||
+ !comment.content
+ ) {
+ console.log(
+ "Skipping email notification - invalid comment data or non-text comment"
+ );
return Response.json(
{ success: false, reason: "Invalid comment data" },
{ status: 200 }
@@ -74,23 +80,19 @@ export async function POST(request: NextRequest) {
if (!videoDetails || videoDetails.length === 0) {
console.error(`Video not found for videoId: ${comment.videoId}`);
- return Response.json(
- { error: "Video not found" },
- { status: 404 }
- );
+ return Response.json({ error: "Video not found" }, { status: 404 });
}
const video = videoDetails[0];
if (video) {
- console.log(`Found video: ${video.id}, name: ${video.name}, ownerId: ${video.ownerId}`);
+ console.log(
+ `Found video: ${video.id}, name: ${video.name}, ownerId: ${video.ownerId}`
+ );
}
if (!video || !video.ownerId || !video.id || !video.name) {
console.error("Invalid video data");
- return Response.json(
- { error: "Invalid video data" },
- { status: 500 }
- );
+ return Response.json({ error: "Invalid video data" }, { status: 500 });
}
console.log(`Fetching owner details for userId: ${video.ownerId}`);
@@ -104,12 +106,14 @@ export async function POST(request: NextRequest) {
.where(eq(users.id, video.ownerId))
.limit(1);
- if (!ownerDetails || !ownerDetails.length || !ownerDetails[0] || !ownerDetails[0].email) {
+ if (
+ !ownerDetails ||
+ !ownerDetails.length ||
+ !ownerDetails[0] ||
+ !ownerDetails[0].email
+ ) {
console.error(`Video owner not found for userId: ${video.ownerId}`);
- return Response.json(
- { error: "Video owner not found" },
- { status: 404 }
- );
+ return Response.json({ error: "Video owner not found" }, { status: 404 });
}
const owner = ownerDetails[0];
@@ -117,10 +121,7 @@ export async function POST(request: NextRequest) {
if (!owner || !owner.email || !owner.id) {
console.error("Invalid owner data");
- return Response.json(
- { error: "Invalid owner data" },
- { status: 500 }
- );
+ return Response.json({ error: "Invalid owner data" }, { status: 500 });
}
// Get the commenter's name
@@ -136,7 +137,12 @@ export async function POST(request: NextRequest) {
.where(eq(users.id, comment.authorId))
.limit(1);
- if (commenterDetails && commenterDetails.length > 0 && commenterDetails[0] && commenterDetails[0].name) {
+ if (
+ commenterDetails &&
+ commenterDetails.length > 0 &&
+ commenterDetails[0] &&
+ commenterDetails[0].name
+ ) {
commenterName = commenterDetails[0].name;
console.log(`Found commenter name: ${commenterName}`);
} else {
@@ -149,12 +155,16 @@ export async function POST(request: NextRequest) {
// Check if we've sent an email to this user in the last 15 minutes
const now = new Date();
const lastEmailSent = lastEmailSentCache.get(owner.id);
-
+
if (lastEmailSent) {
const fifteenMinutesAgo = new Date(now.getTime() - 15 * 60 * 1000);
-
+
if (lastEmailSent > fifteenMinutesAgo) {
- console.log(`Rate limiting email to user ${owner.id} - last email sent at ${lastEmailSent.toISOString()}`);
+ console.log(
+ `Rate limiting email to user ${
+ owner.id
+ } - last email sent at ${lastEmailSent.toISOString()}`
+ );
return Response.json(
{ success: false, reason: "Email rate limited" },
{ status: 200 }
@@ -165,7 +175,9 @@ export async function POST(request: NextRequest) {
// Also check the database for recent comments that might have triggered emails
// This handles cases where the server restarts and the cache is cleared
const fifteenMinutesAgo = new Date(now.getTime() - 15 * 60 * 1000);
- console.log(`Checking for recent comments since ${fifteenMinutesAgo.toISOString()}`);
+ console.log(
+ `Checking for recent comments since ${fifteenMinutesAgo.toISOString()}`
+ );
const recentComments = await db
.select({
id: comments.id,
@@ -183,7 +195,9 @@ export async function POST(request: NextRequest) {
// If there are recent comments (other than this one), don't send another email
if (recentComments && recentComments.length > 0 && recentComments[0]) {
- console.log(`Found recent comment ${recentComments[0].id}, skipping email notification`);
+ console.log(
+ `Found recent comment ${recentComments[0].id}, skipping email notification`
+ );
return Response.json(
{ success: false, reason: "Recent comment found" },
{ status: 200 }
@@ -197,8 +211,10 @@ export async function POST(request: NextRequest) {
console.log(`Generated video URL: ${videoUrl}`);
// Send the email
- console.log(`Sending email to ${owner.email} about comment on video "${video.name}"`);
-
+ console.log(
+ `Sending email to ${owner.email} about comment on video "${video.name}"`
+ );
+
try {
const emailResult = await sendEmail({
email: owner.email,
@@ -212,14 +228,14 @@ export async function POST(request: NextRequest) {
}),
marketing: true,
});
-
+
console.log("Email send result:", emailResult);
console.log("Email sent successfully");
-
+
// Update the cache
lastEmailSentCache.set(owner.id, now);
console.log(`Updated email cache for user ${owner.id}`);
-
+
return Response.json({ success: true }, { status: 200 });
} catch (emailError) {
console.error("Error sending email via Resend:", emailError);
@@ -230,9 +246,6 @@ export async function POST(request: NextRequest) {
}
} catch (error) {
console.error("Error sending new comment email:", error);
- return Response.json(
- { error: "Failed to send email" },
- { status: 500 }
- );
+ return Response.json({ error: "Failed to send email" }, { status: 500 });
}
-}
\ No newline at end of file
+}
diff --git a/apps/web/app/api/selfhosted/checkout/route.ts b/apps/web/app/api/selfhosted/checkout/route.ts
index fb3dfea53..8208cd36a 100644
--- a/apps/web/app/api/selfhosted/checkout/route.ts
+++ b/apps/web/app/api/selfhosted/checkout/route.ts
@@ -4,7 +4,7 @@ export async function POST(request: Request) {
try {
const body = await request.json();
console.log("Self-hosted checkout request body:", body);
-
+
// Forward the request to the external service
console.log("Forwarding request to external service...");
const response = await fetch("https://l.cap.so/api/selfhost/checkout", {
@@ -14,13 +14,13 @@ export async function POST(request: Request) {
},
body: JSON.stringify(body),
});
-
+
console.log("External service response status:", response.status);
-
+
// Get the raw response text first
const responseText = await response.text();
console.log("External service raw response:", responseText);
-
+
// Then try to parse it as JSON
let data;
try {
@@ -33,14 +33,14 @@ export async function POST(request: Request) {
{ status: 500 }
);
}
-
+
if (!response.ok) {
return NextResponse.json(
{ message: data.message || "Failed to process checkout" },
{ status: response.status }
);
}
-
+
return NextResponse.json(data);
} catch (error) {
console.error("Error in self-hosted checkout:", error);
@@ -52,4 +52,4 @@ export async function POST(request: Request) {
{ status: 500 }
);
}
-}
\ No newline at end of file
+}
diff --git a/apps/web/app/api/settings/workspace/domain/route.ts b/apps/web/app/api/settings/workspace/domain/route.ts
index bd6e8f712..a666e601d 100644
--- a/apps/web/app/api/settings/workspace/domain/route.ts
+++ b/apps/web/app/api/settings/workspace/domain/route.ts
@@ -1,6 +1,6 @@
export const dynamic = "force-dynamic";
export const revalidate = 0;
-export const fetchCache = 'force-no-store'
+export const fetchCache = "force-no-store";
import { type NextRequest } from "next/server";
import { getCurrentUser } from "@cap/database/auth/session";
@@ -11,15 +11,17 @@ import { eq } from "drizzle-orm";
const getConfigResponse = async (domain: string) => {
console.log(`[Domain Config] Fetching config for domain: ${domain}`);
const response = await fetch(
- `https://api.vercel.com/v6/domains/${domain.toLowerCase()}/config?teamId=${process.env.VERCEL_TEAM_ID}&strict=true`,
+ `https://api.vercel.com/v6/domains/${domain.toLowerCase()}/config?teamId=${
+ process.env.VERCEL_TEAM_ID
+ }&strict=true`,
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.VERCEL_AUTH_TOKEN}`,
"Content-Type": "application/json",
},
- cache: "no-store"
- },
+ cache: "no-store",
+ }
).then((res) => res.json());
console.log(`[Domain Config] Response:`, response);
return response;
@@ -28,15 +30,17 @@ const getConfigResponse = async (domain: string) => {
const getDomainResponse = async (domain: string) => {
console.log(`[Domain Status] Checking status for domain: ${domain}`);
const response = await fetch(
- `https://api.vercel.com/v9/projects/${process.env.VERCEL_PROJECT_ID}/domains/${domain.toLowerCase()}?teamId=${process.env.VERCEL_TEAM_ID}`,
+ `https://api.vercel.com/v9/projects/${
+ process.env.VERCEL_PROJECT_ID
+ }/domains/${domain.toLowerCase()}?teamId=${process.env.VERCEL_TEAM_ID}`,
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.VERCEL_AUTH_TOKEN}`,
"Content-Type": "application/json",
},
- cache: "no-store"
- },
+ cache: "no-store",
+ }
).then((res) => res.json());
console.log(`[Domain Status] Response:`, response);
return response;
@@ -45,14 +49,18 @@ const getDomainResponse = async (domain: string) => {
const verifyDomain = async (domain: string) => {
console.log(`[Domain Verify] Verifying domain: ${domain}`);
const response = await fetch(
- `https://api.vercel.com/v9/projects/${process.env.VERCEL_PROJECT_ID}/domains/${domain.toLowerCase()}/verify?teamId=${process.env.VERCEL_TEAM_ID}&strict=true`,
+ `https://api.vercel.com/v9/projects/${
+ process.env.VERCEL_PROJECT_ID
+ }/domains/${domain.toLowerCase()}/verify?teamId=${
+ process.env.VERCEL_TEAM_ID
+ }&strict=true`,
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.VERCEL_AUTH_TOKEN}`,
"Content-Type": "application/json",
},
- },
+ }
).then((res) => res.json());
console.log(`[Domain Verify] Response:`, response);
return response;
@@ -63,66 +71,72 @@ const addDomain = async (domain: string) => {
const response = await fetch(
`https://api.vercel.com/v9/projects/${process.env.VERCEL_PROJECT_ID}/domains?teamId=${process.env.VERCEL_TEAM_ID}`,
{
- method: 'POST',
+ method: "POST",
headers: {
Authorization: `Bearer ${process.env.VERCEL_AUTH_TOKEN}`,
- 'Content-Type': 'application/json',
+ "Content-Type": "application/json",
},
body: JSON.stringify({ name: domain }),
- cache: "no-store"
- },
+ cache: "no-store",
+ }
).then((res) => res.json());
console.log(`[Domain Add] Response:`, response);
return response;
};
const getRequiredConfig = async (domain: string) => {
- console.log(`[Required Config] Fetching required config for domain: ${domain}`);
-
+ console.log(
+ `[Required Config] Fetching required config for domain: ${domain}`
+ );
+
// First try to get the records directly
try {
const recordsResponse = await fetch(
- `https://api.vercel.com/v4/domains/${domain.toLowerCase()}/records?limit=10&teamId=${process.env.VERCEL_TEAM_ID}`,
+ `https://api.vercel.com/v4/domains/${domain.toLowerCase()}/records?limit=10&teamId=${
+ process.env.VERCEL_TEAM_ID
+ }`,
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.VERCEL_AUTH_TOKEN}`,
"Content-Type": "application/json",
},
- cache: "no-store"
- },
+ cache: "no-store",
+ }
).then((res) => res.json());
-
+
console.log(`[Required Config] Records Response:`, recordsResponse);
-
+
if (recordsResponse.records) {
- const aRecord = recordsResponse.records.find((record: any) =>
- record.type === 'A' && record.name === ''
+ const aRecord = recordsResponse.records.find(
+ (record: any) => record.type === "A" && record.name === ""
);
-
+
if (aRecord) {
return {
- configuredBy: 'vercel',
+ configuredBy: "vercel",
aValues: [aRecord.value],
- serviceType: 'vercel',
+ serviceType: "vercel",
};
}
}
} catch (error) {
- console.error('[Required Config] Error fetching records:', error);
+ console.error("[Required Config] Error fetching records:", error);
}
// Fallback to the old config endpoint
const response = await fetch(
- `https://api.vercel.com/v6/domains/${domain.toLowerCase()}/config?teamId=${process.env.VERCEL_TEAM_ID}`,
+ `https://api.vercel.com/v6/domains/${domain.toLowerCase()}/config?teamId=${
+ process.env.VERCEL_TEAM_ID
+ }`,
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.VERCEL_AUTH_TOKEN}`,
"Content-Type": "application/json",
},
- cache: "no-store"
- },
+ cache: "no-store",
+ }
).then((res) => res.json());
console.log(`[Required Config] Fallback Response:`, response);
@@ -136,12 +150,14 @@ const getRequiredConfig = async (domain: string) => {
Authorization: `Bearer ${process.env.VERCEL_AUTH_TOKEN}`,
"Content-Type": "application/json",
},
- cache: "no-store"
- },
+ cache: "no-store",
+ }
).then((res) => res.json());
-
+
if (projectResponse.domains) {
- const projectDomain = projectResponse.domains.find((d: any) => d.name === domain);
+ const projectDomain = projectResponse.domains.find(
+ (d: any) => d.name === domain
+ );
if (projectDomain?.apexValue) {
response.aValues = [projectDomain.apexValue];
}
@@ -181,44 +197,49 @@ async function checkDomainStatus(domain: string) {
...configJson,
verification: domainJson?.verification || [],
currentAValues,
- requiredAValue
+ requiredAValue,
},
- status: domainJson
+ status: domainJson,
};
} catch (error) {
- console.error('[Domain Check] Error checking domain status:', error);
+ console.error("[Domain Check] Error checking domain status:", error);
return {
verified: false,
- error: "Failed to check domain status"
+ error: "Failed to check domain status",
};
}
}
export async function POST(request: NextRequest) {
- console.log('[POST] Processing domain addition request');
+ console.log("[POST] Processing domain addition request");
const user = await getCurrentUser();
const { domain, spaceId } = await request.json();
- console.log(`[POST] Request details - Domain: ${domain}, SpaceId: ${spaceId}`);
+ console.log(
+ `[POST] Request details - Domain: ${domain}, SpaceId: ${spaceId}`
+ );
if (!user) {
- console.log('[POST] Unauthorized - No user found');
+ console.log("[POST] Unauthorized - No user found");
return Response.json({ error: "Unauthorized" }, { status: 401 });
}
const [space] = await db.select().from(spaces).where(eq(spaces.id, spaceId));
if (!space || space.ownerId !== user.id) {
- console.log('[POST] Unauthorized - Invalid space or ownership');
+ console.log("[POST] Unauthorized - Invalid space or ownership");
return Response.json({ error: "Unauthorized" }, { status: 403 });
}
try {
console.log(`[POST] Adding domain to Vercel: ${domain}`);
const addDomainResponse = await addDomain(domain);
-
+
if (addDomainResponse.error) {
- console.error('[POST] Error adding domain:', addDomainResponse.error);
- return Response.json({ error: addDomainResponse.error.message }, { status: 400 });
+ console.error("[POST] Error adding domain:", addDomainResponse.error);
+ return Response.json(
+ { error: addDomainResponse.error.message },
+ { status: 400 }
+ );
}
console.log(`[POST] Updating space with custom domain: ${domain}`);
@@ -230,11 +251,13 @@ export async function POST(request: NextRequest) {
})
.where(eq(spaces.id, spaceId));
- console.log('[POST] Checking domain verification status');
+ console.log("[POST] Checking domain verification status");
const status = await checkDomainStatus(domain);
if (status.verified) {
- console.log(`[POST] Domain verified, updating verification timestamp: ${domain}`);
+ console.log(
+ `[POST] Domain verified, updating verification timestamp: ${domain}`
+ );
await db
.update(spaces)
.set({
@@ -245,39 +268,42 @@ export async function POST(request: NextRequest) {
return Response.json(status);
} catch (error) {
- console.error('[POST] Error in domain verification:', error);
- return Response.json(
- { error: "Failed to verify domain" },
- { status: 500 }
- );
+ console.error("[POST] Error in domain verification:", error);
+ return Response.json({ error: "Failed to verify domain" }, { status: 500 });
}
}
export async function DELETE(request: NextRequest) {
- console.log('[DELETE] Processing domain removal request');
+ console.log("[DELETE] Processing domain removal request");
const user = await getCurrentUser();
const { spaceId } = await request.json();
console.log(`[DELETE] Request details - SpaceId: ${spaceId}`);
if (!user) {
- console.log('[DELETE] Unauthorized - No user found');
+ console.log("[DELETE] Unauthorized - No user found");
return Response.json({ error: "Unauthorized" }, { status: 401 });
}
const [space] = await db.select().from(spaces).where(eq(spaces.id, spaceId));
if (!space || space.ownerId !== user.id) {
- console.log('[DELETE] Unauthorized - Invalid space or ownership');
+ console.log("[DELETE] Unauthorized - Invalid space or ownership");
return Response.json({ error: "Unauthorized" }, { status: 403 });
}
try {
if (space.customDomain) {
- console.log(`[DELETE] Removing domain from Vercel: ${space.customDomain}`);
+ console.log(
+ `[DELETE] Removing domain from Vercel: ${space.customDomain}`
+ );
await fetch(
- `https://api.vercel.com/v9/projects/${process.env.VERCEL_PROJECT_ID}/domains/${space.customDomain.toLowerCase()}?teamId=${process.env.VERCEL_TEAM_ID}`,
+ `https://api.vercel.com/v9/projects/${
+ process.env.VERCEL_PROJECT_ID
+ }/domains/${space.customDomain.toLowerCase()}?teamId=${
+ process.env.VERCEL_TEAM_ID
+ }`,
{
- method: 'DELETE',
+ method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.VERCEL_AUTH_TOKEN}`,
},
@@ -285,7 +311,7 @@ export async function DELETE(request: NextRequest) {
);
}
- console.log('[DELETE] Updating space to remove custom domain');
+ console.log("[DELETE] Updating space to remove custom domain");
await db
.update(spaces)
.set({
@@ -296,35 +322,32 @@ export async function DELETE(request: NextRequest) {
return Response.json({ success: true });
} catch (error) {
- console.error('[DELETE] Error removing domain:', error);
- return Response.json(
- { error: "Failed to remove domain" },
- { status: 500 }
- );
+ console.error("[DELETE] Error removing domain:", error);
+ return Response.json({ error: "Failed to remove domain" }, { status: 500 });
}
}
export async function GET(request: NextRequest) {
- console.log('[GET] Processing domain status check request');
+ console.log("[GET] Processing domain status check request");
const searchParams = request.nextUrl.searchParams;
- const spaceId = searchParams.get('spaceId');
+ const spaceId = searchParams.get("spaceId");
console.log(`[GET] Request details - SpaceId: ${spaceId}`);
const user = await getCurrentUser();
if (!user || !spaceId) {
- console.log('[GET] Unauthorized - No user or spaceId found');
+ console.log("[GET] Unauthorized - No user or spaceId found");
return Response.json({ error: "Unauthorized" }, { status: 401 });
}
const [space] = await db.select().from(spaces).where(eq(spaces.id, spaceId));
if (!space || space.ownerId !== user.id) {
- console.log('[GET] Unauthorized - Invalid space or ownership');
+ console.log("[GET] Unauthorized - Invalid space or ownership");
return Response.json({ error: "Unauthorized" }, { status: 403 });
}
if (!space.customDomain) {
- console.log('[GET] No custom domain set for space');
+ console.log("[GET] No custom domain set for space");
return Response.json({ error: "No custom domain set" }, { status: 400 });
}
@@ -333,7 +356,9 @@ export async function GET(request: NextRequest) {
const status = await checkDomainStatus(space.customDomain);
if (status.verified && !space.domainVerified) {
- console.log(`[GET] Updating domain verification timestamp: ${space.customDomain}`);
+ console.log(
+ `[GET] Updating domain verification timestamp: ${space.customDomain}`
+ );
await db
.update(spaces)
.set({
@@ -341,7 +366,9 @@ export async function GET(request: NextRequest) {
})
.where(eq(spaces.id, spaceId));
} else if (!status.verified && space.domainVerified) {
- console.log(`[GET] Removing domain verification timestamp: ${space.customDomain}`);
+ console.log(
+ `[GET] Removing domain verification timestamp: ${space.customDomain}`
+ );
await db
.update(spaces)
.set({
@@ -352,10 +379,10 @@ export async function GET(request: NextRequest) {
return Response.json(status);
} catch (error) {
- console.error('[GET] Error checking domain status:', error);
+ console.error("[GET] Error checking domain status:", error);
return Response.json(
{ error: "Failed to check domain status" },
{ status: 500 }
);
}
-}
\ No newline at end of file
+}
diff --git a/apps/web/app/api/video/comment/route.ts b/apps/web/app/api/video/comment/route.ts
index e14d5e995..3e5cc81ee 100644
--- a/apps/web/app/api/video/comment/route.ts
+++ b/apps/web/app/api/video/comment/route.ts
@@ -50,7 +50,10 @@ async function handlePost(request: NextRequest) {
if (type === "text" && userId !== "anonymous") {
try {
// Don't await this to avoid blocking the response
- const absoluteUrl = new URL("/api/email/new-comment", clientEnv.NEXT_PUBLIC_WEB_URL).toString();
+ const absoluteUrl = new URL(
+ "/api/email/new-comment",
+ clientEnv.NEXT_PUBLIC_WEB_URL
+ ).toString();
fetch(absoluteUrl, {
method: "POST",
headers: {
diff --git a/apps/web/app/api/video/domain-info/route.ts b/apps/web/app/api/video/domain-info/route.ts
index f63649fa5..56c7c2147 100644
--- a/apps/web/app/api/video/domain-info/route.ts
+++ b/apps/web/app/api/video/domain-info/route.ts
@@ -74,7 +74,11 @@ export async function GET(request: NextRequest) {
.where(eq(spaces.ownerId, videoData.ownerId))
.limit(1);
- if (ownerSpaces.length > 0 && ownerSpaces[0] && ownerSpaces[0].customDomain) {
+ if (
+ ownerSpaces.length > 0 &&
+ ownerSpaces[0] &&
+ ownerSpaces[0].customDomain
+ ) {
return Response.json({
customDomain: ownerSpaces[0].customDomain,
domainVerified: ownerSpaces[0].domainVerified || false,
@@ -90,4 +94,4 @@ export async function GET(request: NextRequest) {
console.error("Error fetching domain info:", error);
return Response.json({ error: "Internal server error" }, { status: 500 });
}
-}
\ No newline at end of file
+}
diff --git a/apps/web/app/download/[platform]/route.ts b/apps/web/app/download/[platform]/route.ts
index 8588cc844..850f60c2a 100644
--- a/apps/web/app/download/[platform]/route.ts
+++ b/apps/web/app/download/[platform]/route.ts
@@ -13,14 +13,21 @@ export async function GET(
// Define download URLs for different platforms
const downloadUrls: Record<string, string> = {
- "apple-intel": "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-x86_64",
- intel: "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-x86_64", // Keep for backward compatibility
+ "apple-intel":
+ "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-x86_64",
+ intel:
+ "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-x86_64", // Keep for backward compatibility
mac: "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-aarch64", // Default to Apple Silicon
- macos: "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-aarch64", // Default to Apple Silicon
- "apple-silicon": "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-aarch64",
- aarch64: "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-aarch64",
- x86_64: "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-x86_64",
- windows: "https://cdn.crabnebula.app/download/cap/cap/latest/platform/nsis-x86_64",
+ macos:
+ "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-aarch64", // Default to Apple Silicon
+ "apple-silicon":
+ "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-aarch64",
+ aarch64:
+ "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-aarch64",
+ x86_64:
+ "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-x86_64",
+ windows:
+ "https://cdn.crabnebula.app/download/cap/cap/latest/platform/nsis-x86_64",
win: "https://cdn.crabnebula.app/download/cap/cap/latest/platform/nsis-x86_64",
};
@@ -34,4 +41,4 @@ export async function GET(
// Redirect to the appropriate download URL
return NextResponse.redirect(downloadUrl);
-}
\ No newline at end of file
+}
diff --git a/apps/web/app/s/[videoId]/_components/ShareVideo.tsx b/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
index f0e1b4534..ebcc5c6a5 100644
--- a/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
+++ b/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
@@ -737,7 +737,10 @@ export const ShareVideo = forwardRef<
setSeeking(true);
};
- const handleSeekMouseUp = (event: React.MouseEvent | React.TouchEvent, isTouch = false) => {
+ const handleSeekMouseUp = (
+ event: React.MouseEvent | React.TouchEvent,
+ isTouch = false
+ ) => {
if (!seeking) return;
setSeeking(false);
const seekBar = event.currentTarget;
@@ -1249,8 +1252,11 @@ export const ShareVideo = forwardRef<
style={{ width: `${watchedPercentage}%` }}
/>
<div
- className={clsx("drag-button absolute top-2.5 z-20 -mt-1.5 -ml-2 w-4 h-4 bg-white rounded-full cursor-pointer focus:outline-none",
- seeking ? "scale-125 transition-transform ring-blue-300 ring-offset-2 ring-2" : ""
+ className={clsx(
+ "drag-button absolute top-2.5 z-20 -mt-1.5 -ml-2 w-4 h-4 bg-white rounded-full cursor-pointer focus:outline-none",
+ seeking
+ ? "scale-125 transition-transform ring-blue-300 ring-offset-2 ring-2"
+ : ""
)}
tabIndex={0}
style={{ left: `${watchedPercentage}%` }}
diff --git a/apps/web/app/utils/analytics.ts b/apps/web/app/utils/analytics.ts
index 19c752663..fa368786c 100644
--- a/apps/web/app/utils/analytics.ts
+++ b/apps/web/app/utils/analytics.ts
@@ -23,6 +23,9 @@ export function identifyUser(userId: string, properties?: Record<string, any>) {
}
}
-export function trackEvent(eventName: string, properties?: Record<string, any>) {
+export function trackEvent(
+ eventName: string,
+ properties?: Record<string, any>
+) {
posthog.capture(eventName, { ...properties, platform: "web" });
-}
\ No newline at end of file
+}
diff --git a/apps/web/components/pages/HomePage/HeaderBg.tsx b/apps/web/components/pages/HomePage/HeaderBg.tsx
index 9cae3eaa8..21723bfc3 100644
--- a/apps/web/components/pages/HomePage/HeaderBg.tsx
+++ b/apps/web/components/pages/HomePage/HeaderBg.tsx
@@ -1,7 +1,7 @@
const HeaderBg = () => {
return (
<svg
- className="absolute top-0 left-0 pointer-events-none z-[10]"
+ className="absolute top-0 left-0 pointer-events-none z-[10]"
width="1440"
height="690"
viewBox="0 0 1440 690"
diff --git a/apps/web/components/pages/HomePage/LeftBlueHue.tsx b/apps/web/components/pages/HomePage/LeftBlueHue.tsx
index 8f907e7af..3380d2a5d 100644
--- a/apps/web/components/pages/HomePage/LeftBlueHue.tsx
+++ b/apps/web/components/pages/HomePage/LeftBlueHue.tsx
@@ -1,8 +1,8 @@
"use client";
const LeftBlueHue = () => {
- return (
- <svg
+ return (
+ <svg
className="absolute top-10 -left-24 z-0 opacity-20 pointer-events-none md:opacity-100"
width="1276"
height="690"
@@ -31,7 +31,12 @@ const LeftBlueHue = () => {
colorInterpolationFilters="sRGB"
>
<feFlood floodOpacity="0" result="BackgroundImageFix" />
- <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
+ <feBlend
+ mode="normal"
+ in="SourceGraphic"
+ in2="BackgroundImageFix"
+ result="shape"
+ />
<feGaussianBlur stdDeviation="50" result="blur-effect" />
</filter>
<linearGradient
@@ -49,4 +54,4 @@ const LeftBlueHue = () => {
</svg>
);
};
- export default LeftBlueHue;
\ No newline at end of file
+export default LeftBlueHue;
diff --git a/apps/web/components/pages/HomePage/LeftLight.tsx b/apps/web/components/pages/HomePage/LeftLight.tsx
index 316956d4a..10b9d74b7 100644
--- a/apps/web/components/pages/HomePage/LeftLight.tsx
+++ b/apps/web/components/pages/HomePage/LeftLight.tsx
@@ -13,9 +13,7 @@ const LeftLight = () => {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
- <g
- filter="url(#filter0_f_459_2098)"
- >
+ <g filter="url(#filter0_f_459_2098)">
<ellipse
cx="293"
cy="147"
@@ -63,4 +61,4 @@ const LeftLight = () => {
);
};
-export default LeftLight;
\ No newline at end of file
+export default LeftLight;
diff --git a/apps/web/components/pages/HomePage/PowerfulFeaturesSVG.tsx b/apps/web/components/pages/HomePage/PowerfulFeaturesSVG.tsx
index 3faf38738..685820bb5 100644
--- a/apps/web/components/pages/HomePage/PowerfulFeaturesSVG.tsx
+++ b/apps/web/components/pages/HomePage/PowerfulFeaturesSVG.tsx
@@ -1,19 +1,19 @@
"use client";
const PowerfulFeaturesSVG = () => {
- return (
- <svg
- className="w-[190px] h-auto mx-auto"
- xmlns="http://www.w3.org/2000/svg"
- fill="none"
- viewBox="0 0 191 23"
- >
- <path
- fill="#8991A3"
- d="M7.34 21.488a1.025 1.025 0 01-.32.64c-.193.214-.406.31-.64.288-.363-.021-.64-.16-.833-.416-.192-.256-.288-.47-.288-.64 0-.81-.021-1.653-.064-2.528-.042-.896-.096-1.813-.16-2.752a1.534 1.534 0 01-.768-.064.895.895 0 01-.448-.48c-.149-.362-.128-.682.064-.96.192-.277.502-.544.928-.8a640.19 640.19 0 00-.32-2.336 63.943 63.943 0 00-.288-2.24.646.646 0 01.032-.352c.043-.106.096-.202.16-.288.064-.106.182-.202.352-.288.278-.106.587-.021.928.256.363.278.608.63.736 1.056.064.406.128.875.192 1.408.086.512.16 1.078.224 1.696a10.95 10.95 0 001.248-.896c.406-.32.747-.661 1.024-1.024.299-.362.523-.736.672-1.12.15-.405.192-.821.128-1.248a1.594 1.594 0 00-.48-.96c-.277-.298-.714-.458-1.312-.48a6.754 6.754 0 00-1.6.128c-.512.107-1.024.246-1.536.416-.49.17-.981.374-1.472.608-.469.235-.928.47-1.376.704a1.56 1.56 0 01-.896.224C.95 8.998.77 8.89.683 8.72c-.192-.426-.181-.81.032-1.152.235-.341.587-.661 1.056-.96.406-.234.886-.47 1.44-.704.576-.256 1.174-.47 1.792-.64.64-.192 1.28-.32 1.92-.384a6.189 6.189 0 011.888.032c.598.086 1.131.288 1.6.608.491.299.886.747 1.184 1.344.363.982.459 1.888.288 2.72-.149.81-.469 1.558-.96 2.24a8.856 8.856 0 01-1.76 1.824 21.394 21.394 0 01-2.08 1.44c.107 1.152.182 2.294.224 3.424.043 1.13.054 2.123.032 2.976zM20.838 6.832c.64.235 1.173.587 1.6 1.056.448.47.79 1.003 1.024 1.6.235.576.363 1.174.384 1.792a4.587 4.587 0 01-.192 1.728 10.521 10.521 0 01-.896 1.76 8.01 8.01 0 01-1.248 1.536c-.47.448-1.003.81-1.6 1.088a4.654 4.654 0 01-1.984.416c-.875 0-1.61-.202-2.208-.608a4.33 4.33 0 01-1.408-1.568c-.341-.64-.565-1.365-.672-2.176a9.292 9.292 0 01.064-2.432 9.287 9.287 0 01.416-1.728c.213-.576.48-1.077.8-1.504a4.39 4.39 0 011.088-1.088 2.585 2.585 0 011.44-.416c.299 0 .672.064 1.12.192.448.107.864.267 1.248.48.277-.256.619-.298 1.024-.128zm-1.216 2.336c-.235-.15-.512-.341-.832-.576-.299-.256-.565-.384-.8-.384-.256 0-.512.118-.768.352a4.293 4.293 0 00-.64.832 7.44 7.44 0 00-.448.928c-.128.32-.213.576-.256.768a7.89 7.89 0 00-.128 1.152c-.021.448.01.896.096 1.344.085.427.245.822.48 1.184.256.342.63.587 1.12.736.299.086.65.086 1.056 0 .405-.106.8-.288 1.184-.544a4.565 4.565 0 001.12-1.024c.363-.426.64-.917.832-1.472.213-.618.213-1.258 0-1.92-.192-.682-.597-1.173-1.216-1.472a.767.767 0 01-.448.16.798.798 0 01-.352-.064zM37.167 17.264c-.17.235-.362.395-.575.48a2.027 2.027 0 01-.576.096 1.697 1.697 0 01-.832-.288c-.256-.192-.416-.384-.48-.576a74.585 74.585 0 01-.416-1.216c-.15-.448-.3-.896-.448-1.344-.129-.47-.267-.917-.417-1.344a73.32 73.32 0 00-.416-1.216 46.456 46.456 0 00-1.215 2.272c-.385.747-.811 1.526-1.28 2.336-.214.32-.46.544-.736.672-.278.107-.512.15-.704.128a1.359 1.359 0 01-.768-.32 3.908 3.908 0 01-.512-.544 9.595 9.595 0 01-.705-1.472 40.47 40.47 0 01-.671-1.92 96.957 96.957 0 01-.544-2.016c-.171-.682-.31-1.29-.416-1.824a2.752 2.752 0 010-1.024c.085-.32.277-.501.576-.544.362-.021.693.107.991.384.3.256.47.512.512.768.086.427.182.896.288 1.408.128.49.256.992.384 1.504.15.512.288 1.014.416 1.504.15.49.3.928.448 1.312.32-.512.672-1.098 1.056-1.76.406-.682.79-1.333 1.152-1.952.363-.64.694-1.194.993-1.664.298-.47.533-.757.703-.864.128-.085.31-.074.544.032.235.086.406.214.513.384.469.939.853 1.974 1.152 3.104.32 1.11.629 2.144.928 3.104.298-.384.618-.885.96-1.504.34-.64.671-1.312.991-2.016.32-.704.62-1.408.896-2.112a26.38 26.38 0 00.672-1.888c.171-.576.406-.853.705-.832.383.043.714.17.992.384.277.214.383.438.32.672-.47 1.878-1.078 3.606-1.825 5.184a31.225 31.225 0 01-2.656 4.512zM51.067 10.48c-.832.49-1.728.875-2.688 1.152-.96.256-1.995.384-3.104.384.043.747.256 1.344.64 1.792.384.427.864.683 1.44.768.341.043.683.032 1.024-.032.363-.064.693-.16.992-.288.32-.15.608-.31.864-.48.256-.17.48-.341.672-.512.192-.17.395-.277.608-.32.213-.064.373-.074.48-.032.299.107.405.427.32.96a5.048 5.048 0 01-1.472 1.76c-.64.47-1.355.768-2.144.896a4.747 4.747 0 01-2.112-.096 4.413 4.413 0 01-1.952-1.12 4.933 4.933 0 01-1.12-1.728 7.537 7.537 0 01-.48-2.048 5.045 5.045 0 01.16-1.888c.192-.597.48-1.12.864-1.568.384-.47.864-.853 1.44-1.152.576-.298 1.248-.47 2.016-.512.917-.064 1.75.107 2.496.512.747.406 1.27.97 1.568 1.696.17.406.213.758.128 1.056-.064.299-.277.566-.64.8zm-3.68-2.176a3.78 3.78 0 00-.704.224 3.182 3.182 0 00-.672.416c-.192.15-.373.33-.544.544-.15.192-.235.416-.256.672a8.02 8.02 0 001.184-.096c.448-.064.875-.138 1.28-.224.427-.106.81-.224 1.152-.352.363-.128.661-.266.896-.416-.17-.405-.49-.65-.96-.736a3.317 3.317 0 00-1.376-.032zM63.47 6.96c-.384.214-.79.438-1.216.672a12.68 12.68 0 00-1.248.832c-.406.299-.8.662-1.184 1.088a7.089 7.089 0 00-.992 1.472 8.472 8.472 0 00-.864 2.496c-.15.832-.245 1.654-.288 2.464 0 .384-.096.779-.288 1.184-.17.384-.416.576-.736.576-.406 0-.736-.202-.992-.608a4.63 4.63 0 01-.48-1.216 59.411 59.411 0 01-.896-4.48 111.021 111.021 0 01-.608-4.448c0-.298.085-.49.256-.576.192-.085.405-.117.64-.096.256.022.501.086.736.192.234.107.373.278.416.512.085.79.192 1.622.32 2.496.128.854.256 1.59.384 2.208.085-.725.32-1.43.704-2.112a8.52 8.52 0 011.408-1.856 8.898 8.898 0 011.92-1.408 7.365 7.365 0 012.208-.768c.32-.042.587-.042.8 0 .213.043.363.118.448.224.085.107.096.278.032.512-.043.235-.203.448-.48.64zM65.882 12.176c-.299.043-.65.01-1.056-.096-.384-.106-.65-.373-.8-.8a1.19 1.19 0 01-.032-.608c.042-.213.266-.362.672-.448.384-.085.79-.16 1.216-.224.448-.085.896-.16 1.344-.224l-1.184-3.584c-.363-1.365-.406-2.538-.128-3.52C66.19 1.691 66.98.987 68.282.56A4.014 4.014 0 0169.85.368a4.054 4.054 0 011.504.416c.47.235.896.544 1.28.928s.693.832.928 1.344c.085.235.128.448.128.64.021.17-.043.33-.192.48-.214.214-.448.31-.704.288-.256-.042-.427-.117-.512-.224a9.551 9.551 0 00-.64-.704 3.3 3.3 0 00-.704-.64 2.25 2.25 0 00-.768-.416 1.797 1.797 0 00-.896-.096c-.15.022-.33.096-.544.224-.192.128-.363.33-.512.608-.15.256-.246.598-.288 1.024-.022.427.053.96.224 1.6a64.75 64.75 0 001.152 3.68 18.436 18.436 0 012.816-.096c.47.043.906.128 1.312.256.405.128.736.32.992.576.064.214.053.395-.032.544a1.241 1.241 0 01-.384.352c-.15.086-.33.15-.544.192a5.44 5.44 0 01-.576.096c-.427.043-.875.096-1.344.16-.47.043-.96.086-1.472.128.341.96.65 1.878.928 2.752.299.854.533 1.568.704 2.144.085.32.096.662.032 1.024a8.49 8.49 0 01-.256 1.056c-.17.49-.384.886-.64 1.184-.256.299-.534.395-.832.288-.235-.106-.384-.245-.448-.416-.064-.17-.075-.405-.032-.704.043-.341.064-.682.064-1.024 0-.341-.021-.65-.064-.928a3.589 3.589 0 00-.128-.768 9.095 9.095 0 00-.096-.48l-1.344-3.904-1.024.128c-.342.022-.694.054-1.056.096zM78.749 8.528a50.786 50.786 0 00-.384 1.92 23.417 23.417 0 00-.288 1.984c-.043.64-.043 1.216 0 1.728.064.512.203.875.416 1.088.363.064.779-.085 1.248-.448a8.94 8.94 0 001.376-1.44c.448-.576.853-1.194 1.216-1.856.362-.682.618-1.28.768-1.792.085-.256.16-.522.224-.8a3.83 3.83 0 00.096-.864c0-.17.106-.33.32-.48.234-.17.427-.266.576-.288a.545.545 0 01.352.064c.15.064.277.16.384.288.128.107.234.246.32.416.106.15.16.31.16.48.043.64.106 1.344.192 2.112.085.768.181 1.536.288 2.304.128.768.256 1.515.384 2.24.128.726.256 1.376.384 1.952.064.235 0 .502-.192.8-.192.299-.406.48-.64.544a1.019 1.019 0 01-.608-.064c-.192-.085-.341-.256-.448-.512a11.808 11.808 0 01-.32-1.088c-.085-.448-.17-.906-.256-1.376a72.55 72.55 0 00-.192-1.376 16.47 16.47 0 01-.128-1.12c-.32.576-.704 1.163-1.152 1.76a12.6 12.6 0 01-1.408 1.6c-.49.47-1.013.843-1.568 1.12a3.007 3.007 0 01-1.664.288c-.853-.106-1.504-.906-1.952-2.4a7.208 7.208 0 01-.256-1.984c.021-.725.075-1.44.16-2.144.106-.725.224-1.408.352-2.048.15-.64.277-1.162.384-1.568a.95.95 0 01.256-.448c.128-.15.277-.202.448-.16.32.064.608.256.864.576.277.32.373.65.288.992zM91.17 3.024c.106 2.326.288 4.736.544 7.232.256 2.475.533 4.843.832 7.104.064.939-.192 1.419-.768 1.44a.688.688 0 01-.384-.128 2.04 2.04 0 01-.352-.384 9.43 9.43 0 01-.32-.48 1.636 1.636 0 01-.16-.448c-.17-1.088-.33-2.24-.48-3.456a212.34 212.34 0 01-.416-3.648 269.893 269.893 0 01-.288-3.616 64.009 64.009 0 01-.16-3.232c.042-.512.117-.938.224-1.28.107-.362.33-.533.672-.512.362.022.618.17.768.448.17.256.266.576.288.96zM103.978 12.176c-.299.043-.651.01-1.056-.096-.384-.106-.651-.373-.8-.8a1.187 1.187 0 01-.032-.608c.043-.213.267-.362.672-.448.384-.085.789-.16 1.216-.224.448-.085.896-.16 1.344-.224l-1.184-3.584c-.363-1.365-.405-2.538-.128-3.52.277-.981 1.067-1.685 2.368-2.112a4.014 4.014 0 011.568-.192 4.054 4.054 0 011.504.416 4.91 4.91 0 011.28.928c.384.384.693.832.928 1.344a1.9 1.9 0 01.128.64c.021.17-.043.33-.192.48-.213.214-.448.31-.704.288-.256-.042-.427-.117-.512-.224a9.484 9.484 0 00-.64-.704 3.293 3.293 0 00-.704-.64 2.256 2.256 0 00-.768-.416 1.796 1.796 0 00-.896-.096c-.149.022-.331.096-.544.224-.192.128-.363.33-.512.608-.149.256-.245.598-.288 1.024-.021.427.053.96.224 1.6a67.191 67.191 0 001.152 3.68 18.437 18.437 0 012.816-.096c.469.043.907.128 1.312.256s.736.32.992.576c.064.214.053.395-.032.544a1.233 1.233 0 01-.384.352 1.81 1.81 0 01-.544.192 5.44 5.44 0 01-.576.096c-.427.043-.875.096-1.344.16-.469.043-.96.086-1.472.128.341.96.651 1.878.928 2.752.299.854.533 1.568.704 2.144.085.32.096.662.032 1.024a8.42 8.42 0 01-.256 1.056c-.171.49-.384.886-.64 1.184-.256.299-.533.395-.832.288-.235-.106-.384-.245-.448-.416-.064-.17-.075-.405-.032-.704.043-.341.064-.682.064-1.024 0-.341-.021-.65-.064-.928a3.57 3.57 0 00-.128-.768 9.786 9.786 0 00-.096-.48l-1.344-3.904-1.024.128c-.341.022-.693.054-1.056.096zM121.837 10.48c-.832.49-1.728.875-2.688 1.152-.96.256-1.995.384-3.104.384.043.747.256 1.344.64 1.792.384.427.864.683 1.44.768.341.043.683.032 1.024-.032.363-.064.693-.16.992-.288.32-.15.608-.31.864-.48.256-.17.48-.341.672-.512.192-.17.395-.277.608-.32.213-.064.373-.074.48-.032.299.107.405.427.32.96a5.044 5.044 0 01-1.472 1.76c-.64.47-1.355.768-2.144.896a4.747 4.747 0 01-2.112-.096 4.415 4.415 0 01-1.952-1.12 4.928 4.928 0 01-1.12-1.728 7.537 7.537 0 01-.48-2.048 5.039 5.039 0 01.16-1.888c.192-.597.48-1.12.864-1.568.384-.47.864-.853 1.44-1.152.576-.298 1.248-.47 2.016-.512.917-.064 1.749.107 2.496.512.747.406 1.269.97 1.568 1.696.171.406.213.758.128 1.056-.064.299-.277.566-.64.8zm-3.68-2.176a3.789 3.789 0 00-.704.224 3.167 3.167 0 00-.672.416 3.29 3.29 0 00-.544.544 1.237 1.237 0 00-.256.672 8.02 8.02 0 001.184-.096c.448-.064.875-.138 1.28-.224.427-.106.811-.224 1.152-.352.363-.128.661-.266.896-.416-.171-.405-.491-.65-.96-.736a3.317 3.317 0 00-1.376-.032zM132.672 6.16c.085.598.149 1.238.192 1.92.064.662.106 1.334.128 2.016.042.683.064 1.344.064 1.984 0 .64-.011 1.216-.032 1.728.682.47 1.088.886 1.216 1.248.149.363.17.683.064.96-.128.384-.363.587-.704.608-.32 0-.694-.117-1.12-.352-.299.214-.64.448-1.024.704-.384.235-.79.47-1.216.704-.427.214-.854.406-1.28.576-.427.17-.822.288-1.184.352-.683.107-1.302-.021-1.856-.384-.534-.362-.896-.906-1.088-1.632a3.96 3.96 0 01-.096-1.504 4.143 4.143 0 01.48-1.504c.256-.49.597-.928 1.024-1.312.448-.384.97-.682 1.568-.896a2.72 2.72 0 01.608-.16c.277-.042.554-.053.832-.032.298 0 .597.054.896.16.298.107.576.288.832.544 0-.362-.011-.757-.032-1.184 0-.448-.011-.896-.032-1.344a20.991 20.991 0 00-.096-1.248 10.98 10.98 0 00-.096-1.024c-.043-.32-.171-.512-.384-.576-.192-.085-.438-.074-.736.032-.512.17-1.11.502-1.792.992a23.08 23.08 0 00-1.952 1.568.817.817 0 01-.672.256.957.957 0 01-.608-.288.93.93 0 01-.288-.576c-.022-.234.064-.48.256-.736.362-.384.768-.778 1.216-1.184.448-.405.917-.768 1.408-1.088.49-.341.992-.618 1.504-.832a4.456 4.456 0 011.536-.352c.746-.021 1.322.15 1.728.512.405.342.65.79.736 1.344zm-3.712 6.88c-.278.064-.576.203-.896.416a3.812 3.812 0 00-.832.736 3.027 3.027 0 00-.544.96 1.673 1.673 0 000 1.024.483.483 0 00.256.288.735.735 0 00.48.032c.512-.106 1.088-.31 1.728-.608.661-.32 1.184-.661 1.568-1.024 0-.128-.064-.288-.192-.48a4.097 4.097 0 00-.448-.608 2.787 2.787 0 00-.576-.544c-.192-.15-.374-.213-.544-.192zM142.796 9.424c.405-.021.81.075 1.216.288.405.214.608.544.608.992-.043.363-.246.598-.608.704a3.606 3.606 0 01-.832.128c-.427 0-.886.01-1.376.032-.491.022-.992.054-1.504.096-.043.704-.086 1.366-.128 1.984-.022.619-.043 1.174-.064 1.664-.022.47-.032.854-.032 1.152 0 .299.01.459.032.48a9.5 9.5 0 001.504-.416 38.153 38.153 0 001.632-.672 57.758 57.758 0 001.6-.768c.533-.277 1.034-.533 1.504-.768.213-.106.405-.138.576-.096.192.043.309.139.352.288.042.235.01.523-.096.864-.107.342-.299.65-.576.928-.32.256-.747.555-1.28.896-.512.32-1.067.63-1.664.928-.598.299-1.206.566-1.824.8-.598.214-1.131.342-1.6.384-.704.064-1.238-.128-1.6-.576-.363-.448-.566-1.013-.608-1.696a27.43 27.43 0 01-.032-2.368c.042-.896.085-1.845.128-2.848l-1.184.128c-.363.022-.715.054-1.056.096-.278 0-.587-.064-.928-.192-.32-.128-.48-.373-.48-.736 0-.128.053-.298.16-.512.106-.213.341-.373.704-.48.874-.15 1.845-.277 2.912-.384.064-1.002.138-1.973.224-2.912.085-.938.16-1.792.224-2.56.021-.256.096-.48.224-.672.128-.192.266-.288.416-.288.362-.021.704.075 1.024.288.341.192.512.416.512.672a97.853 97.853 0 00-.256 2.464c-.064.918-.128 1.856-.192 2.816.426-.042.832-.064 1.216-.064.405-.021.789-.042 1.152-.064zM150.706 8.528a50.786 50.786 0 00-.384 1.92 23.417 23.417 0 00-.288 1.984c-.042.64-.042 1.216 0 1.728.064.512.203.875.416 1.088.363.064.779-.085 1.248-.448a8.91 8.91 0 001.376-1.44 13.85 13.85 0 001.216-1.856c.363-.682.619-1.28.768-1.792.086-.256.16-.522.224-.8a3.83 3.83 0 00.096-.864c0-.17.107-.33.32-.48.235-.17.427-.266.576-.288a.544.544 0 01.352.064c.15.064.278.16.384.288.128.107.235.246.32.416.107.15.16.31.16.48.043.64.107 1.344.192 2.112.086.768.182 1.536.288 2.304.128.768.256 1.515.384 2.24.128.726.256 1.376.384 1.952.064.235 0 .502-.192.8-.192.299-.405.48-.64.544a1.02 1.02 0 01-.608-.064c-.192-.085-.341-.256-.448-.512a12.13 12.13 0 01-.32-1.088c-.085-.448-.17-.906-.256-1.376a72.55 72.55 0 00-.192-1.376 16.932 16.932 0 01-.128-1.12c-.32.576-.704 1.163-1.152 1.76-.426.576-.896 1.11-1.408 1.6-.49.47-1.013.843-1.568 1.12a3.007 3.007 0 01-1.664.288c-.853-.106-1.504-.906-1.952-2.4a7.235 7.235 0 01-.256-1.984c.022-.725.075-1.44.16-2.144.107-.725.224-1.408.352-2.048.15-.64.278-1.162.384-1.568a.952.952 0 01.256-.448c.128-.15.278-.202.448-.16.32.064.608.256.864.576.278.32.374.65.288.992zM170.007 6.96c-.384.214-.789.438-1.216.672-.405.235-.821.512-1.248.832-.405.299-.8.662-1.184 1.088a7.128 7.128 0 00-.992 1.472 8.512 8.512 0 00-.864 2.496 19.97 19.97 0 00-.288 2.464c0 .384-.096.779-.288 1.184-.17.384-.416.576-.736.576-.405 0-.736-.202-.992-.608a4.68 4.68 0 01-.48-1.216 59.913 59.913 0 01-.896-4.48 112.869 112.869 0 01-.608-4.448c0-.298.086-.49.256-.576a1.27 1.27 0 01.64-.096c.256.022.502.086.736.192.235.107.374.278.416.512.086.79.192 1.622.32 2.496.128.854.256 1.59.384 2.208a5.63 5.63 0 01.704-2.112 8.541 8.541 0 011.408-1.856 8.898 8.898 0 011.92-1.408 7.378 7.378 0 012.208-.768c.32-.042.587-.042.8 0 .214.043.363.118.448.224.086.107.096.278.032.512-.042.235-.202.448-.48.64zM179.043 10.48c-.832.49-1.728.875-2.688 1.152-.96.256-1.994.384-3.104.384.043.747.256 1.344.64 1.792.384.427.864.683 1.44.768.342.043.683.032 1.024-.032a4.48 4.48 0 00.992-.288c.32-.15.608-.31.864-.48.256-.17.48-.341.672-.512.192-.17.395-.277.608-.32.214-.064.374-.074.48-.032.299.107.406.427.32.96a5.044 5.044 0 01-1.472 1.76c-.64.47-1.354.768-2.144.896a4.748 4.748 0 01-2.112-.096 4.415 4.415 0 01-1.952-1.12 4.942 4.942 0 01-1.12-1.728 7.537 7.537 0 01-.48-2.048 5.06 5.06 0 01.16-1.888c.192-.597.48-1.12.864-1.568.384-.47.864-.853 1.44-1.152.576-.298 1.248-.47 2.016-.512.918-.064 1.75.107 2.496.512.747.406 1.27.97 1.568 1.696.171.406.214.758.128 1.056-.064.299-.277.566-.64.8zm-3.68-2.176a3.789 3.789 0 00-.704.224 3.217 3.217 0 00-.672.416 3.29 3.29 0 00-.544.544 1.245 1.245 0 00-.256.672 8.01 8.01 0 001.184-.096c.448-.064.875-.138 1.28-.224.427-.106.811-.224 1.152-.352a4.4 4.4 0 00.896-.416c-.17-.405-.49-.65-.96-.736a3.317 3.317 0 00-1.376-.032zM187.862 8.432a39.046 39.046 0 00-.128-.672c-.043-.213-.149-.352-.32-.416a2.328 2.328 0 00-1.152-.032 3.913 3.913 0 00-1.12.416 3.3 3.3 0 00-.864.608c-.235.214-.363.406-.384.576-.064.32.021.63.256.928.235.299.576.598 1.024.896.747.448 1.525.907 2.336 1.376.811.47 1.493.95 2.048 1.44.555.49.928 1.035 1.12 1.632.213.576.171 1.238-.128 1.984-.235.576-.672 1.046-1.312 1.408-.64.363-1.344.65-2.112.864-.768.192-1.536.33-2.304.416-.768.064-1.419.096-1.952.096a1.24 1.24 0 01-.48-.128 7.333 7.333 0 01-.512-.352 7.5 7.5 0 01-.416-.384c-.107-.15-.16-.277-.16-.384 0-.384.171-.65.512-.8.341-.15.693-.224 1.056-.224.512 0 1.056-.021 1.632-.064.597-.064 1.163-.15 1.696-.256a8.155 8.155 0 001.44-.48c.427-.192.725-.437.896-.736.149-.256.053-.554-.288-.896-.32-.362-.757-.736-1.312-1.12a19.213 19.213 0 00-1.76-1.12 32.996 32.996 0 01-1.6-.992 4.962 4.962 0 01-1.152-1.056c-.32-.426-.523-.95-.608-1.568a3.25 3.25 0 01.352-1.6c.256-.512.587-.96.992-1.344a5.01 5.01 0 011.44-.96 3.944 3.944 0 011.6-.352c.917.043 1.675.299 2.272.768.597.448.949 1.12 1.056 2.016 0 .299-.053.544-.16.736-.085.192-.245.31-.48.352-.299.043-.544.01-.736-.096a.676.676 0 01-.288-.48z"
- ></path>
- </svg>
- )
-}
+ return (
+ <svg
+ className="w-[190px] h-auto mx-auto"
+ xmlns="http://www.w3.org/2000/svg"
+ fill="none"
+ viewBox="0 0 191 23"
+ >
+ <path
+ fill="#8991A3"
+ d="M7.34 21.488a1.025 1.025 0 01-.32.64c-.193.214-.406.31-.64.288-.363-.021-.64-.16-.833-.416-.192-.256-.288-.47-.288-.64 0-.81-.021-1.653-.064-2.528-.042-.896-.096-1.813-.16-2.752a1.534 1.534 0 01-.768-.064.895.895 0 01-.448-.48c-.149-.362-.128-.682.064-.96.192-.277.502-.544.928-.8a640.19 640.19 0 00-.32-2.336 63.943 63.943 0 00-.288-2.24.646.646 0 01.032-.352c.043-.106.096-.202.16-.288.064-.106.182-.202.352-.288.278-.106.587-.021.928.256.363.278.608.63.736 1.056.064.406.128.875.192 1.408.086.512.16 1.078.224 1.696a10.95 10.95 0 001.248-.896c.406-.32.747-.661 1.024-1.024.299-.362.523-.736.672-1.12.15-.405.192-.821.128-1.248a1.594 1.594 0 00-.48-.96c-.277-.298-.714-.458-1.312-.48a6.754 6.754 0 00-1.6.128c-.512.107-1.024.246-1.536.416-.49.17-.981.374-1.472.608-.469.235-.928.47-1.376.704a1.56 1.56 0 01-.896.224C.95 8.998.77 8.89.683 8.72c-.192-.426-.181-.81.032-1.152.235-.341.587-.661 1.056-.96.406-.234.886-.47 1.44-.704.576-.256 1.174-.47 1.792-.64.64-.192 1.28-.32 1.92-.384a6.189 6.189 0 011.888.032c.598.086 1.131.288 1.6.608.491.299.886.747 1.184 1.344.363.982.459 1.888.288 2.72-.149.81-.469 1.558-.96 2.24a8.856 8.856 0 01-1.76 1.824 21.394 21.394 0 01-2.08 1.44c.107 1.152.182 2.294.224 3.424.043 1.13.054 2.123.032 2.976zM20.838 6.832c.64.235 1.173.587 1.6 1.056.448.47.79 1.003 1.024 1.6.235.576.363 1.174.384 1.792a4.587 4.587 0 01-.192 1.728 10.521 10.521 0 01-.896 1.76 8.01 8.01 0 01-1.248 1.536c-.47.448-1.003.81-1.6 1.088a4.654 4.654 0 01-1.984.416c-.875 0-1.61-.202-2.208-.608a4.33 4.33 0 01-1.408-1.568c-.341-.64-.565-1.365-.672-2.176a9.292 9.292 0 01.064-2.432 9.287 9.287 0 01.416-1.728c.213-.576.48-1.077.8-1.504a4.39 4.39 0 011.088-1.088 2.585 2.585 0 011.44-.416c.299 0 .672.064 1.12.192.448.107.864.267 1.248.48.277-.256.619-.298 1.024-.128zm-1.216 2.336c-.235-.15-.512-.341-.832-.576-.299-.256-.565-.384-.8-.384-.256 0-.512.118-.768.352a4.293 4.293 0 00-.64.832 7.44 7.44 0 00-.448.928c-.128.32-.213.576-.256.768a7.89 7.89 0 00-.128 1.152c-.021.448.01.896.096 1.344.085.427.245.822.48 1.184.256.342.63.587 1.12.736.299.086.65.086 1.056 0 .405-.106.8-.288 1.184-.544a4.565 4.565 0 001.12-1.024c.363-.426.64-.917.832-1.472.213-.618.213-1.258 0-1.92-.192-.682-.597-1.173-1.216-1.472a.767.767 0 01-.448.16.798.798 0 01-.352-.064zM37.167 17.264c-.17.235-.362.395-.575.48a2.027 2.027 0 01-.576.096 1.697 1.697 0 01-.832-.288c-.256-.192-.416-.384-.48-.576a74.585 74.585 0 01-.416-1.216c-.15-.448-.3-.896-.448-1.344-.129-.47-.267-.917-.417-1.344a73.32 73.32 0 00-.416-1.216 46.456 46.456 0 00-1.215 2.272c-.385.747-.811 1.526-1.28 2.336-.214.32-.46.544-.736.672-.278.107-.512.15-.704.128a1.359 1.359 0 01-.768-.32 3.908 3.908 0 01-.512-.544 9.595 9.595 0 01-.705-1.472 40.47 40.47 0 01-.671-1.92 96.957 96.957 0 01-.544-2.016c-.171-.682-.31-1.29-.416-1.824a2.752 2.752 0 010-1.024c.085-.32.277-.501.576-.544.362-.021.693.107.991.384.3.256.47.512.512.768.086.427.182.896.288 1.408.128.49.256.992.384 1.504.15.512.288 1.014.416 1.504.15.49.3.928.448 1.312.32-.512.672-1.098 1.056-1.76.406-.682.79-1.333 1.152-1.952.363-.64.694-1.194.993-1.664.298-.47.533-.757.703-.864.128-.085.31-.074.544.032.235.086.406.214.513.384.469.939.853 1.974 1.152 3.104.32 1.11.629 2.144.928 3.104.298-.384.618-.885.96-1.504.34-.64.671-1.312.991-2.016.32-.704.62-1.408.896-2.112a26.38 26.38 0 00.672-1.888c.171-.576.406-.853.705-.832.383.043.714.17.992.384.277.214.383.438.32.672-.47 1.878-1.078 3.606-1.825 5.184a31.225 31.225 0 01-2.656 4.512zM51.067 10.48c-.832.49-1.728.875-2.688 1.152-.96.256-1.995.384-3.104.384.043.747.256 1.344.64 1.792.384.427.864.683 1.44.768.341.043.683.032 1.024-.032.363-.064.693-.16.992-.288.32-.15.608-.31.864-.48.256-.17.48-.341.672-.512.192-.17.395-.277.608-.32.213-.064.373-.074.48-.032.299.107.405.427.32.96a5.048 5.048 0 01-1.472 1.76c-.64.47-1.355.768-2.144.896a4.747 4.747 0 01-2.112-.096 4.413 4.413 0 01-1.952-1.12 4.933 4.933 0 01-1.12-1.728 7.537 7.537 0 01-.48-2.048 5.045 5.045 0 01.16-1.888c.192-.597.48-1.12.864-1.568.384-.47.864-.853 1.44-1.152.576-.298 1.248-.47 2.016-.512.917-.064 1.75.107 2.496.512.747.406 1.27.97 1.568 1.696.17.406.213.758.128 1.056-.064.299-.277.566-.64.8zm-3.68-2.176a3.78 3.78 0 00-.704.224 3.182 3.182 0 00-.672.416c-.192.15-.373.33-.544.544-.15.192-.235.416-.256.672a8.02 8.02 0 001.184-.096c.448-.064.875-.138 1.28-.224.427-.106.81-.224 1.152-.352.363-.128.661-.266.896-.416-.17-.405-.49-.65-.96-.736a3.317 3.317 0 00-1.376-.032zM63.47 6.96c-.384.214-.79.438-1.216.672a12.68 12.68 0 00-1.248.832c-.406.299-.8.662-1.184 1.088a7.089 7.089 0 00-.992 1.472 8.472 8.472 0 00-.864 2.496c-.15.832-.245 1.654-.288 2.464 0 .384-.096.779-.288 1.184-.17.384-.416.576-.736.576-.406 0-.736-.202-.992-.608a4.63 4.63 0 01-.48-1.216 59.411 59.411 0 01-.896-4.48 111.021 111.021 0 01-.608-4.448c0-.298.085-.49.256-.576.192-.085.405-.117.64-.096.256.022.501.086.736.192.234.107.373.278.416.512.085.79.192 1.622.32 2.496.128.854.256 1.59.384 2.208.085-.725.32-1.43.704-2.112a8.52 8.52 0 011.408-1.856 8.898 8.898 0 011.92-1.408 7.365 7.365 0 012.208-.768c.32-.042.587-.042.8 0 .213.043.363.118.448.224.085.107.096.278.032.512-.043.235-.203.448-.48.64zM65.882 12.176c-.299.043-.65.01-1.056-.096-.384-.106-.65-.373-.8-.8a1.19 1.19 0 01-.032-.608c.042-.213.266-.362.672-.448.384-.085.79-.16 1.216-.224.448-.085.896-.16 1.344-.224l-1.184-3.584c-.363-1.365-.406-2.538-.128-3.52C66.19 1.691 66.98.987 68.282.56A4.014 4.014 0 0169.85.368a4.054 4.054 0 011.504.416c.47.235.896.544 1.28.928s.693.832.928 1.344c.085.235.128.448.128.64.021.17-.043.33-.192.48-.214.214-.448.31-.704.288-.256-.042-.427-.117-.512-.224a9.551 9.551 0 00-.64-.704 3.3 3.3 0 00-.704-.64 2.25 2.25 0 00-.768-.416 1.797 1.797 0 00-.896-.096c-.15.022-.33.096-.544.224-.192.128-.363.33-.512.608-.15.256-.246.598-.288 1.024-.022.427.053.96.224 1.6a64.75 64.75 0 001.152 3.68 18.436 18.436 0 012.816-.096c.47.043.906.128 1.312.256.405.128.736.32.992.576.064.214.053.395-.032.544a1.241 1.241 0 01-.384.352c-.15.086-.33.15-.544.192a5.44 5.44 0 01-.576.096c-.427.043-.875.096-1.344.16-.47.043-.96.086-1.472.128.341.96.65 1.878.928 2.752.299.854.533 1.568.704 2.144.085.32.096.662.032 1.024a8.49 8.49 0 01-.256 1.056c-.17.49-.384.886-.64 1.184-.256.299-.534.395-.832.288-.235-.106-.384-.245-.448-.416-.064-.17-.075-.405-.032-.704.043-.341.064-.682.064-1.024 0-.341-.021-.65-.064-.928a3.589 3.589 0 00-.128-.768 9.095 9.095 0 00-.096-.48l-1.344-3.904-1.024.128c-.342.022-.694.054-1.056.096zM78.749 8.528a50.786 50.786 0 00-.384 1.92 23.417 23.417 0 00-.288 1.984c-.043.64-.043 1.216 0 1.728.064.512.203.875.416 1.088.363.064.779-.085 1.248-.448a8.94 8.94 0 001.376-1.44c.448-.576.853-1.194 1.216-1.856.362-.682.618-1.28.768-1.792.085-.256.16-.522.224-.8a3.83 3.83 0 00.096-.864c0-.17.106-.33.32-.48.234-.17.427-.266.576-.288a.545.545 0 01.352.064c.15.064.277.16.384.288.128.107.234.246.32.416.106.15.16.31.16.48.043.64.106 1.344.192 2.112.085.768.181 1.536.288 2.304.128.768.256 1.515.384 2.24.128.726.256 1.376.384 1.952.064.235 0 .502-.192.8-.192.299-.406.48-.64.544a1.019 1.019 0 01-.608-.064c-.192-.085-.341-.256-.448-.512a11.808 11.808 0 01-.32-1.088c-.085-.448-.17-.906-.256-1.376a72.55 72.55 0 00-.192-1.376 16.47 16.47 0 01-.128-1.12c-.32.576-.704 1.163-1.152 1.76a12.6 12.6 0 01-1.408 1.6c-.49.47-1.013.843-1.568 1.12a3.007 3.007 0 01-1.664.288c-.853-.106-1.504-.906-1.952-2.4a7.208 7.208 0 01-.256-1.984c.021-.725.075-1.44.16-2.144.106-.725.224-1.408.352-2.048.15-.64.277-1.162.384-1.568a.95.95 0 01.256-.448c.128-.15.277-.202.448-.16.32.064.608.256.864.576.277.32.373.65.288.992zM91.17 3.024c.106 2.326.288 4.736.544 7.232.256 2.475.533 4.843.832 7.104.064.939-.192 1.419-.768 1.44a.688.688 0 01-.384-.128 2.04 2.04 0 01-.352-.384 9.43 9.43 0 01-.32-.48 1.636 1.636 0 01-.16-.448c-.17-1.088-.33-2.24-.48-3.456a212.34 212.34 0 01-.416-3.648 269.893 269.893 0 01-.288-3.616 64.009 64.009 0 01-.16-3.232c.042-.512.117-.938.224-1.28.107-.362.33-.533.672-.512.362.022.618.17.768.448.17.256.266.576.288.96zM103.978 12.176c-.299.043-.651.01-1.056-.096-.384-.106-.651-.373-.8-.8a1.187 1.187 0 01-.032-.608c.043-.213.267-.362.672-.448.384-.085.789-.16 1.216-.224.448-.085.896-.16 1.344-.224l-1.184-3.584c-.363-1.365-.405-2.538-.128-3.52.277-.981 1.067-1.685 2.368-2.112a4.014 4.014 0 011.568-.192 4.054 4.054 0 011.504.416 4.91 4.91 0 011.28.928c.384.384.693.832.928 1.344a1.9 1.9 0 01.128.64c.021.17-.043.33-.192.48-.213.214-.448.31-.704.288-.256-.042-.427-.117-.512-.224a9.484 9.484 0 00-.64-.704 3.293 3.293 0 00-.704-.64 2.256 2.256 0 00-.768-.416 1.796 1.796 0 00-.896-.096c-.149.022-.331.096-.544.224-.192.128-.363.33-.512.608-.149.256-.245.598-.288 1.024-.021.427.053.96.224 1.6a67.191 67.191 0 001.152 3.68 18.437 18.437 0 012.816-.096c.469.043.907.128 1.312.256s.736.32.992.576c.064.214.053.395-.032.544a1.233 1.233 0 01-.384.352 1.81 1.81 0 01-.544.192 5.44 5.44 0 01-.576.096c-.427.043-.875.096-1.344.16-.469.043-.96.086-1.472.128.341.96.651 1.878.928 2.752.299.854.533 1.568.704 2.144.085.32.096.662.032 1.024a8.42 8.42 0 01-.256 1.056c-.171.49-.384.886-.64 1.184-.256.299-.533.395-.832.288-.235-.106-.384-.245-.448-.416-.064-.17-.075-.405-.032-.704.043-.341.064-.682.064-1.024 0-.341-.021-.65-.064-.928a3.57 3.57 0 00-.128-.768 9.786 9.786 0 00-.096-.48l-1.344-3.904-1.024.128c-.341.022-.693.054-1.056.096zM121.837 10.48c-.832.49-1.728.875-2.688 1.152-.96.256-1.995.384-3.104.384.043.747.256 1.344.64 1.792.384.427.864.683 1.44.768.341.043.683.032 1.024-.032.363-.064.693-.16.992-.288.32-.15.608-.31.864-.48.256-.17.48-.341.672-.512.192-.17.395-.277.608-.32.213-.064.373-.074.48-.032.299.107.405.427.32.96a5.044 5.044 0 01-1.472 1.76c-.64.47-1.355.768-2.144.896a4.747 4.747 0 01-2.112-.096 4.415 4.415 0 01-1.952-1.12 4.928 4.928 0 01-1.12-1.728 7.537 7.537 0 01-.48-2.048 5.039 5.039 0 01.16-1.888c.192-.597.48-1.12.864-1.568.384-.47.864-.853 1.44-1.152.576-.298 1.248-.47 2.016-.512.917-.064 1.749.107 2.496.512.747.406 1.269.97 1.568 1.696.171.406.213.758.128 1.056-.064.299-.277.566-.64.8zm-3.68-2.176a3.789 3.789 0 00-.704.224 3.167 3.167 0 00-.672.416 3.29 3.29 0 00-.544.544 1.237 1.237 0 00-.256.672 8.02 8.02 0 001.184-.096c.448-.064.875-.138 1.28-.224.427-.106.811-.224 1.152-.352.363-.128.661-.266.896-.416-.171-.405-.491-.65-.96-.736a3.317 3.317 0 00-1.376-.032zM132.672 6.16c.085.598.149 1.238.192 1.92.064.662.106 1.334.128 2.016.042.683.064 1.344.064 1.984 0 .64-.011 1.216-.032 1.728.682.47 1.088.886 1.216 1.248.149.363.17.683.064.96-.128.384-.363.587-.704.608-.32 0-.694-.117-1.12-.352-.299.214-.64.448-1.024.704-.384.235-.79.47-1.216.704-.427.214-.854.406-1.28.576-.427.17-.822.288-1.184.352-.683.107-1.302-.021-1.856-.384-.534-.362-.896-.906-1.088-1.632a3.96 3.96 0 01-.096-1.504 4.143 4.143 0 01.48-1.504c.256-.49.597-.928 1.024-1.312.448-.384.97-.682 1.568-.896a2.72 2.72 0 01.608-.16c.277-.042.554-.053.832-.032.298 0 .597.054.896.16.298.107.576.288.832.544 0-.362-.011-.757-.032-1.184 0-.448-.011-.896-.032-1.344a20.991 20.991 0 00-.096-1.248 10.98 10.98 0 00-.096-1.024c-.043-.32-.171-.512-.384-.576-.192-.085-.438-.074-.736.032-.512.17-1.11.502-1.792.992a23.08 23.08 0 00-1.952 1.568.817.817 0 01-.672.256.957.957 0 01-.608-.288.93.93 0 01-.288-.576c-.022-.234.064-.48.256-.736.362-.384.768-.778 1.216-1.184.448-.405.917-.768 1.408-1.088.49-.341.992-.618 1.504-.832a4.456 4.456 0 011.536-.352c.746-.021 1.322.15 1.728.512.405.342.65.79.736 1.344zm-3.712 6.88c-.278.064-.576.203-.896.416a3.812 3.812 0 00-.832.736 3.027 3.027 0 00-.544.96 1.673 1.673 0 000 1.024.483.483 0 00.256.288.735.735 0 00.48.032c.512-.106 1.088-.31 1.728-.608.661-.32 1.184-.661 1.568-1.024 0-.128-.064-.288-.192-.48a4.097 4.097 0 00-.448-.608 2.787 2.787 0 00-.576-.544c-.192-.15-.374-.213-.544-.192zM142.796 9.424c.405-.021.81.075 1.216.288.405.214.608.544.608.992-.043.363-.246.598-.608.704a3.606 3.606 0 01-.832.128c-.427 0-.886.01-1.376.032-.491.022-.992.054-1.504.096-.043.704-.086 1.366-.128 1.984-.022.619-.043 1.174-.064 1.664-.022.47-.032.854-.032 1.152 0 .299.01.459.032.48a9.5 9.5 0 001.504-.416 38.153 38.153 0 001.632-.672 57.758 57.758 0 001.6-.768c.533-.277 1.034-.533 1.504-.768.213-.106.405-.138.576-.096.192.043.309.139.352.288.042.235.01.523-.096.864-.107.342-.299.65-.576.928-.32.256-.747.555-1.28.896-.512.32-1.067.63-1.664.928-.598.299-1.206.566-1.824.8-.598.214-1.131.342-1.6.384-.704.064-1.238-.128-1.6-.576-.363-.448-.566-1.013-.608-1.696a27.43 27.43 0 01-.032-2.368c.042-.896.085-1.845.128-2.848l-1.184.128c-.363.022-.715.054-1.056.096-.278 0-.587-.064-.928-.192-.32-.128-.48-.373-.48-.736 0-.128.053-.298.16-.512.106-.213.341-.373.704-.48.874-.15 1.845-.277 2.912-.384.064-1.002.138-1.973.224-2.912.085-.938.16-1.792.224-2.56.021-.256.096-.48.224-.672.128-.192.266-.288.416-.288.362-.021.704.075 1.024.288.341.192.512.416.512.672a97.853 97.853 0 00-.256 2.464c-.064.918-.128 1.856-.192 2.816.426-.042.832-.064 1.216-.064.405-.021.789-.042 1.152-.064zM150.706 8.528a50.786 50.786 0 00-.384 1.92 23.417 23.417 0 00-.288 1.984c-.042.64-.042 1.216 0 1.728.064.512.203.875.416 1.088.363.064.779-.085 1.248-.448a8.91 8.91 0 001.376-1.44 13.85 13.85 0 001.216-1.856c.363-.682.619-1.28.768-1.792.086-.256.16-.522.224-.8a3.83 3.83 0 00.096-.864c0-.17.107-.33.32-.48.235-.17.427-.266.576-.288a.544.544 0 01.352.064c.15.064.278.16.384.288.128.107.235.246.32.416.107.15.16.31.16.48.043.64.107 1.344.192 2.112.086.768.182 1.536.288 2.304.128.768.256 1.515.384 2.24.128.726.256 1.376.384 1.952.064.235 0 .502-.192.8-.192.299-.405.48-.64.544a1.02 1.02 0 01-.608-.064c-.192-.085-.341-.256-.448-.512a12.13 12.13 0 01-.32-1.088c-.085-.448-.17-.906-.256-1.376a72.55 72.55 0 00-.192-1.376 16.932 16.932 0 01-.128-1.12c-.32.576-.704 1.163-1.152 1.76-.426.576-.896 1.11-1.408 1.6-.49.47-1.013.843-1.568 1.12a3.007 3.007 0 01-1.664.288c-.853-.106-1.504-.906-1.952-2.4a7.235 7.235 0 01-.256-1.984c.022-.725.075-1.44.16-2.144.107-.725.224-1.408.352-2.048.15-.64.278-1.162.384-1.568a.952.952 0 01.256-.448c.128-.15.278-.202.448-.16.32.064.608.256.864.576.278.32.374.65.288.992zM170.007 6.96c-.384.214-.789.438-1.216.672-.405.235-.821.512-1.248.832-.405.299-.8.662-1.184 1.088a7.128 7.128 0 00-.992 1.472 8.512 8.512 0 00-.864 2.496 19.97 19.97 0 00-.288 2.464c0 .384-.096.779-.288 1.184-.17.384-.416.576-.736.576-.405 0-.736-.202-.992-.608a4.68 4.68 0 01-.48-1.216 59.913 59.913 0 01-.896-4.48 112.869 112.869 0 01-.608-4.448c0-.298.086-.49.256-.576a1.27 1.27 0 01.64-.096c.256.022.502.086.736.192.235.107.374.278.416.512.086.79.192 1.622.32 2.496.128.854.256 1.59.384 2.208a5.63 5.63 0 01.704-2.112 8.541 8.541 0 011.408-1.856 8.898 8.898 0 011.92-1.408 7.378 7.378 0 012.208-.768c.32-.042.587-.042.8 0 .214.043.363.118.448.224.086.107.096.278.032.512-.042.235-.202.448-.48.64zM179.043 10.48c-.832.49-1.728.875-2.688 1.152-.96.256-1.994.384-3.104.384.043.747.256 1.344.64 1.792.384.427.864.683 1.44.768.342.043.683.032 1.024-.032a4.48 4.48 0 00.992-.288c.32-.15.608-.31.864-.48.256-.17.48-.341.672-.512.192-.17.395-.277.608-.32.214-.064.374-.074.48-.032.299.107.406.427.32.96a5.044 5.044 0 01-1.472 1.76c-.64.47-1.354.768-2.144.896a4.748 4.748 0 01-2.112-.096 4.415 4.415 0 01-1.952-1.12 4.942 4.942 0 01-1.12-1.728 7.537 7.537 0 01-.48-2.048 5.06 5.06 0 01.16-1.888c.192-.597.48-1.12.864-1.568.384-.47.864-.853 1.44-1.152.576-.298 1.248-.47 2.016-.512.918-.064 1.75.107 2.496.512.747.406 1.27.97 1.568 1.696.171.406.214.758.128 1.056-.064.299-.277.566-.64.8zm-3.68-2.176a3.789 3.789 0 00-.704.224 3.217 3.217 0 00-.672.416 3.29 3.29 0 00-.544.544 1.245 1.245 0 00-.256.672 8.01 8.01 0 001.184-.096c.448-.064.875-.138 1.28-.224.427-.106.811-.224 1.152-.352a4.4 4.4 0 00.896-.416c-.17-.405-.49-.65-.96-.736a3.317 3.317 0 00-1.376-.032zM187.862 8.432a39.046 39.046 0 00-.128-.672c-.043-.213-.149-.352-.32-.416a2.328 2.328 0 00-1.152-.032 3.913 3.913 0 00-1.12.416 3.3 3.3 0 00-.864.608c-.235.214-.363.406-.384.576-.064.32.021.63.256.928.235.299.576.598 1.024.896.747.448 1.525.907 2.336 1.376.811.47 1.493.95 2.048 1.44.555.49.928 1.035 1.12 1.632.213.576.171 1.238-.128 1.984-.235.576-.672 1.046-1.312 1.408-.64.363-1.344.65-2.112.864-.768.192-1.536.33-2.304.416-.768.064-1.419.096-1.952.096a1.24 1.24 0 01-.48-.128 7.333 7.333 0 01-.512-.352 7.5 7.5 0 01-.416-.384c-.107-.15-.16-.277-.16-.384 0-.384.171-.65.512-.8.341-.15.693-.224 1.056-.224.512 0 1.056-.021 1.632-.064.597-.064 1.163-.15 1.696-.256a8.155 8.155 0 001.44-.48c.427-.192.725-.437.896-.736.149-.256.053-.554-.288-.896-.32-.362-.757-.736-1.312-1.12a19.213 19.213 0 00-1.76-1.12 32.996 32.996 0 01-1.6-.992 4.962 4.962 0 01-1.152-1.056c-.32-.426-.523-.95-.608-1.568a3.25 3.25 0 01.352-1.6c.256-.512.587-.96.992-1.344a5.01 5.01 0 011.44-.96 3.944 3.944 0 011.6-.352c.917.043 1.675.299 2.272.768.597.448.949 1.12 1.056 2.016 0 .299-.053.544-.16.736-.085.192-.245.31-.48.352-.299.043-.544.01-.736-.096a.676.676 0 01-.288-.48z"
+ ></path>
+ </svg>
+ );
+};
-export default PowerfulFeaturesSVG;
\ No newline at end of file
+export default PowerfulFeaturesSVG;
diff --git a/crates/media/src/encoders/mp4_avassetwriter.rs b/crates/media/src/encoders/mp4_avassetwriter.rs
index 5249a5734..b72b3d23e 100644
--- a/crates/media/src/encoders/mp4_avassetwriter.rs
+++ b/crates/media/src/encoders/mp4_avassetwriter.rs
@@ -1,5 +1,6 @@
use std::{
path::PathBuf,
+ ptr::null,
sync::{Arc, Mutex},
};
@@ -19,9 +20,12 @@ pub struct MP4AVAssetWriterEncoder {
asset_writer: Retained<av::AssetWriter>,
video_input: Retained<av::AssetWriterInput>,
audio_input: Option<Retained<av::AssetWriterInput>>,
+ start_time: cm::Time,
first_timestamp: Option<cm::Time>,
last_timestamp: Option<cm::Time>,
is_writing: bool,
+ is_paused: bool,
+ elapsed_duration: cm::Time,
}
impl MP4AVAssetWriterEncoder {
@@ -145,28 +149,50 @@ impl MP4AVAssetWriterEncoder {
video_input,
first_timestamp: None,
last_timestamp: None,
- is_writing: true,
+ is_writing: false,
+ is_paused: false,
+ start_time: cm::Time::zero(),
+ elapsed_duration: cm::Time::zero(),
})
}
pub fn queue_video_frame(&mut self, frame: &cidre::cm::SampleBuf) {
- if !self.video_input.is_ready_for_more_media_data() {
+ if self.is_paused || !self.video_input.is_ready_for_more_media_data() {
return;
}
let time = frame.pts();
- if self.first_timestamp.is_none() {
+ if !self.is_writing {
+ self.is_writing = true;
self.asset_writer.start_session_at_src_time(time);
+ self.start_time = time;
+ }
+
+ if self.first_timestamp.is_none() {
self.first_timestamp = Some(time);
}
self.last_timestamp = Some(time);
- self.video_input.append_sample_buf(frame).ok();
+ let new_pts = self
+ .start_time
+ .add(time)
+ .sub(self.first_timestamp.unwrap())
+ .add(self.elapsed_duration);
+
+ let mut timing = frame.timing_info(0).unwrap();
+ timing.pts = new_pts;
+ let frame = frame.copy_with_new_timing(&[timing]).unwrap();
+
+ self.video_input.append_sample_buf(&frame).ok();
}
pub fn queue_audio_frame(&mut self, frame: FFAudio) -> Result<(), MediaError> {
+ if self.is_paused {
+ return Ok(());
+ }
+
let Some(audio_input) = &mut self.audio_input else {
return Err(MediaError::Any("No audio input"));
};
@@ -209,29 +235,26 @@ impl MP4AVAssetWriterEncoder {
let format_desc = cm::AudioFormatDesc::with_asbd(&audio_desc)
.map_err(|_| MediaError::Any("Failed to create audio format desc"))?;
- let buffer = unsafe {
- result_unchecked(|res| {
- cm::SampleBuf::create_in(
- None,
- Some(&block_buf),
- true,
- None,
- std::ptr::null(),
- Some(format_desc.as_ref()),
- frame.samples() as isize,
- 1,
- &SampleTimingInfo {
- duration: cm::Time::new(1, frame.rate() as i32),
- pts: cm::Time::new(frame.pts().unwrap_or(0), 1_000_000)
- .add(first_timestamp),
- dts: cm::Time::invalid(),
- },
- 0,
- std::ptr::null(),
- res,
- )
- })
- }
+ let pts = cm::Time::new(frame.pts().unwrap_or(0), AV_TIME_BASE_Q.den);
+
+ let pts = self
+ .start_time
+ .add(pts)
+ .sub(first_timestamp)
+ .add(self.elapsed_duration);
+
+ let buffer = cm::SampleBuf::create(
+ Some(&block_buf),
+ true,
+ Some(format_desc.as_ref()),
+ frame.samples() as isize,
+ &[SampleTimingInfo {
+ duration: cm::Time::new(1, frame.rate() as i32),
+ pts,
+ dts: cm::Time::invalid(),
+ }],
+ &[],
+ )
.map_err(|_| MediaError::Any("Failed to create sample buffer"))?;
audio_input.append_sample_buf(&buffer).map_err(|_| {
@@ -241,6 +264,30 @@ impl MP4AVAssetWriterEncoder {
Ok(())
}
+ pub fn pause(&mut self) {
+ if self.is_paused {
+ return;
+ }
+
+ let clock = cm::Clock::host_time_clock();
+ let time = clock.time();
+
+ self.elapsed_duration = self
+ .elapsed_duration
+ .add(time.sub(self.first_timestamp.unwrap()));
+ self.first_timestamp = None;
+ self.last_timestamp = None;
+ self.is_paused = true;
+ }
+
+ pub fn resume(&mut self) {
+ if !self.is_paused {
+ return;
+ }
+
+ self.is_paused = false;
+ }
+
fn process_frame(&mut self) {}
fn finish(&mut self) {
@@ -261,14 +308,14 @@ impl MP4AVAssetWriterEncoder {
}
}
-use screencapturekit::output::CMSampleBuffer;
+use ffmpeg_sys_next::AV_TIME_BASE_Q;
use tracing::{debug, info};
-impl PipelineSinkTask<cidre::arc::R<cidre::cm::SampleBuf>> for MP4AVAssetWriterEncoder {
+impl PipelineSinkTask<arc::R<cm::SampleBuf>> for MP4AVAssetWriterEncoder {
fn run(
&mut self,
ready_signal: crate::pipeline::task::PipelineReadySignal,
- input: &flume::Receiver<cidre::arc::R<cidre::cm::SampleBuf>>,
+ input: &flume::Receiver<arc::R<cm::SampleBuf>>,
) {
ready_signal.send(Ok(())).ok();
@@ -342,3 +389,76 @@ fn get_average_bitrate(width: f32, height: f32, fps: f32) -> f32 {
// assert!(fk_60 < 24_000_000.0);
// }
// }
+
+trait SampleBufExt {
+ fn create(
+ data_buffer: Option<&cm::BlockBuf>,
+ data_ready: bool,
+ format_description: Option<&cm::FormatDesc>,
+ num_samples: cm::ItemCount,
+ sample_timings: &[cm::SampleTimingInfo],
+ sample_sizes: &[usize],
+ ) -> os::Result<arc::R<cm::SampleBuf>>;
+
+ fn copy_with_new_timing(
+ &self,
+ sample_timings: &[cm::SampleTimingInfo],
+ ) -> os::Result<arc::R<cm::SampleBuf>>;
+}
+
+impl SampleBufExt for cm::SampleBuf {
+ fn create(
+ data_buffer: Option<&cm::BlockBuf>,
+ data_ready: bool,
+ format_description: Option<&cm::FormatDesc>,
+ num_samples: cm::ItemCount,
+ sample_timings: &[cm::SampleTimingInfo],
+ sample_sizes: &[usize],
+ ) -> os::Result<arc::R<cm::SampleBuf>> {
+ unsafe {
+ result_unchecked(|res| {
+ Self::create_in(
+ None,
+ data_buffer,
+ data_ready,
+ None,
+ std::ptr::null(),
+ format_description,
+ num_samples,
+ sample_timings.len() as isize,
+ sample_timings.as_ptr(),
+ sample_sizes.len() as isize,
+ sample_sizes.as_ptr(),
+ res,
+ )
+ })
+ }
+ }
+
+ fn copy_with_new_timing(
+ &self,
+ sample_timings: &[cm::SampleTimingInfo],
+ ) -> os::Result<arc::R<cm::SampleBuf>> {
+ unsafe {
+ extern "C-unwind" {
+ fn CMSampleBufferCreateCopyWithNewTiming(
+ allocator: Option<&cf::Allocator>,
+ original_buf: &cm::SampleBuf,
+ num_sample_timing_entries: cm::ItemCount,
+ sample_timing_array: *const cm::SampleTimingInfo,
+ sample_buffer_out: *mut Option<arc::R<cm::SampleBuf>>,
+ ) -> os::Status;
+ }
+
+ result_unchecked(|res| {
+ CMSampleBufferCreateCopyWithNewTiming(
+ None,
+ self,
+ sample_timings.len() as isize,
+ sample_timings.as_ptr(),
+ res,
+ )
+ })
+ }
+ }
+}
diff --git a/crates/media/src/sources/audio_mixer.rs b/crates/media/src/sources/audio_mixer.rs
index d6484b373..bd9e75327 100644
--- a/crates/media/src/sources/audio_mixer.rs
+++ b/crates/media/src/sources/audio_mixer.rs
@@ -1,5 +1,6 @@
-use std::time::Duration;
+use std::time::{Duration, SystemTime};
+use ffmpeg_sys_next::AV_TIME_BASE_Q;
use flume::{Receiver, Sender};
use tracing::warn;
@@ -71,7 +72,7 @@ impl AudioMixer {
.add(
&ffmpeg::filter::find("abuffer").expect("Failed to find abuffer filter"),
&format!("src{i}"),
- &args,
+ &dbg!(args),
)
.unwrap()
})
@@ -136,6 +137,9 @@ impl AudioMixer {
}
while abuffersink.sink().frame(&mut filtered).is_ok() {
+ let adjusted_pts =
+ filtered.pts().unwrap() as f64 / 48000.0 * AV_TIME_BASE_Q.den as f64;
+ filtered.set_pts(Some(adjusted_pts as i64));
if self.output.send(filtered).is_err() {
warn!("Mixer unable to send output");
return;
diff --git a/crates/media/src/sources/screen_capture.rs b/crates/media/src/sources/screen_capture.rs
index 0053d8d10..011c5305f 100644
--- a/crates/media/src/sources/screen_capture.rs
+++ b/crates/media/src/sources/screen_capture.rs
@@ -1,4 +1,5 @@
use cap_flags::FLAGS;
+use cidre::cm;
use cpal::traits::{DeviceTrait, HostTrait};
use ffmpeg::{format::Sample, frame::Audio, ChannelLayout};
use ffmpeg_sys_next::AV_TIME_BASE_Q;
@@ -439,9 +440,7 @@ impl PipelineSourceTask for ScreenCaptureSource<AVFrameCapture> {
}
}
- if let Err(_) =
- video_tx.send((buffer, 0.0 /* TODO: correct this */))
- {
+ if let Err(_) = video_tx.send((buffer, 0.0)) {
error!("Pipeline is unreachable. Shutting down recording.");
return Some(ControlFlow::Break(()));
}
@@ -452,10 +451,7 @@ impl PipelineSourceTask for ScreenCaptureSource<AVFrameCapture> {
}
Ok(Frame::Audio(frame)) => {
if let Some(audio_tx) = &audio_tx {
- let _ = audio_tx.send((
- scap_audio_to_ffmpeg(frame),
- 0.0, /* TODO: correct this */
- ));
+ let _ = audio_tx.send((scap_audio_to_ffmpeg(frame), 0.0));
}
None
}
@@ -562,7 +558,7 @@ impl PipelineSourceTask for ScreenCaptureSource<CMSampleBufferCapture> {
fn run(
&mut self,
- _: Self::Clock,
+ clock: Self::Clock,
ready_signal: crate::pipeline::task::PipelineReadySignal,
control_signal: crate::pipeline::control::PipelineControlSignal,
) {
@@ -595,6 +591,7 @@ impl PipelineSourceTask for ScreenCaptureSource<CMSampleBufferCapture> {
match typ {
SCStreamOutputType::Screen => {
+ println!("screen: {frame_time}");
let Some(pixel_buffer) = sample_buffer.image_buf() else {
return Some(ControlFlow::Continue(()));
};
@@ -603,12 +600,13 @@ impl PipelineSourceTask for ScreenCaptureSource<CMSampleBufferCapture> {
return Some(ControlFlow::Continue(()));
}
- if let Err(_) = video_tx.send((sample_buffer, unix_timestamp)) {
+ if let Err(_) = video_tx.send((sample_buffer, frame_time)) {
eprintln!("Pipeline is unreachable. Shutting down recording.");
return Some(ControlFlow::Continue(()));
}
}
SCStreamOutputType::Audio => {
+ println!("audio: {frame_time}");
let Some(audio_tx) = &audio_tx else {
return Some(ControlFlow::Continue(()));
};
@@ -630,14 +628,10 @@ impl PipelineSourceTask for ScreenCaptureSource<CMSampleBufferCapture> {
);
}
- frame.set_pts(Some(
- (sample_buffer.pts().value as f64
- / sample_buffer.pts().scale as f64
- * AV_TIME_BASE_Q.den as f64)
- as i64,
- ));
+ let timestamp = frame_time - start_cmtime;
+ frame.set_pts(Some((frame_time * AV_TIME_BASE_Q.den as f64) as i64));
- let _ = audio_tx.send((frame, unix_timestamp));
+ let _ = audio_tx.send((frame, timestamp));
}
}
diff --git a/crates/recording/src/capture_pipeline.rs b/crates/recording/src/capture_pipeline.rs
index 49b3ef342..6aefab518 100644
--- a/crates/recording/src/capture_pipeline.rs
+++ b/crates/recording/src/capture_pipeline.rs
@@ -1,4 +1,8 @@
-use std::{future::Future, path::PathBuf, sync::Arc};
+use std::{
+ future::Future,
+ path::PathBuf,
+ sync::{atomic::AtomicBool, Arc},
+};
use cap_media::{
data::AudioInfo,
@@ -40,6 +44,7 @@ pub trait MakeCapturePipeline: ScreenCaptureFormat + std::fmt::Debug + 'static {
audio: Option<&AudioInputFeed>,
system_audio: Option<(Receiver<(ffmpeg::frame::Audio, f64)>, AudioInfo)>,
output_path: PathBuf,
+ pause_flag: Arc<AtomicBool>,
) -> impl Future<Output = Result<CapturePipelineBuilder, MediaError>> + Send
where
Self: Sized;
@@ -67,14 +72,6 @@ impl MakeCapturePipeline for cap_media::sources::CMSampleBufferCapture {
let (timestamp_tx, timestamp_rx) = flume::bounded(1);
builder.spawn_task("screen_capture_encoder", move |ready| {
- let start = std::time::SystemTime::now();
- let start_time_unix = start
- .duration_since(std::time::UNIX_EPOCH)
- .expect("Time went backwards")
- .as_secs_f64();
- let start_cmtime = cidre::cm::Clock::host_time_clock().time();
- let start_cmtime = start_cmtime.value as f64 / start_cmtime.scale as f64;
-
let mut timestamp_tx = Some(timestamp_tx);
let _ = ready.send(Ok(()));
@@ -102,6 +99,7 @@ impl MakeCapturePipeline for cap_media::sources::CMSampleBufferCapture {
audio: Option<&AudioInputFeed>,
system_audio: Option<(Receiver<(ffmpeg::frame::Audio, f64)>, AudioInfo)>,
output_path: PathBuf,
+ pause_flag: Arc<AtomicBool>,
) -> Result<CapturePipelineBuilder, MediaError> {
let (audio_tx, audio_rx) = flume::bounded(64);
let mut audio_mixer = AudioMixer::new(audio_tx);
@@ -150,6 +148,12 @@ impl MakeCapturePipeline for cap_media::sources::CMSampleBufferCapture {
let _ = ready.send(Ok(()));
while let Ok((frame, unix_time)) = source.1.recv() {
if let Ok(mut mp4) = mp4.lock() {
+ if pause_flag.load(std::sync::atomic::Ordering::Relaxed) {
+ mp4.pause();
+ } else {
+ mp4.resume();
+ }
+
mp4.queue_video_frame(frame.as_ref());
}
}
@@ -213,6 +217,7 @@ impl MakeCapturePipeline for AVFrameCapture {
audio: Option<&AudioInputFeed>,
system_audio: Option<(Receiver<(ffmpeg::frame::Audio, f64)>, AudioInfo)>,
output_path: PathBuf,
+ pause_flag: Arc<AtomicBool>,
) -> Result<CapturePipelineBuilder, MediaError>
where
Self: Sized,
@@ -249,7 +254,7 @@ impl MakeCapturePipeline for AVFrameCapture {
let _ = ready.send(Ok(()));
while let Ok(frame) = audio_rx.recv() {
if let Ok(mut mp4) = mp4.lock() {
- mp4.queue_audio_frame(dbg!(frame));
+ mp4.queue_audio_frame(frame);
}
}
});
@@ -261,6 +266,12 @@ impl MakeCapturePipeline for AVFrameCapture {
let _ = ready.send(Ok(()));
while let Ok((frame, unix_time)) = source.1.recv() {
if let Ok(mut mp4) = mp4.lock() {
+ if pause_flag.load(std::sync::atomic::Ordering::Relaxed) {
+ mp4.pause();
+ } else {
+ mp4.resume();
+ }
+
mp4.queue_video_frame(frame);
}
}
@@ -278,10 +289,10 @@ type ScreenCaptureReturn<T> = (
Receiver<(<T as ScreenCaptureFormat>::VideoFormat, f64)>,
);
-#[cfg(target_os = "macos")]
-pub type ScreenCaptureMethod = CMSampleBufferCapture;
+// #[cfg(target_os = "macos")]
+// pub type ScreenCaptureMethod = CMSampleBufferCapture;
-#[cfg(not(target_os = "macos"))]
+// #[cfg(not(target_os = "macos"))]
pub type ScreenCaptureMethod = AVFrameCapture;
pub fn create_screen_capture(
@@ -293,32 +304,15 @@ pub fn create_screen_capture(
) -> Result<ScreenCaptureReturn<ScreenCaptureMethod>, RecordingError> {
let (video_tx, video_rx) = flume::bounded(16);
- #[cfg(target_os = "macos")]
- {
- ScreenCaptureSource::<cap_media::sources::CMSampleBufferCapture>::init(
- capture_target,
- None,
- show_camera,
- force_show_cursor,
- max_fps,
- video_tx,
- audio_tx,
- )
- .map(|v| (v, video_rx))
- .map_err(|e| RecordingError::Media(MediaError::TaskLaunch(e)))
- }
- #[cfg(not(target_os = "macos"))]
- {
- ScreenCaptureSource::<cap_media::sources::AVFrameCapture>::init(
- capture_target,
- None,
- show_camera,
- force_show_cursor,
- max_fps,
- video_tx,
- audio_tx,
- )
- .map(|v| (v, video_rx))
- .map_err(|e| RecordingError::Media(MediaError::TaskLaunch(e)))
- }
+ ScreenCaptureSource::<ScreenCaptureMethod>::init(
+ capture_target,
+ None,
+ show_camera,
+ force_show_cursor,
+ max_fps,
+ video_tx,
+ audio_tx,
+ )
+ .map(|v| (v, video_rx))
+ .map_err(|e| RecordingError::Media(MediaError::TaskLaunch(e)))
}
diff --git a/crates/recording/src/instant_recording.rs b/crates/recording/src/instant_recording.rs
index 5ccffaaaa..b819a37bb 100644
--- a/crates/recording/src/instant_recording.rs
+++ b/crates/recording/src/instant_recording.rs
@@ -1,6 +1,7 @@
use std::{
fs::File,
path::PathBuf,
+ sync::{atomic::AtomicBool, Arc},
time::{SystemTime, UNIX_EPOCH},
};
@@ -28,6 +29,7 @@ use crate::{
struct InstantRecordingPipeline {
pub inner: Pipeline<RealTimeClock<()>>,
pub output_path: PathBuf,
+ pub pause_flag: Arc<AtomicBool>,
}
enum InstantRecordingActorState {
@@ -36,7 +38,11 @@ enum InstantRecordingActorState {
pipeline_done_rx: oneshot::Receiver<()>,
segment_start_time: f64,
},
- Paused,
+ Paused {
+ pipeline: InstantRecordingPipeline,
+ pipeline_done_rx: oneshot::Receiver<()>,
+ segment_start_time: f64,
+ },
Stopped,
}
@@ -116,6 +122,7 @@ async fn create_pipeline<TCaptureFormat: MakeCapturePipeline>(
let clock = RealTimeClock::<()>::new();
let pipeline_builder = Pipeline::builder(clock);
+ let pause_flag = Arc::new(AtomicBool::new(false));
let system_audio = system_audio.map(|v| (v, screen_source.0.audio_info()));
let pipeline_builder = TCaptureFormat::make_instant_mode_pipeline(
pipeline_builder,
@@ -123,6 +130,7 @@ async fn create_pipeline<TCaptureFormat: MakeCapturePipeline>(
audio_input_feed,
system_audio,
output_path.clone(),
+ pause_flag.clone(),
)
.await?;
@@ -134,6 +142,7 @@ async fn create_pipeline<TCaptureFormat: MakeCapturePipeline>(
InstantRecordingPipeline {
inner: pipeline,
output_path,
+ pause_flag,
},
pipeline_done_rx,
))
@@ -204,7 +213,7 @@ pub async fn spawn_instant_recording_actor(
'outer: loop {
state = match state {
InstantRecordingActorState::Recording {
- mut pipeline,
+ pipeline,
mut pipeline_done_rx,
segment_start_time,
} => {
@@ -236,20 +245,15 @@ pub async fn spawn_instant_recording_actor(
break match msg {
InstantRecordingActorControlMessage::Pause(tx) => {
- InstantRecordingActorState::Recording {
+ pipeline
+ .pause_flag
+ .store(true, std::sync::atomic::Ordering::SeqCst);
+ let _ = tx.send(Ok(()));
+ InstantRecordingActorState::Paused {
pipeline,
pipeline_done_rx,
segment_start_time,
}
- // let res = shutdown(
- // pipeline,
- // &mut actor,
- // segment_start_time,
- // )
- // .await;
-
- // tx.send(res.map_err(Into::into)).ok();
- // InstantRecordingActorState::Paused
}
InstantRecordingActorControlMessage::Stop(tx) => {
let res =
@@ -267,7 +271,11 @@ pub async fn spawn_instant_recording_actor(
};
}
}
- InstantRecordingActorState::Paused => {
+ InstantRecordingActorState::Paused {
+ pipeline,
+ pipeline_done_rx,
+ segment_start_time,
+ } => {
info!("recording actor paused");
loop {
let Ok(msg) = ctrl_rx.recv_async().await else {
@@ -276,40 +284,21 @@ pub async fn spawn_instant_recording_actor(
break match msg {
InstantRecordingActorControlMessage::Stop(tx) => {
- tx.send(stop_recording(actor).await).ok();
+ let _ = tx.send(stop_recording(actor).await).ok();
break 'outer;
}
InstantRecordingActorControlMessage::Resume(tx) => {
- // let (state, res) = match create_pipeline(
- // &segments_dir,
- // &cursors_dir,
- // next_index,
- // screen_source.clone(),
- // camera_feed.as_deref(),
- // audio_input_feed.as_ref(),
- // cursors,
- // next_cursor_id,
- // )
- // .await
- // {
- // Ok((pipeline, pipeline_done_rx)) => (
- // InstantRecordingActorState::Recording {
- // pipeline,
- // pipeline_done_rx,
- // index: next_index,
- // segment_start_time: current_time_f64(),
- // },
- // Ok(()),
- // ),
- // Err(e) => (
- // InstantRecordingActorState::Stopped,
- // Err(e.into()),
- // ),
- // };
-
- // tx.send(res).ok();
-
- state
+ pipeline
+ .pause_flag
+ .store(false, std::sync::atomic::Ordering::SeqCst);
+
+ let _ = tx.send(Ok(()));
+
+ InstantRecordingActorState::Recording {
+ pipeline,
+ pipeline_done_rx,
+ segment_start_time,
+ }
}
_ => continue,
};
diff --git a/infra/sst-env.d.ts b/infra/sst-env.d.ts
index 00305e653..d59b67514 100644
--- a/infra/sst-env.d.ts
+++ b/infra/sst-env.d.ts
@@ -5,20 +5,20 @@
declare module "sst" {
export interface Resource {
- "DISCORD_BOT_TOKEN": {
- "type": "sst.sst.Secret"
- "value": string
- }
- "DiscordBotScript": {
- "type": "sst.cloudflare.Worker"
- }
- "GITHUB_APP_PRIVATE_KEY": {
- "type": "sst.sst.Secret"
- "value": string
- }
+ DISCORD_BOT_TOKEN: {
+ type: "sst.sst.Secret";
+ value: string;
+ };
+ DiscordBotScript: {
+ type: "sst.cloudflare.Worker";
+ };
+ GITHUB_APP_PRIVATE_KEY: {
+ type: "sst.sst.Secret";
+ value: string;
+ };
}
}
/// <reference path="sst-env.d.ts" />
-import "sst"
-export {}
\ No newline at end of file
+import "sst";
+export {};
diff --git a/packages/env/server.ts b/packages/env/server.ts
index 76276af9d..a4ea8fd40 100644
--- a/packages/env/server.ts
+++ b/packages/env/server.ts
@@ -7,8 +7,8 @@ export const serverEnv = createEnv({
DATABASE_URL: z.string(),
DATABASE_MIGRATION_URL: z.string().optional(),
DATABASE_ENCRYPTION_KEY: z.string().optional(),
- CAP_AWS_ACCESS_KEY: z.string(),
- CAP_AWS_SECRET_KEY: z.string(),
+ CAP_AWS_ACCESS_KEY: z.string().default("capS3root"),
+ CAP_AWS_SECRET_KEY: z.string().default("capS3root"),
CAP_AWS_MEDIACONVERT_ROLE_ARN: z.string().optional(),
CAP_CLOUDFRONT_DISTRIBUTION_ID: z.string().optional(),
NEXTAUTH_SECRET: z.string(),
diff --git a/packages/ui-solid/src/auto-imports.d.ts b/packages/ui-solid/src/auto-imports.d.ts
index 01fe6f87f..17f57d5f9 100644
--- a/packages/ui-solid/src/auto-imports.d.ts
+++ b/packages/ui-solid/src/auto-imports.d.ts
@@ -8,32 +8,32 @@ export {}
declare global {
const IconCapArrows: typeof import('~icons/cap/arrows.jsx')['default']
const IconCapAudioOn: typeof import('~icons/cap/audio-on.jsx')['default']
- const IconCapAuto: typeof import('~icons/cap/auto.jsx')['default']
+ const IconCapAuto: typeof import("~icons/cap/auto.jsx")["default"]
const IconCapBgBlur: typeof import('~icons/cap/bg-blur.jsx')['default']
- const IconCapBlur: typeof import('~icons/cap/blur.jsx')['default']
+ const IconCapBlur: typeof import("~icons/cap/blur.jsx")["default"]
const IconCapCamera: typeof import('~icons/cap/camera.jsx')['default']
const IconCapCaptions: typeof import('~icons/cap/captions.jsx')['default']
- const IconCapCheck: typeof import('~icons/cap/check.jsx')['default']
+ const IconCapCheck: typeof import("~icons/cap/check.jsx")["default"]
const IconCapChevronDown: typeof import('~icons/cap/chevron-down.jsx')['default']
const IconCapCircleCheck: typeof import('~icons/cap/circle-check.jsx')['default']
const IconCapCirclePlus: typeof import('~icons/cap/circle-plus.jsx')['default']
const IconCapCircleX: typeof import('~icons/cap/circle-x.jsx')['default']
- const IconCapClock: typeof import('~icons/cap/clock.jsx')['default']
+ const IconCapClock: typeof import("~icons/cap/clock.jsx")["default"]
const IconCapCopy: typeof import('~icons/cap/copy.jsx')['default']
const IconCapCorners: typeof import('~icons/cap/corners.jsx')['default']
const IconCapCrop: typeof import('~icons/cap/crop.jsx')['default']
const IconCapCursor: typeof import('~icons/cap/cursor.jsx')['default']
- const IconCapEditor: typeof import('~icons/cap/editor.jsx')['default']
+ const IconCapEditor: typeof import("~icons/cap/editor.jsx")["default"]
const IconCapEnlarge: typeof import('~icons/cap/enlarge.jsx')['default']
const IconCapFile: typeof import('~icons/cap/file.jsx')['default']
const IconCapFilmCut: typeof import('~icons/cap/film-cut.jsx')['default']
- const IconCapFrameFirst: typeof import('~icons/cap/frame-first.jsx')['default']
- const IconCapFrameLast: typeof import('~icons/cap/frame-last.jsx')['default']
+ const IconCapFrameFirst: typeof import("~icons/cap/frame-first.jsx")["default"]
+ const IconCapFrameLast: typeof import("~icons/cap/frame-last.jsx")["default"]
const IconCapGauge: typeof import('~icons/cap/gauge.jsx')['default']
const IconCapHotkeys: typeof import('~icons/cap/hotkeys.jsx')['default']
const IconCapImage: typeof import('~icons/cap/image.jsx')['default']
const IconCapInfo: typeof import('~icons/cap/info.jsx')['default']
- const IconCapInset: typeof import('~icons/cap/inset.jsx')['default']
+ const IconCapInset: typeof import("~icons/cap/inset.jsx")["default"]
const IconCapInstant: typeof import('~icons/cap/instant.jsx')['default']
const IconCapLayout: typeof import('~icons/cap/layout.jsx')['default']
const IconCapLink: typeof import('~icons/cap/link.jsx')['default']
@@ -43,8 +43,8 @@ declare global {
const IconCapMessageBubble: typeof import('~icons/cap/message-bubble.jsx')['default']
const IconCapMicrophone: typeof import('~icons/cap/microphone.jsx')['default']
const IconCapMoreVertical: typeof import('~icons/cap/more-vertical.jsx')['default']
- const IconCapMoveLeft: typeof import('~icons/cap/move-left.jsx')['default']
- const IconCapMoveRight: typeof import('~icons/cap/move-right.jsx')['default']
+ const IconCapMoveLeft: typeof import("~icons/cap/move-left.jsx")["default"]
+ const IconCapMoveRight: typeof import("~icons/cap/move-right.jsx")["default"]
const IconCapNext: typeof import('~icons/cap/next.jsx')['default']
const IconCapPadding: typeof import('~icons/cap/padding.jsx')['default']
const IconCapPause: typeof import('~icons/cap/pause.jsx')['default']
@@ -58,45 +58,45 @@ declare global {
const IconCapScissors: typeof import('~icons/cap/scissors.jsx')['default']
const IconCapSettings: typeof import('~icons/cap/settings.jsx')['default']
const IconCapShadow: typeof import('~icons/cap/shadow.jsx')['default']
- const IconCapSize: typeof import('~icons/cap/size.jsx')['default']
+ const IconCapSize: typeof import("~icons/cap/size.jsx")["default"]
const IconCapSquare: typeof import('~icons/cap/square.jsx')['default']
- const IconCapStop: typeof import('~icons/cap/stop.jsx')['default']
+ const IconCapStop: typeof import("~icons/cap/stop.jsx")["default"]
const IconCapStopCircle: typeof import('~icons/cap/stop-circle.jsx')['default']
const IconCapTrash: typeof import('~icons/cap/trash.jsx')['default']
const IconCapUndo: typeof import('~icons/cap/undo.jsx')['default']
- const IconCapUpload: typeof import('~icons/cap/upload.jsx')['default']
+ const IconCapUpload: typeof import("~icons/cap/upload.jsx")["default"]
const IconCapZoomIn: typeof import('~icons/cap/zoom-in.jsx')['default']
const IconCapZoomOut: typeof import('~icons/cap/zoom-out.jsx')['default']
const IconHugeiconsEaseCurveControlPoints: typeof import('~icons/hugeicons/ease-curve-control-points.jsx')['default']
- const IconIcBaselineMonitor: typeof import('~icons/ic/baseline-monitor.jsx')['default']
- const IconIcRoundSearch: typeof import('~icons/ic/round-search.jsx')['default']
+ const IconIcBaselineMonitor: typeof import("~icons/ic/baseline-monitor.jsx")["default"]
+ const IconIcRoundSearch: typeof import("~icons/ic/round-search.jsx")["default"]
const IconLucideBell: typeof import('~icons/lucide/bell.jsx')['default']
const IconLucideBug: typeof import('~icons/lucide/bug.jsx')['default']
const IconLucideCamera: typeof import('~icons/lucide/camera.jsx')['default']
const IconLucideCheck: typeof import('~icons/lucide/check.jsx')['default']
- const IconLucideChevronDown: typeof import('~icons/lucide/chevron-down.jsx')['default']
+ const IconLucideChevronDown: typeof import("~icons/lucide/chevron-down.jsx")["default"]
const IconLucideClock: typeof import('~icons/lucide/clock.jsx')['default']
- const IconLucideDatabase: typeof import('~icons/lucide/database.jsx')['default']
+ const IconLucideDatabase: typeof import("~icons/lucide/database.jsx")["default"]
const IconLucideEdit: typeof import('~icons/lucide/edit.jsx')['default']
- const IconLucideEye: typeof import('~icons/lucide/eye.jsx')['default']
+ const IconLucideEye: typeof import("~icons/lucide/eye.jsx")["default"]
const IconLucideFolder: typeof import('~icons/lucide/folder.jsx')['default']
const IconLucideGift: typeof import('~icons/lucide/gift.jsx')['default']
const IconLucideHardDrive: typeof import('~icons/lucide/hard-drive.jsx')['default']
- const IconLucideLayoutGrid: typeof import('~icons/lucide/layout-grid.jsx')['default']
+ const IconLucideLayoutGrid: typeof import("~icons/lucide/layout-grid.jsx")["default"]
const IconLucideLoaderCircle: typeof import('~icons/lucide/loader-circle.jsx')['default']
- const IconLucideMessageCircle: typeof import('~icons/lucide/message-circle.jsx')['default']
- const IconLucideMessageSquare: typeof import('~icons/lucide/message-square.jsx')['default']
+ const IconLucideMessageCircle: typeof import("~icons/lucide/message-circle.jsx")["default"]
+ const IconLucideMessageSquare: typeof import("~icons/lucide/message-square.jsx")["default"]
const IconLucideMessageSquarePlus: typeof import('~icons/lucide/message-square-plus.jsx')['default']
const IconLucideMicOff: typeof import('~icons/lucide/mic-off.jsx')['default']
- const IconLucideMonitor: typeof import('~icons/lucide/monitor.jsx')['default']
- const IconLucideRabbit: typeof import('~icons/lucide/rabbit.jsx')['default']
+ const IconLucideMonitor: typeof import("~icons/lucide/monitor.jsx")["default"]
+ const IconLucideRabbit: typeof import("~icons/lucide/rabbit.jsx")["default"]
const IconLucideRotateCcw: typeof import('~icons/lucide/rotate-ccw.jsx')['default']
const IconLucideSearch: typeof import('~icons/lucide/search.jsx')['default']
const IconLucideSquarePlay: typeof import('~icons/lucide/square-play.jsx')['default']
const IconLucideUnplug: typeof import('~icons/lucide/unplug.jsx')['default']
- const IconLucideVideo: typeof import('~icons/lucide/video.jsx')['default']
+ const IconLucideVideo: typeof import("~icons/lucide/video.jsx")["default"]
const IconLucideVolume2: typeof import('~icons/lucide/volume2.jsx')['default']
const IconLucideVolumeX: typeof import('~icons/lucide/volume-x.jsx')['default']
- const IconMdiMonitor: typeof import('~icons/mdi/monitor.jsx')['default']
+ const IconMdiMonitor: typeof import("~icons/mdi/monitor.jsx")["default"]
const IconPhMonitorBold: typeof import('~icons/ph/monitor-bold.jsx')['default']
}
diff --git a/packages/ui/src/components/Button.tsx b/packages/ui/src/components/Button.tsx
index 0e18b8fd5..c5ea42706 100644
--- a/packages/ui/src/components/Button.tsx
+++ b/packages/ui/src/components/Button.tsx
@@ -22,7 +22,8 @@ const buttonVariants = cva(
"bg-white text-gray-500 hover:bg-gray-100 disabled:bg-gray-100 border-black/10",
gray: "bg-gray-200 text-gray-500 hover:bg-gray-200 disabled:bg-gray-100 border-transparent",
dark: "bg-[#2e2e2e] text-gray-50 hover:bg-[#383838] disabled:bg-[#383838] border-transparent",
- radialblue: "text-gray-50 disabled:bg-gray-100 border-0 [background:radial-gradient(90%_100%_at_15%_12%,#9BC4FF_0%,#3588FF_100%)] border-transparent hover:opacity-80",
+ radialblue:
+ "text-gray-50 disabled:bg-gray-100 border-0 [background:radial-gradient(90%_100%_at_15%_12%,#9BC4FF_0%,#3588FF_100%)] border-transparent hover:opacity-80",
},
size: {
xs: "font-[400] text-[0.75rem] px-[0.5rem] h-[1.25rem] ",
diff --git a/packages/ui/src/components/NavigationMenu.tsx b/packages/ui/src/components/NavigationMenu.tsx
index f8baf68f8..33ec90dd3 100644
--- a/packages/ui/src/components/NavigationMenu.tsx
+++ b/packages/ui/src/components/NavigationMenu.tsx
@@ -58,9 +58,9 @@ const NavigationMenuTrigger = React.forwardRef<
{children}{" "}
{caret && (
<ChevronDown
- className="relative top-[-1px] ml-[3px] h-4 w-4 transition duration-200 group-data-[state=open]:rotate-180"
- aria-hidden="true"
- />
+ className="relative top-[-1px] ml-[3px] h-4 w-4 transition duration-200 group-data-[state=open]:rotate-180"
+ aria-hidden="true"
+ />
)}
</NavigationMenuPrimitive.Trigger>
));
diff --git a/packages/utils/src/helpers.ts b/packages/utils/src/helpers.ts
index 111f2af4a..ef33bd2ed 100644
--- a/packages/utils/src/helpers.ts
+++ b/packages/utils/src/helpers.ts
@@ -15,7 +15,7 @@ export const uuidFormat = (uuid: string) => {
export const CAP_LOGO_URL =
"https://raw.githubusercontent.com/CapSoftware/cap/main/apps/desktop/src-tauri/icons/Square310x310Logo.png";
-
+
export const saveLatestVideoId = (videoId: string) => {
try {
if (typeof navigator !== "undefined" && typeof window !== "undefined") {
diff --git a/scripts/env-cli.js b/scripts/env-cli.js
index 585c2d6d6..8748f2ebd 100644
--- a/scripts/env-cli.js
+++ b/scripts/env-cli.js
@@ -40,7 +40,9 @@ async function main() {
.catch(() => null);
let allEnvs = file ? JSON.parse(file) : {};
- let envs = {};
+ let envs = {
+ NODE_ENV: "development",
+ };
const hasWeb = targets.includes("web");
const hasDesktop = targets.includes("desktop");
@@ -50,16 +52,20 @@ async function main() {
if (hasWeb) {
envs.VITE_SERVER_URL = "http://localhost:3000";
+ envs.NEXT_PUBLIC_WEB_URL = "http://localhost:3000";
+ envs.NEXTAUTH_URL = envs.NEXT_PUBLIC_WEB_URL;
if (!allEnvs.NEXTAUTH_SECRET) {
allEnvs.NEXTAUTH_SECRET = crypto.randomBytes(32).toString("base64");
log.info("Generated NEXTAUTH_SECRET");
}
+ envs.NEXTAUTH_SECRET = allEnvs.NEXTAUTH_SECRET;
if (!allEnvs.DATABASE_ENCRYPTION_KEY) {
allEnvs.DATABASE_ENCRYPTION_KEY = crypto.randomBytes(32).toString("hex");
log.info("Generated DATABASE_ENCRYPTION_KEY");
}
+ envs.DATABASE_ENCRYPTION_KEY = allEnvs.DATABASE_ENCRYPTION_KEY;
usingDockerEnvironment = await confirm({
message: "Will you be running S3 and MySQL via Docker?",
@@ -149,7 +155,7 @@ async function main() {
envs.NEXT_PUBLIC_CAP_AWS_ENDPOINT = DOCKER_S3_ENVS.endpoint;
}
} else {
- envs.VITE_SERVER_URL = "http://cap.so";
+ envs.VITE_SERVER_URL = "https://cap.so";
}
if (hasDesktop) {