From 12a08f9bb781600c7dd7bb5c8192a0544f7fc4b2 Mon Sep 17 00:00:00 2001 From: ThaUnknown <6506529+ThaUnknown@users.noreply.github.com> Date: Sat, 24 May 2025 19:46:46 +0200 Subject: [PATCH] feat: improve player navigation --- package.json | 2 +- src/lib/components/ui/player/options.svelte | 10 ++++++---- src/lib/components/ui/player/player.svelte | 20 ++++++++++---------- src/lib/components/ui/player/seekbar.svelte | 3 ++- src/lib/components/ui/player/volume.svelte | 3 ++- src/lib/components/ui/tree/sub.svelte | 11 ++++++++++- src/lib/modules/navigate.ts | 14 ++++++++++---- 7 files changed, 41 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index d9b34ac..7e103dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ui", - "version": "6.3.23", + "version": "6.3.24", "license": "BUSL-1.1", "private": true, "packageManager": "pnpm@9.14.4", diff --git a/src/lib/components/ui/player/options.svelte b/src/lib/components/ui/player/options.svelte index 50d50d8..b706de8 100644 --- a/src/lib/components/ui/player/options.svelte +++ b/src/lib/components/ui/player/options.svelte @@ -15,7 +15,7 @@ import * as Dialog from '$lib/components/ui/dialog' import * as Tooltip from '$lib/components/ui/tooltip' import * as Tree from '$lib/components/ui/tree' - import { dragScroll } from '$lib/modules/navigate' + import { dragScroll, keywrap } from '$lib/modules/navigate' import { settings } from '$lib/modules/settings' import { cn, toTS } from '$lib/utils' @@ -65,11 +65,13 @@ } let fullscreenElement: HTMLElement | null = null + + export let id = '' - @@ -156,7 +158,7 @@ {#each chapters as { text, start }, i (i)} { seekTo(start); open = false }}> -
+
{text || '?'} {toTS(start || 0)}
@@ -192,7 +194,7 @@ Playlist - + {#each videoFiles as file, i (i)} selectFile(file)}> diff --git a/src/lib/components/ui/player/player.svelte b/src/lib/components/ui/player/player.svelte index 74439d2..09e97b9 100644 --- a/src/lib/components/ui/player/player.svelte +++ b/src/lib/components/ui/player/player.svelte @@ -54,7 +54,7 @@ import { authAggregator } from '$lib/modules/auth' import { isPlaying } from '$lib/modules/idle' import native from '$lib/modules/native' - import { click } from '$lib/modules/navigate' + import { click, keywrap } from '$lib/modules/navigate' import { settings } from '$lib/modules/settings' import { server } from '$lib/modules/torrent' import { w2globby } from '$lib/modules/w2g/lobby' @@ -420,7 +420,7 @@ $: if (readyState && !seekIndex) thumbnailer._paintThumbnail(video, playbackIndex) $: native.setMediaSession(mediaInfo.session, mediaInfo.media.id) - $: native.setPositionState({ duration: safeduration, position: Math.max(0, currentTime), playbackRate }) + $: native.setPositionState({ duration: safeduration, position: Math.min(Math.max(0, currentTime), safeduration), playbackRate }) $: native.setPlayBackState(readyState === 0 ? 'none' : paused ? 'paused' : 'playing') native.setActionHandler('play', playPause) native.setActionHandler('pause', playPause) @@ -790,7 +790,7 @@
- {#if prev} - {/if} {#if next} - {/if}
- + {#if subtitles} - {/if} - {#if false} - {/if} -