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(() => {
startTimer()
enablePlyr()
document.addEventListener('fullscreenchange', attachFullscreenEvent)
})
@@ -473,6 +472,7 @@ watch(
() => lesson.data,
(data) => {
setupLesson(data)
enablePlyr()
}
)

View File

@@ -531,26 +531,28 @@ export const enablePlyr = () => {
const videoElement = document.getElementsByClassName('video-player')
if (videoElement.length === 0) return
const src = videoElement[0].getAttribute('src')
if (src) {
let videoID = src.split('/').pop()
videoElement[0].setAttribute('data-plyr-embed-id', videoID)
}
new Plyr('.video-player', {
youtube: {
noCookie: true,
},
controls: [
'play-large',
'play',
'progress',
'current-time',
'mute',
'volume',
'fullscreen',
],
})
}, 500)
Array.from(videoElement).forEach((video) => {
const src = video.getAttribute('src')
if (src) {
let videoID = src.split('/').pop()
video.setAttribute('data-plyr-embed-id', videoID)
}
new Plyr(video, {
youtube: {
noCookie: true,
},
controls: [
'play-large',
'play',
'progress',
'current-time',
'mute',
'volume',
'fullscreen',
],
})
}, 500)
})
}
export const openSettings = (category, close) => {