mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 17:46:06 +00:00
feat(share): add video-level secure share links with password unlock and session-based watch/comment access
This commit is contained in:
@@ -1,16 +1,23 @@
|
||||
'use client';
|
||||
|
||||
import { useParams } from 'next/navigation';
|
||||
import { VideoPageContent } from '@/components/video-page-content';
|
||||
import { ShareLinkBootstrap } from '@/components/share-link-bootstrap';
|
||||
import { ShareLinkUnlock } from '@/components/share-link-unlock';
|
||||
|
||||
export default function WatchPage() {
|
||||
const params = useParams();
|
||||
const videoId = params.videoId as string;
|
||||
|
||||
return (
|
||||
<VideoPageContent
|
||||
mode="watch"
|
||||
videoId={videoId}
|
||||
/>
|
||||
);
|
||||
interface WatchPageProps {
|
||||
params: Promise<{ videoId: string }>;
|
||||
searchParams: Promise<{ shareToken?: string; unlock?: string }>;
|
||||
}
|
||||
|
||||
export default async function WatchPage({ params, searchParams }: WatchPageProps) {
|
||||
const { videoId } = await params;
|
||||
const { shareToken, unlock } = await searchParams;
|
||||
|
||||
if (typeof shareToken === 'string' && shareToken.length > 0) {
|
||||
return <ShareLinkBootstrap videoId={videoId} shareToken={shareToken} />;
|
||||
}
|
||||
|
||||
if (unlock === '1') {
|
||||
return <ShareLinkUnlock videoId={videoId} />;
|
||||
}
|
||||
|
||||
return <VideoPageContent mode="watch" videoId={videoId} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user