Skip to content

Commit

Permalink
Merge pull request #58 from suvarnakale/main
Browse files Browse the repository at this point in the history
Issue #PS-2281 feat: exposing players from workspace
  • Loading branch information
itsvick authored Oct 25, 2024
2 parents 96e9b42 + ae789da commit d9caa2f
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 3 deletions.
5 changes: 2 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -18,7 +17,6 @@ const routes = {
GENERIC_EDITOR: "/generic-editor/:path*",
},
},

};

/** @type {import('next').NextConfig} */
Expand Down Expand Up @@ -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",
},
})
);
Expand Down
54 changes: 54 additions & 0 deletions src/pages/sunbirdPlayers.tsx
Original file line number Diff line number Diff line change
@@ -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 <SunbirdPdfPlayer playerConfig={playerConfig} />;
case "video/mp4":
return <SunbirdVideoPlayer playerConfig={playerConfig} />;
case "application/vnd.sunbird.questionset":
return <SunbirdQuMLPlayer playerConfig={playerConfig} />;
case "application/epub":
return <SunbirdEpubPlayer playerConfig={playerConfig} />;
default:
return <div>Unsupported media type</div>;
}
};

export default SunbirdPlayers;

0 comments on commit d9caa2f

Please sign in to comment.