From 5b3391e8c80a03609a38b99b31d5520a5f5a9691 Mon Sep 17 00:00:00 2001 From: Justin Ribeiro Date: Fri, 15 Nov 2024 10:35:31 -0800 Subject: [PATCH] v1.6.0 --- README.md | 36 +++++++++++++++++++++++++++++++++++- package.json | 4 ++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2b465ba..6ffcc5f 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ - _new in v1.3_: Adds `loading=lazy` to image placeholder for more perf with `posterloading` attr if you'd like to use eager - _new in v1.4_: Adds `short` attr for enabling experimental YouTube Shorts mobile interaction support. See (example video)[https://www.youtube.com/watch?v=aw7CRQTuRfo] for details. - _new in v1.5_: Adds support for nonce attribute via `window.liteYouTubeNonce` for CSP 2/3 support. +- _new in v1.6_: Adds `autoPause` for pausing videos scrolled off screen; adds `--lite-youtube-aspect-ratio` CSS custom property create custom aspect ratio videos; adds `--lite-youtube-frame-shadow-visible` CSS custom property to disable frame shadow (flat look); adds a named slot `image` that allows for setting custom poster image; adds `credentialless` for COEP ## Install via package manager @@ -47,7 +48,7 @@ import '@justinribeiro/lite-youtube'; If you want the paste-and-go version, you can simply load it via CDN: ```html - + ``` ## Basic Usage @@ -184,6 +185,39 @@ Uses Intersection Observer if available to automatically load the YouTube iframe > ``` +## Use the named slot to set a custom poster image +```html + + + +``` + +## Set custom aspect ratio +```html + + +``` + +## Disable the frame shadow (flat look) +```html + + +``` + +## Auto-Pause video when scrolled out of view +```html + +``` + ## YouTube QueryParams Use any [YouTube Embedded Players and Player Parameters](https://developers.google.com/youtube/player_parameters) you like. diff --git a/package.json b/package.json index 0c77aa9..93f294b 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "lite-youtube.js.map" ], "license": "MIT", - "version": "1.5.0", + "version": "1.6.0", "type": "module", "main": "lite-youtube.js", "module": "lite-youtube.js", @@ -80,4 +80,4 @@ "singleQuote": true, "arrowParens": "avoid" } -} +} \ No newline at end of file