dispatch ui events

This commit is contained in:
Yanzhen Yu
2020-08-21 18:33:24 +08:00
parent a24e376271
commit 6c9a48919b
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;