This commit is contained in:
ThatOneCalculator 2022-07-13 22:54:33 -07:00
parent dd1a8c6f5d
commit a0cbc9ba9d
2 changed files with 8 additions and 3 deletions

View file

@ -46,10 +46,12 @@ function volumechange() {
if (audioEl) ColdDeviceStorage.set('mediaVolume', audioEl.volume);
}
const playerInstance = ref();
onMounted(() => {
if (audioEl) {
audioEl.volume = ColdDeviceStorage.get('mediaVolume');
new Vlitejs('#player');
playerInstance.value = new Vlitejs('#player');
}
});
</script>

View file

@ -8,6 +8,7 @@
<div v-else class="kkjnbbplepmiyuadieoenjgutgcmtsvu">
<video
id="player"
ref="videoEl"
:poster="video.thumbnailUrl"
:title="video.comment"
:alt="video.comment"
@ -38,11 +39,13 @@ const props = defineProps<{
}>();
const videoEl = $ref<HTMLVideoElement | null>();
Vlitejs.registerPlugin('pip', VlitejsPip);
const playerInstance = ref();
onMounted(() => {
if (videoEl) {
Vlitejs.registerPlugin('pip', VlitejsPip);
new Vlitejs('#player', {
playerInstance.value = new Vlitejs(videoEl, {
plugins: ['pip'],
});
}