fix: adjust embedded video player style

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2025-05-15 20:29:55 +07:00
parent 53f02fac18
commit 4e186d785e
No known key found for this signature in database
GPG Key ID: 3320C3B3324E934C
4 changed files with 27 additions and 6 deletions

View File

@ -21,14 +21,23 @@
export let src: string
export let hlsSrc: string
export let hlsThumbnail = ''
export let name: string | undefined = undefined
export let preload = true
let video: HTMLVideoElement | null = null
let hls: HLS | null = null
let player: Plyr | null = null
const options: Plyr.Options = {}
const options: Plyr.Options = {
controls: [
'play-large',
'play',
'progress',
'current-time',
'volume',
'settings',
'fullscreen'
]
}
function initialize (src: string): void {
if (video === null) {
@ -151,7 +160,14 @@
</script>
<!-- svelte-ignore a11y-media-has-caption -->
<video bind:this={video} width="100%" height="100%" preload={preload ? 'auto' : 'none'} controls />
<video
bind:this={video}
width="100%"
height="100%"
preload={preload ? 'auto' : 'none'}
controls
disablepictureinpicture
/>
<style lang="scss">
video {
@ -166,5 +182,9 @@
video::-webkit-media-controls-enclosure {
visibility: visible;
}
@import 'plyr/dist/plyr.css';
:global(.plyr) {
min-width: 10rem;
}
</style>

View File

@ -32,7 +32,7 @@
}
const minSizeRem = 4
const maxSizeRem = 20
const maxSizeRem = 25
let dimensions: Dimensions

View File

@ -61,6 +61,6 @@
.gallery {
display: grid;
grid-gap: 0.75rem;
grid-template-columns: repeat(auto-fill, 20rem);
grid-template-columns: repeat(auto-fill, 25rem);
}
</style>

View File

@ -67,7 +67,7 @@
{@const src = getFileUrl(file, name)}
{#if meta?.hls?.source !== undefined}
<HlsVideo {src} {preload} hlsSrc={meta.hls.source} hlsThumbnail={meta.hls.thumbnail} {name} />
<HlsVideo {src} {preload} hlsSrc={meta.hls.source} hlsThumbnail={meta.hls.thumbnail} />
{:else}
<Video {src} {preload} {name} />
{/if}
@ -79,5 +79,6 @@
min-width: 10rem;
min-height: 10rem;
border-radius: 0.75rem;
overflow: hidden;
}
</style>