File size: 497 Bytes
623fb1a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<script lang="ts">
	import type { HTMLAudioAttributes } from "svelte/elements";
	import { createEventDispatcher } from "svelte";
	interface Props extends HTMLAudioAttributes {
		"data-testid"?: string;
	}
	type $$Props = Props;

	export let src: HTMLAudioAttributes["src"] = undefined;

	const dispatch = createEventDispatcher();
</script>

<audio
	{src}
	{...$$restProps}
	on:play={dispatch.bind(null, "play")}
	on:pause={dispatch.bind(null, "pause")}
	on:ended={dispatch.bind(null, "ended")}
/>