Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: Change cors settings for /playlist API + remove redundant FPS settings

Richie McIlroy0f93562cc78b
diff --git a/apps/desktop/src-tauri/src/recording.rs b/apps/desktop/src-tauri/src/recording.rs
index 781e6926c..281c6b738 100644
--- a/apps/desktop/src-tauri/src/recording.rs
+++ b/apps/desktop/src-tauri/src/recording.rs
@@ -50,8 +50,6 @@ pub struct RecordingOptions {
pub audio_name: String,
pub aws_region: String,
pub aws_bucket: String,
- pub framerate: String,
- pub resolution: String,
}
#[tauri::command]
diff --git a/apps/desktop/src/components/windows/inner/Recorder.tsx b/apps/desktop/src/components/windows/inner/Recorder.tsx
index 0e872c443..5cee58c01 100644
--- a/apps/desktop/src/components/windows/inner/Recorder.tsx
+++ b/apps/desktop/src/components/windows/inner/Recorder.tsx
@@ -11,8 +11,6 @@ import { Button } from "@cap/ui";
import { Logo } from "@/components/icons/Logo";
import { emit } from "@tauri-apps/api/event";
import { invoke } from "@tauri-apps/api/tauri";
-import { Countdown } from "./Countdown";
-import { getSelectedVideoProperties } from "@/utils/recording/utils";
import { getLatestVideoId, saveLatestVideoId } from "@/utils/database/utils";
import { openLinkInBrowser } from "@/utils/helpers";
import toast, { Toaster } from "react-hot-toast";
@@ -118,28 +116,21 @@ export const Recorder = () => {
aws_bucket: string;
}) => {
console.log("Starting dual recording...");
- const mediaSettings = await getSelectedVideoProperties();
- if (mediaSettings?.resolution && mediaSettings?.framerate) {
- console.log("Setting recording as active...");
- setIsRecording(true);
- setStartingRecording(false);
- await invoke("start_dual_recording", {
- options: {
- user_id: videoData.user_id,
- video_id: videoData.id,
- audio_name: selectedAudioDevice?.label,
- aws_region: videoData.aws_region,
- aws_bucket: videoData.aws_bucket,
- screen_index: "Capture screen 0",
- video_index: String(selectedVideoDevice?.index),
- ...mediaSettings,
- },
- }).catch((error) => {
- console.error("Error invoking start_screen_recording:", error);
- });
- } else {
- console.error("Invalid media settings for dual recording");
- }
+ setIsRecording(true);
+ setStartingRecording(false);
+ await invoke("start_dual_recording", {
+ options: {
+ user_id: videoData.user_id,
+ video_id: videoData.id,
+ audio_name: selectedAudioDevice?.label,
+ aws_region: videoData.aws_region,
+ aws_bucket: videoData.aws_bucket,
+ screen_index: "Capture screen 0",
+ video_index: String(selectedVideoDevice?.index),
+ },
+ }).catch((error) => {
+ console.error("Error invoking start_screen_recording:", error);
+ });
};
const handleStartAllRecordings = async () => {
diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs
index d9a6920dc..90d2c9456 100644
--- a/apps/web/next.config.mjs
+++ b/apps/web/next.config.mjs
@@ -43,24 +43,7 @@ const nextConfig = {
async headers() {
return [
{
- source: "/api/playlist/(.*)",
- headers: [
- {
- key: "Access-Control-Allow-Origin",
- value: "*",
- },
- {
- key: "Access-Control-Allow-Methods",
- value: "GET",
- },
- {
- key: "Access-Control-Allow-Credentials",
- value: "true",
- },
- ],
- },
- {
- source: "/api/desktop/(.*)",
+ source: "/api/(.*)",
headers: [
{
key: "Access-Control-Allow-Origin",
@@ -81,7 +64,7 @@ const nextConfig = {
],
},
{
- source: "/api/desktop/(.*)",
+ source: "/api/(.*)",
headers: [
{
key: "Access-Control-Allow-Origin",
@@ -102,7 +85,7 @@ const nextConfig = {
],
},
{
- source: "/api/desktop/(.*)",
+ source: "/api/(.*)",
headers: [
{
key: "Access-Control-Allow-Origin",
@@ -123,7 +106,7 @@ const nextConfig = {
],
},
{
- source: "/api/desktop/(.*)",
+ source: "/api/(.*)",
headers: [
{
key: "Access-Control-Allow-Origin",