diff --git a/public/index.html b/public/index.html index 56ec245e..e05b1b83 100644 --- a/public/index.html +++ b/public/index.html @@ -26,6 +26,7 @@ autoPlay: false, }, }); + window.$c = component; component.addEventListener('finish', () => console.log('finish')); diff --git a/src/Controller.svelte b/src/Controller.svelte index 3140f199..22e30c58 100644 --- a/src/Controller.svelte +++ b/src/Controller.svelte @@ -102,7 +102,7 @@ } }; - const toggle = () => { + export const toggle = () => { switch (playerState) { case 'playing': replayer.pause(); @@ -142,7 +142,7 @@ } }; - const setSpeed = (newSpeed: number) => { + export const setSpeed = (newSpeed: number) => { let needFreeze = playerState === 'playing'; speed = newSpeed; if (needFreeze) { @@ -154,6 +154,10 @@ } }; + export const toggleSkipInactive = () => { + skipInactive = !skipInactive; + }; + onMount(() => { playerState = replayer.service.state.value as typeof playerState; speedState = replayer.speedService.state.value as typeof speedState; @@ -320,7 +324,7 @@