mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: improve YouTube videoIds detection
This commit is contained in:
parent
d703bb1865
commit
47a96d84d2
3 changed files with 10 additions and 1 deletions
|
|
@ -25,7 +25,8 @@ function VideoActivity({ activity, course }: { activity: any; course: any }) {
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (activity && activity.content && activity.content.uri) {
|
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])
|
}, [activity, org])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
"formik": "^2.4.5",
|
"formik": "^2.4.5",
|
||||||
"framer-motion": "^10.18.0",
|
"framer-motion": "^10.18.0",
|
||||||
|
"get-youtube-id": "^1.0.1",
|
||||||
"highlight.js": "^11.9.0",
|
"highlight.js": "^11.9.0",
|
||||||
"katex": "^0.16.10",
|
"katex": "^0.16.10",
|
||||||
"lowlight": "^3.1.0",
|
"lowlight": "^3.1.0",
|
||||||
|
|
|
||||||
7
apps/web/pnpm-lock.yaml
generated
7
apps/web/pnpm-lock.yaml
generated
|
|
@ -74,6 +74,9 @@ dependencies:
|
||||||
framer-motion:
|
framer-motion:
|
||||||
specifier: ^10.18.0
|
specifier: ^10.18.0
|
||||||
version: 10.18.0(react-dom@18.2.0)(react@18.2.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:
|
highlight.js:
|
||||||
specifier: ^11.9.0
|
specifier: ^11.9.0
|
||||||
version: 11.9.0
|
version: 11.9.0
|
||||||
|
|
@ -2915,6 +2918,10 @@ packages:
|
||||||
resolve-pkg-maps: 1.0.0
|
resolve-pkg-maps: 1.0.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/get-youtube-id@1.0.1:
|
||||||
|
resolution: {integrity: sha512-5yidLzoLXbtw82a/Wb7LrajkGn29BM6JuLWeHyNfzOGp1weGyW4+7eMz6cP23+etqj27VlOFtq8fFFDMLq/FXQ==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/glob-parent@5.1.2:
|
/glob-parent@5.1.2:
|
||||||
resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
|
resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
|
||||||
engines: {node: '>= 6'}
|
engines: {node: '>= 6'}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue