Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(share): propagate canRetryProcessing through ShareVideo and Share

Richie McIlroy47780d38b473
diff --git a/apps/web/app/s/[videoId]/Share.tsx b/apps/web/app/s/[videoId]/Share.tsx
index 6250d18cd..b1a1aedf7 100644
--- a/apps/web/app/s/[videoId]/Share.tsx
+++ b/apps/web/app/s/[videoId]/Share.tsx
@@ -439,6 +439,7 @@ export const Share = ({
areReactionStampsDisabled={areReactionStampsDisabled}
chapters={aiData?.chapters || []}
aiGenerationStatus={aiData?.aiGenerationStatus}
+ canRetryProcessing={viewerId === data.owner.id}
ref={playerRef}
/>
</div>
diff --git a/apps/web/app/s/[videoId]/_components/ShareVideo.tsx b/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
index f09c8b1ff..bcced03ad 100644
--- a/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
+++ b/apps/web/app/s/[videoId]/_components/ShareVideo.tsx
@@ -1,5 +1,4 @@
import type { comments as commentsSchema } from "@cap/database/schema";
-import type { VideoMetadata } from "@cap/database/types";
import { NODE_ENV } from "@cap/env";
import { Logo } from "@cap/ui";
import type { ImageUpload } from "@cap/web-domain";
@@ -8,7 +7,6 @@ import {
forwardRef,
useEffect,
useImperativeHandle,
- useMemo,
useRef,
useState,
} from "react";
@@ -19,12 +17,6 @@ import { CapVideoPlayer } from "./CapVideoPlayer";
import { HLSVideoPlayer } from "./HLSVideoPlayer";
import { formatChaptersAsVTT } from "./utils/transcript-utils";
-declare global {
- interface Window {
- MSStream: any;
- }
-}
-
type CommentWithAuthor = typeof commentsSchema.$inferSelect & {
authorName: string | null;
authorImage: ImageUpload.ImageUrl | null;
@@ -50,6 +42,7 @@ export const ShareVideo = forwardRef<
areCommentStampsDisabled?: boolean;
areReactionStampsDisabled?: boolean;
aiGenerationStatus?: AiGenerationStatus | null;
+ canRetryProcessing?: boolean;
}
>(
(
@@ -61,6 +54,7 @@ export const ShareVideo = forwardRef<
areChaptersDisabled,
areCommentStampsDisabled,
areReactionStampsDisabled,
+ canRetryProcessing,
},
ref,
) => {
@@ -241,6 +235,7 @@ export const ShareVideo = forwardRef<
availableCaptions={captionContext.availableTranslations}
isCaptionLoading={captionContext.isTranslating}
hasCaptions={data.transcriptionStatus === "COMPLETE"}
+ canRetryProcessing={canRetryProcessing}
/>
) : (
<HLSVideoPlayer
@@ -259,14 +254,16 @@ export const ShareVideo = forwardRef<
availableCaptions={captionContext.availableTranslations}
isCaptionLoading={captionContext.isTranslating}
hasCaptions={data.transcriptionStatus === "COMPLETE"}
+ canRetryProcessing={canRetryProcessing}
/>
)}
</div>
{!data.owner.isPro && (
<div className="absolute top-4 left-4 z-30">
- <div
- className="block cursor-pointer"
+ <button
+ type="button"
+ className="block"
onClick={(e) => {
e.stopPropagation();
setUpgradeModalOpen(true);
@@ -283,7 +280,7 @@ export const ShareVideo = forwardRef<
</p>
</div>
</div>
- </div>
+ </button>
</div>
)}
<UpgradeModal