Merge branch 'develop' of https://github.com/frappe/lms into develop

This commit is contained in:
Jannat Patel
2025-05-15 09:40:09 +05:30
2 changed files with 23 additions and 21 deletions

View File

@@ -334,7 +334,6 @@ const props = defineProps({
onMounted(() => { onMounted(() => {
startTimer() startTimer()
enablePlyr()
document.addEventListener('fullscreenchange', attachFullscreenEvent) document.addEventListener('fullscreenchange', attachFullscreenEvent)
}) })
@@ -473,6 +472,7 @@ watch(
() => lesson.data, () => lesson.data,
(data) => { (data) => {
setupLesson(data) setupLesson(data)
enablePlyr()
} }
) )

View File

@@ -531,12 +531,13 @@ export const enablePlyr = () => {
const videoElement = document.getElementsByClassName('video-player') const videoElement = document.getElementsByClassName('video-player')
if (videoElement.length === 0) return if (videoElement.length === 0) return
const src = videoElement[0].getAttribute('src') Array.from(videoElement).forEach((video) => {
const src = video.getAttribute('src')
if (src) { if (src) {
let videoID = src.split('/').pop() let videoID = src.split('/').pop()
videoElement[0].setAttribute('data-plyr-embed-id', videoID) video.setAttribute('data-plyr-embed-id', videoID)
} }
new Plyr('.video-player', { new Plyr(video, {
youtube: { youtube: {
noCookie: true, noCookie: true,
}, },
@@ -551,6 +552,7 @@ export const enablePlyr = () => {
], ],
}) })
}, 500) }, 500)
})
} }
export const openSettings = (category, close) => { export const openSettings = (category, close) => {