2023-02-24 22:59:12 +00:00
|
|
|
import type { AudioPlayerElement } from '$lib/types';
|
2023-02-24 13:47:07 +00:00
|
|
|
import { writable } from 'svelte/store';
|
|
|
|
|
|
2023-02-24 15:38:08 +00:00
|
|
|
// readonly - stores will update when bindings change
|
|
|
|
|
export const audio_current_time = writable<number>(0);
|
2023-02-24 22:59:12 +00:00
|
|
|
export const audio_element = writable<AudioPlayerElement>();
|
2023-02-24 15:38:08 +00:00
|
|
|
export const audio_duration = writable<number>(0);
|
|
|
|
|
export const audio_ended = writable<boolean>(false);
|
|
|
|
|
export const audio_loading = writable<boolean>(false);
|
|
|
|
|
export const audio_paused = writable<boolean>(true);
|
2023-02-24 14:43:33 +00:00
|
|
|
|
2023-02-24 15:38:08 +00:00
|
|
|
// handlers - when store value changes, the binding will update the audio element
|
|
|
|
|
export const audio_start_at = writable<number>(0);
|
2023-02-24 14:01:43 +00:00
|
|
|
export const audio_autoplay = writable<boolean>(false);
|
2023-02-24 14:43:33 +00:00
|
|
|
export const audio_muted = writable<boolean>(false);
|
|
|
|
|
export const audio_src = writable<string>('');
|