dispatch ui events

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent ee5727a5f8
commit 4e1525a05e
3 changed files with 17 additions and 2 deletions

View File

@@ -26,6 +26,9 @@
export let tags: Record<string, string> = {};
let currentTime = 0;
$: {
dispatch('ui-update-current-time', { payload: currentTime });
}
let timer: number | null = null;
let playerState: 'playing' | 'paused' | 'live';
let speedState: 'normal' | 'skipping';
@@ -39,6 +42,7 @@
$: {
const percent = Math.min(1, currentTime / meta.totalTime);
percentage = `${100 * percent}%`;
dispatch('ui-update-progress', { payload: percent });
}
type CustomEvent = {
name: string;