diff --git a/README.md b/README.md index 8ab474c1..3f4fbcc8 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,6 @@ - YT path redirects (So your redirect plugins should still work!) # Support table -Here’s the updated table with the "ffmpeg download merging" column completely removed: - | | Dash | HLS | Local video fallback | API-Extended | Dearrow | RYD | |---------|------|-----|----------------------|--------------|---------|-----| | Web | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | diff --git a/materialious/src/lib/Player.svelte b/materialious/src/lib/Player.svelte index c94e16bb..4f6d28b6 100644 --- a/materialious/src/lib/Player.svelte +++ b/materialious/src/lib/Player.svelte @@ -18,6 +18,7 @@ import type { VideoPlay } from './api/model'; import { getBestThumbnail, + padTime, proxyVideoUrl, pullBitratePreference, videoLength, @@ -223,7 +224,7 @@ endTime = data.content.timestamps[timestampIndex + 1].timePretty; } - chapterWebVTT += `${timestamp.timePretty} --> ${endTime}\n${timestamp.title.replaceAll('-', '').trim()}\n\n`; + chapterWebVTT += `${padTime(timestamp.timePretty)} --> ${padTime(endTime)}\n${timestamp.title.replaceAll('-', '').trim()}\n\n`; timestampIndex += 1; }); diff --git a/materialious/src/lib/VideoList.svelte b/materialious/src/lib/VideoList.svelte index 75921f7e..7b871469 100644 --- a/materialious/src/lib/VideoList.svelte +++ b/materialious/src/lib/VideoList.svelte @@ -13,7 +13,6 @@ let hiddenVideos: string[] = []; let auth = get(authStore); - let largeCol = '2'; async function removePlaylistItem(indexId: string, videoId: string) { if (!playlistId) return; diff --git a/materialious/src/lib/misc.ts b/materialious/src/lib/misc.ts index b75ab48d..b1044213 100644 --- a/materialious/src/lib/misc.ts +++ b/materialious/src/lib/misc.ts @@ -107,6 +107,30 @@ export interface PhasedDescription { timestamps: { title: string; time: number; timePretty: string; }[]; } +export function padTime(time: string): string { + let timeParts = time.split(':'); + + if (timeParts.length < 3) { + timeParts = ('00:' + time).split(':'); + } + + const hours = (timeParts[0] || '0').padStart(2, '0'); + const minutes = (timeParts[1] || '0').padStart(2, '0'); + + let seconds = timeParts[2] || '0'; + let milliseconds = ''; + + if (seconds.includes('.')) { + const [sec, ms] = seconds.split('.'); + seconds = sec.padStart(2, '0'); + milliseconds = `.${ms.padStart(3, '0')}`; + } else { + seconds = seconds.padStart(2, '0'); + } + + return `${hours}:${minutes}:${seconds}${milliseconds}`; +} + export function decodeHtmlCharCodes(str: string): string { const { decode } = he; return decode(str); diff --git a/materialious/vite.config.ts b/materialious/vite.config.ts index ae382a86..3d713b82 100644 --- a/materialious/vite.config.ts +++ b/materialious/vite.config.ts @@ -37,9 +37,6 @@ export default defineConfig({ vidstack(), sveltekit() ], - optimizeDeps: { - exclude: ['@ffmpeg/ffmpeg', '@ffmpeg/util'], - }, ssr: { noExternal: ['beercss'] }