2023-02-24 14:43:33 +00:00
|
|
|
import type { PlayerElement } from '$lib/types/types';
|
2023-02-24 13:47:07 +00:00
|
|
|
import { writable } from 'svelte/store';
|
|
|
|
|
|
2023-02-24 14:01:43 +00:00
|
|
|
export const audio_element = writable<PlayerElement>();
|
2023-02-24 14:43:33 +00:00
|
|
|
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_current_time = writable<number>(0);
|
|
|
|
|
export const audio_muted = writable<boolean>(false);
|
|
|
|
|
export const audio_playback_rate = writable<number>(1);
|
|
|
|
|
export const audio_src = writable<string>('');
|
|
|
|
|
export const audio_volume = writable<number>(1);
|
|
|
|
|
|
|
|
|
|
export type PlayerMetadata = {
|
|
|
|
|
duration: number;
|
|
|
|
|
// muted: boolean;
|
|
|
|
|
paused: boolean;
|
|
|
|
|
// playbackRate: number;
|
|
|
|
|
loading: boolean;
|
|
|
|
|
ended: boolean;
|
|
|
|
|
};
|
2023-02-24 14:01:43 +00:00
|
|
|
|
2023-02-24 13:47:07 +00:00
|
|
|
export const audio_metadata = writable<PlayerMetadata>({
|
|
|
|
|
duration: 0,
|
2023-02-24 14:43:33 +00:00
|
|
|
ended: false,
|
2023-02-24 13:47:07 +00:00
|
|
|
loading: false,
|
2023-02-24 14:43:33 +00:00
|
|
|
paused: true,
|
|
|
|
|
// muted: false,
|
|
|
|
|
// playbackRate: 1,
|
2023-02-24 13:47:07 +00:00
|
|
|
});
|