1.1.0 • Published 2 years ago

svelte-lite-youtube-embed v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Svelte Lite YouTube Embed

Port of Paul Irish's Lite YouTube Embed to Svelte.

Install

npm install svelte-lite-youtube-embed

Basic Usage

<script>
  import LiteYouTube from 'svelte-lite-youtube-embed'
</script>

<LiteYouTube
  videoId="AdNJ3fydeao"
  videoTitle="Rich Harris - Rethinking reactivity"
/>

Pro Usage

<script>
  import LiteYouTube from 'svelte-lite-youtube-embed'
</script>

<LiteYouTube
  videoId="VLrYOji75Vc"
  videoTitle="Speed at Scale"
  playlistId="PL-G5r6j4GptH5JTveoLTVqpp7w2oc27Q9"
  params="enablejsapi=1"
  posterQuality="hqdefault"
  on:iframeLoaded={(e) => console.log(e.detail.iframe)}
/>

Options & events

PropTypeDescription
videoIdstringId of the video
videoTitlestringTitle of the video
videoPlaystringDefault: Play. This will be added to the button label for the announcement: "{videoPlay}: {videoTitle}"
posterQualitystring. One of default, mqdefault, hqdefault, sddefault, maxresdefaultQuality of the poster image
paramsstringAny params to pass to the URL
playlistIdstringId of the playlist. Note, videoId is still needed to display the poster
noCookiebooleanDefault: true. Use youtube-nocookie.com domain (instead of youtube.com) to prevent cookie tracking
posterLoadingstring. One of lazy, eagerDefault: lazy. Loading attribute value of poster img element
on:iframeLoadedfunctionCallback that will fired when iframe loads

License

MIT License

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago