diff --git a/apps/web/components/Objects/Activities/Video/Video.tsx b/apps/web/components/Objects/Activities/Video/Video.tsx index bcf7e8eb..f2d205d8 100644 --- a/apps/web/components/Objects/Activities/Video/Video.tsx +++ b/apps/web/components/Objects/Activities/Video/Video.tsx @@ -25,7 +25,8 @@ function VideoActivity({ activity, course }: { activity: any; course: any }) { React.useEffect(() => { if (activity && activity.content && activity.content.uri) { - setVideoId(getYouTubeEmbed(activity.content.uri).videoId) + var getYouTubeID = require('get-youtube-id'); + setVideoId(getYouTubeID(activity.content.uri)) } }, [activity, org]) diff --git a/apps/web/package.json b/apps/web/package.json index 1abb18c2..867ddd4b 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -33,6 +33,7 @@ "dayjs": "^1.11.10", "formik": "^2.4.5", "framer-motion": "^10.18.0", + "get-youtube-id": "^1.0.1", "highlight.js": "^11.9.0", "katex": "^0.16.10", "lowlight": "^3.1.0", diff --git a/apps/web/pnpm-lock.yaml b/apps/web/pnpm-lock.yaml index 5e76036b..352e3f66 100644 --- a/apps/web/pnpm-lock.yaml +++ b/apps/web/pnpm-lock.yaml @@ -74,6 +74,9 @@ dependencies: framer-motion: specifier: ^10.18.0 version: 10.18.0(react-dom@18.2.0)(react@18.2.0) + get-youtube-id: + specifier: ^1.0.1 + version: 1.0.1 highlight.js: specifier: ^11.9.0 version: 11.9.0 @@ -2915,6 +2918,10 @@ packages: resolve-pkg-maps: 1.0.0 dev: true + /get-youtube-id@1.0.1: + resolution: {integrity: sha512-5yidLzoLXbtw82a/Wb7LrajkGn29BM6JuLWeHyNfzOGp1weGyW4+7eMz6cP23+etqj27VlOFtq8fFFDMLq/FXQ==} + dev: false + /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'}