Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat: hideBranding option for embed

Richie McIlroy40eb8d7abf12
diff --git a/apps/web/app/embed/[videoId]/_components/EmbedVideo.tsx b/apps/web/app/embed/[videoId]/_components/EmbedVideo.tsx
index f01179d21..7cf14aa87 100644
--- a/apps/web/app/embed/[videoId]/_components/EmbedVideo.tsx
+++ b/apps/web/app/embed/[videoId]/_components/EmbedVideo.tsx
@@ -30,6 +30,7 @@ import { fromVtt, Subtitle } from "subtitles-parser-vtt";
import { MP4VideoPlayer } from "../../../s/[videoId]/_components/MP4VideoPlayer";
import { VideoPlayer } from "../../../s/[videoId]/_components/VideoPlayer";
import { useQuery } from "@tanstack/react-query";
+import { useSearchParams } from "next/navigation";
declare global {
interface Window {
@@ -84,6 +85,9 @@ export const EmbedVideo = forwardRef<
) => {
useImperativeHandle(ref, () => videoRef.current as HTMLVideoElement);
+ const searchParams = useSearchParams();
+ const hideBranding = searchParams.get("hideBranding") === "true";
+
const videoRef = useRef<HTMLVideoElement>(null);
const [isPlaying, setIsPlaying] = useState(false);
const [currentTime, setCurrentTime] = useState(0);
@@ -650,7 +654,7 @@ export const EmbedVideo = forwardRef<
)}
</AnimatePresence>
- {!isPlaying && (
+ {!isPlaying && !hideBranding && (
<motion.button
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
@@ -742,7 +746,7 @@ export const EmbedVideo = forwardRef<
)}
<AnimatePresence>
- {isPlaying && !showTitleOverlay && (
+ {isPlaying && !showTitleOverlay && !hideBranding && (
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}