Skip to content

Commit

Permalink
Log events
Browse files Browse the repository at this point in the history
  • Loading branch information
PandaWhisperer committed Jan 6, 2020
1 parent 1d616ad commit 3475ef0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion examples/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@
import YouTube from '../../src/index.svelte';
export let videoId;
function logEvent(name) {
return (event) => console.log(`Event received: ${name}`, event.detail);
}
</script>

<main>
<h1>Svelte-YouTube</h1>
<p>Embedding a single video:</p>
<YouTube {videoId} />
<YouTube {videoId}
on:ready={logEvent('ready')}
on:play={logEvent('play')}
on:pause={logEvent('pause')}
on:end={logEvent('end')}
/>
</main>

<style>
Expand Down

0 comments on commit 3475ef0

Please sign in to comment.