Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Call setupTracks on track change; move transcript

Richie McIlroy83570c9712f6
diff --git a/apps/web/app/s/[videoId]/_components/CapVideoPlayer.tsx b/apps/web/app/s/[videoId]/_components/CapVideoPlayer.tsx
index 0850de299..aa75a15e4 100644
--- a/apps/web/app/s/[videoId]/_components/CapVideoPlayer.tsx
+++ b/apps/web/app/s/[videoId]/_components/CapVideoPlayer.tsx
@@ -429,9 +429,9 @@ export function CapVideoPlayer({
setupTracks();
};
- // Monitor for track changes and ensure they stay hidden
const handleTrackChange = () => {
ensureTracksHidden();
+ setupTracks();
};
video.addEventListener("loadeddata", handleLoadedData);
diff --git a/apps/web/app/s/[videoId]/_components/HLSVideoPlayer.tsx b/apps/web/app/s/[videoId]/_components/HLSVideoPlayer.tsx
index 65a81829c..26dbea971 100644
--- a/apps/web/app/s/[videoId]/_components/HLSVideoPlayer.tsx
+++ b/apps/web/app/s/[videoId]/_components/HLSVideoPlayer.tsx
@@ -285,9 +285,9 @@ export function HLSVideoPlayer({
setupTracks();
};
- // Monitor for track changes and ensure they stay hidden
const handleTrackChange = () => {
ensureTracksHidden();
+ setupTracks();
};
video.addEventListener("loadedmetadata", handleLoadedMetadata);
diff --git a/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsx b/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsx
index 772f0ffd2..b3383bca4 100644
--- a/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsx
+++ b/apps/web/app/s/[videoId]/_components/tabs/Transcript.tsx
@@ -533,7 +533,62 @@ export const Transcript: React.FC<TranscriptProps> = ({ data, onSeek }) => {
return (
<div className="flex flex-col h-full">
<div className="p-4 border-b border-gray-3">
- <div className="flex gap-2 justify-between items-center">
+ <div className="flex flex-col gap-3">
+ <div className="flex gap-2 justify-end">
+ <Button
+ onClick={copyTranscriptToClipboard}
+ disabled={isCopying || transcriptData.length === 0}
+ variant="white"
+ size="xs"
+ spinner={isCopying}
+ >
+ {!copyPressed ? (
+ <Copy className="mr-1 w-3 h-3" />
+ ) : (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ width="12"
+ height="12"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ className="mr-1 w-3 h-3 svgpathanimation"
+ >
+ <path d="M20 6 9 17l-5-5" />
+ </svg>
+ )}
+ {copyPressed ? "Copied" : "Copy Transcript"}
+ </Button>
+ <Button
+ onClick={downloadTranscriptFile}
+ disabled={transcriptData.length === 0}
+ variant="white"
+ size="xs"
+ >
+ {!downloadPressed ? (
+ <Download className="mr-1 w-3 h-3" />
+ ) : (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ width="12"
+ height="12"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ className="mr-1 w-3 h-3 svgpathanimation"
+ >
+ <path d="M20 6 9 17l-5-5" />
+ </svg>
+ )}
+ {downloadPressed ? "Downloaded" : "Download"}
+ </Button>
+ </div>
<div className="relative" ref={languageMenuRef}>
<button
onClick={() => setShowLanguageMenu(!showLanguageMenu)}
@@ -590,61 +645,6 @@ export const Transcript: React.FC<TranscriptProps> = ({ data, onSeek }) => {
</div>
)}
</div>
- <div className="flex gap-2">
- <Button
- onClick={copyTranscriptToClipboard}
- disabled={isCopying || transcriptData.length === 0}
- variant="white"
- size="xs"
- spinner={isCopying}
- >
- {!copyPressed ? (
- <Copy className="mr-1 w-3 h-3" />
- ) : (
- <svg
- xmlns="http://www.w3.org/2000/svg"
- width="12"
- height="12"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- className="mr-1 w-3 h-3 svgpathanimation"
- >
- <path d="M20 6 9 17l-5-5" />
- </svg>
- )}
- {copyPressed ? "Copied" : "Copy Transcript"}
- </Button>
- <Button
- onClick={downloadTranscriptFile}
- disabled={transcriptData.length === 0}
- variant="white"
- size="xs"
- >
- {!downloadPressed ? (
- <Download className="mr-1 w-3 h-3" />
- ) : (
- <svg
- xmlns="http://www.w3.org/2000/svg"
- width="12"
- height="12"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- className="mr-1 w-3 h-3 svgpathanimation"
- >
- <path d="M20 6 9 17l-5-5" />
- </svg>
- )}
- {downloadPressed ? "Downloaded" : "Download"}
- </Button>
- </div>
</div>
</div>