mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-21 16:11:57 +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",
|
"name": "ui",
|
||||||
"version": "6.4.148",
|
"version": "6.4.149",
|
||||||
"license": "BUSL-1.1",
|
"license": "BUSL-1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@9.15.5",
|
"packageManager": "pnpm@9.15.5",
|
||||||
|
|
|
||||||
|
|
@ -42,10 +42,10 @@
|
||||||
<PencilLine class='size-4' />
|
<PencilLine class='size-4' />
|
||||||
</Button>
|
</Button>
|
||||||
</Dialog.Trigger>
|
</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='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'>
|
<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>
|
</div>
|
||||||
<form class='flex flex-col w-full rounded-r-lg h-full'>
|
<form class='flex flex-col w-full rounded-r-lg h-full'>
|
||||||
<div class='pt-4 px-5 w-full'>
|
<div class='pt-4 px-5 w-full'>
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,12 @@
|
||||||
let currentTime = 0
|
let currentTime = 0
|
||||||
let seekPercent = 0
|
let seekPercent = 0
|
||||||
let duration = 1
|
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 buffered: SvelteMediaTimeRange[] = []
|
||||||
let subtitleDelay = 0
|
let subtitleDelay = 0
|
||||||
$: buffer = Math.max(...buffered.map(({ end }) => end))
|
$: buffer = Math.max(...buffered.map(({ end }) => end))
|
||||||
|
|
@ -604,14 +609,14 @@
|
||||||
desc: 'Volume Down'
|
desc: 'Volume Down'
|
||||||
},
|
},
|
||||||
BracketLeft: {
|
BracketLeft: {
|
||||||
fn: () => { $playbackRate -= 0.1 },
|
fn: () => { $playbackRate = Math.min(16, Math.max(0.1, $playbackRate - 0.1)) },
|
||||||
id: 'history',
|
id: 'history',
|
||||||
icon: RotateCcw,
|
icon: RotateCcw,
|
||||||
type: 'icon',
|
type: 'icon',
|
||||||
desc: 'Decrease Playback Rate'
|
desc: 'Decrease Playback Rate'
|
||||||
},
|
},
|
||||||
BracketRight: {
|
BracketRight: {
|
||||||
fn: () => { $playbackRate += 0.1 },
|
fn: () => { $playbackRate = Math.min(16, Math.max(0.1, $playbackRate + 0.1)) },
|
||||||
id: 'update',
|
id: 'update',
|
||||||
icon: RotateCw,
|
icon: RotateCw,
|
||||||
type: 'icon',
|
type: 'icon',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue