From ae789daecbed095d042605b65395ca3b8f61fd6b Mon Sep 17 00:00:00 2001 From: suvarnakale Date: Fri, 25 Oct 2024 12:02:57 +0530 Subject: [PATCH] Issue #PS-2281 feat: exposing players from workspace --- next.config.js | 5 ++-- src/pages/sunbirdPlayers.tsx | 54 ++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 src/pages/sunbirdPlayers.tsx diff --git a/next.config.js b/next.config.js index a21294f..63e1e37 100644 --- a/next.config.js +++ b/next.config.js @@ -7,8 +7,7 @@ const remotes = (isServer) => { }; }; -const PORTAL_BASE_URL = 'https://sunbird-editor.tekdinext.com' - +const PORTAL_BASE_URL = "https://sunbird-editor.tekdinext.com"; const routes = { API: { @@ -18,7 +17,6 @@ const routes = { GENERIC_EDITOR: "/generic-editor/:path*", }, }, - }; /** @type {import('next').NextConfig} */ @@ -126,6 +124,7 @@ const nextConfig = { "./Editor": "/src/pages/editor.tsx", "./UploadEditor": "/src/pages/upload-editor.tsx", "./Collection": "/src/pages/collection.tsx", + "./SunbirdPlayers": "/src/pages/sunbirdPlayers.tsx", }, }) ); diff --git a/src/pages/sunbirdPlayers.tsx b/src/pages/sunbirdPlayers.tsx new file mode 100644 index 0000000..8348f8d --- /dev/null +++ b/src/pages/sunbirdPlayers.tsx @@ -0,0 +1,54 @@ +import dynamic from "next/dynamic"; +import React from "react"; + +const SunbirdPdfPlayer = dynamic( + () => import("@/components/players/SunbirdPdfPlayer"), + { + ssr: false, + } +); + +const SunbirdVideoPlayer = dynamic( + () => import("@/components/players/SunbirdVideoPlayer"), + { + ssr: false, + } +); +const SunbirdEpubPlayer = dynamic( + () => import("@/components/players/SunbirdEpubPlayer"), + { + ssr: false, + } +); + +const SunbirdQuMLPlayer = dynamic( + () => import("@/components/players/SunbirdQuMLPlayer"), + { + ssr: false, + } +); + +interface PlayerProps { + playerConfig: any; + identifier: string; +} + +const SunbirdPlayers = ({ playerConfig }: PlayerProps) => { + console.log("workspace playerconfig", playerConfig); + + const mimeType = playerConfig.metadata.mimeType; + switch (mimeType) { + case "application/pdf": + return ; + case "video/mp4": + return ; + case "application/vnd.sunbird.questionset": + return ; + case "application/epub": + return ; + default: + return
Unsupported media type
; + } +}; + +export default SunbirdPlayers;