feat: prevent skipping videos

This commit is contained in:
Jannat Patel
2025-07-01 17:27:43 +05:30
parent 2837ed16a7
commit 94cbbf169a
7 changed files with 65 additions and 33 deletions

View File

@@ -1,4 +1,3 @@
import { watch } from 'vue'
import { call, toast } from 'frappe-ui'
import { useTimeAgo } from '@vueuse/core'
import { Quiz } from '@/utils/quiz'
@@ -557,17 +556,23 @@ const setupPlyrForVideo = (video, players) => {
video.setAttribute('data-plyr-embed-id', videoID)
}
let controls = [
'play-large',
'play',
'progress',
'current-time',
'mute',
'volume',
'fullscreen',
]
if (useSettings().preventSkippingVideos.data) {
controls.splice(controls.indexOf('progress'), 1)
}
const player = new Plyr(video, {
youtube: { noCookie: true },
controls: [
'play-large',
'play',
'progress',
'current-time',
'mute',
'volume',
'fullscreen',
],
controls: controls,
})
players.push(player)