-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from suvarnakale/main
Issue #PS-2281 feat: exposing players from workspace
- Loading branch information
Showing
2 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |