fix: detect editor change to enable plyr on newly added videos

This commit is contained in:
Jannat Patel
2025-04-25 11:18:19 +05:30
parent 66f28ef7a6
commit 63319d32e8
4 changed files with 40 additions and 7 deletions

View File

@@ -97,10 +97,12 @@ import {
import { sessionStore } from '../stores/session'
import EditorJS from '@editorjs/editorjs'
import LessonHelp from '@/components/LessonHelp.vue'
import { ChevronRight } from 'lucide-vue-next'
import { AppleIcon, ChevronRight } from 'lucide-vue-next'
import { createToast, getEditorTools } from '@/utils'
import { capture } from '@/telemetry'
import { useOnboarding } from 'frappe-ui/frappe'
import Plyr from 'plyr'
import 'plyr/dist/plyr.css'
const { brand } = sessionStore()
const editor = ref(null)
@@ -143,6 +145,9 @@ const renderEditor = (holder) => {
tools: getEditorTools(true),
autofocus: true,
defaultBlock: 'markdown',
onChange: async (api, event) => {
enablePlyr()
},
})
}
@@ -672,4 +677,30 @@ iframe {
.ce-popover-item[data-item-name='markdown'] {
display: none !important;
}
.plyr__volume input[type='range'] {
display: none;
}
.plyr__control--overlaid {
background: radial-gradient(
circle,
rgba(0, 0, 0, 0.4) 0%,
rgba(0, 0, 0, 0.5) 50%
);
}
.plyr__control:hover {
background: none;
}
.plyr--video {
border: 1px solid theme('colors.gray.200');
border-radius: 8px;
}
:root {
--plyr-range-fill-background: white;
--plyr-video-control-background-hover: transparent;
}
</style>