From 1a2b06f4763e927db645aa7230f36cc7ce44610f Mon Sep 17 00:00:00 2001 From: Dorian Koch <doriank@fsmpi.rwth-aachen.de> Date: Sat, 21 Sep 2024 14:32:46 +0200 Subject: [PATCH] Work around third-party cookie restrictions, closes #41 --- src/components/Player.tsx | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/components/Player.tsx b/src/components/Player.tsx index 18c7d70..ce0a0ba 100644 --- a/src/components/Player.tsx +++ b/src/components/Player.tsx @@ -749,18 +749,28 @@ export function EmbeddedPlayer({ playerData }: { playerData: ResourceType<Player ); } - let pageContent = ( - <AuthorizeHelper - lecture={lecture} - course={course} - authed_methods={perms.authenticated_methods} - /> - ); - if (perms.is_lecture_authenticated) { - pageContent = <VideoPlayer lecture={lecture} className="h-100" />; + if (!perms.is_lecture_authenticated) { + // Show link to page + return ( + <div className="h-100 w-100 d-flex flex-column justify-content-center"> + <div className="text-center"> + <img alt="VideoAG" src={`${basePath}/static/logo.png`} width={44} height={44} /> + </div> + + <div className="alert alert-warning m-2" role="alert"> + Dieses Video ist nicht öffentlich verfügbar. Bitte{" "} + <a + href={`https://video.fsmpi.rwth-aachen.de/${course.id_string}/${lecture.id}`} + > + öffnen Sie die Seite + </a>{" "} + um das Video zu sehen. + </div> + </div> + ); } - return <>{pageContent} </>; + return <VideoPlayer lecture={lecture} className="h-100" />; } export default function Player({ playerData }: { playerData: ResourceType<PlayerData> }) { -- GitLab