mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-03-11 22:15:35 +00:00
fix: playbackRate bounds, score scroll
This commit is contained in:
parent
7bfdd4ab79
commit
7da60e252a
3 changed files with 11 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ui",
|
||||
"version": "6.4.148",
|
||||
"version": "6.4.149",
|
||||
"license": "BUSL-1.1",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@9.15.5",
|
||||
|
|
|
|||
|
|
@ -42,10 +42,10 @@
|
|||
<PencilLine class='size-4' />
|
||||
</Button>
|
||||
</Dialog.Trigger>
|
||||
<Dialog.Content class='flex justify-center max-h-[80%] max-w-3xl p-0 overflow-clip'>
|
||||
<Dialog.Content class='flex justify-center max-h-[80%] max-w-3xl p-0'>
|
||||
<div class='flex flex-col sm:flex-row w-full overflow-y-auto' use:dragScroll>
|
||||
<div class='relative w-full h-[150px] sm:w-[260px] sm:h-[400px] shrink-0'>
|
||||
<img alt='images' loading='lazy' decoding='async' class='object-cover w-full h-full' style:background={media.coverImage?.color ?? '#000'} src={$breakpoints.sm ? cover(media) : banner(media)} />
|
||||
<img alt='images' loading='lazy' decoding='async' class='object-cover w-full h-full sm:rounded-l-lg overflow-clip' style:background={media.coverImage?.color ?? '#000'} src={$breakpoints.sm ? cover(media) : banner(media)} />
|
||||
</div>
|
||||
<form class='flex flex-col w-full rounded-r-lg h-full'>
|
||||
<div class='pt-4 px-5 w-full'>
|
||||
|
|
|
|||
|
|
@ -73,7 +73,12 @@
|
|||
let currentTime = 0
|
||||
let seekPercent = 0
|
||||
let duration = 1
|
||||
const playbackRate = persisted('playbackRate', 1)
|
||||
const playbackRate = persisted('playbackRate', 1, {
|
||||
serializer: {
|
||||
stringify: (value) => value.toString(),
|
||||
parse: (value) => Math.min(16, Math.max(0.1, parseFloat(value)))
|
||||
}
|
||||
})
|
||||
let buffered: SvelteMediaTimeRange[] = []
|
||||
let subtitleDelay = 0
|
||||
$: buffer = Math.max(...buffered.map(({ end }) => end))
|
||||
|
|
@ -604,14 +609,14 @@
|
|||
desc: 'Volume Down'
|
||||
},
|
||||
BracketLeft: {
|
||||
fn: () => { $playbackRate -= 0.1 },
|
||||
fn: () => { $playbackRate = Math.min(16, Math.max(0.1, $playbackRate - 0.1)) },
|
||||
id: 'history',
|
||||
icon: RotateCcw,
|
||||
type: 'icon',
|
||||
desc: 'Decrease Playback Rate'
|
||||
},
|
||||
BracketRight: {
|
||||
fn: () => { $playbackRate += 0.1 },
|
||||
fn: () => { $playbackRate = Math.min(16, Math.max(0.1, $playbackRate + 0.1)) },
|
||||
id: 'update',
|
||||
icon: RotateCw,
|
||||
type: 'icon',
|
||||
|
|
|
|||
Loading…
Reference in a new issue