@justinribeiro/lite-youtube
Advanced tools
Comparing version 1.7.0 to 1.7.1
@@ -28,2 +28,3 @@ export declare class LiteYTEmbed extends HTMLElement { | ||
set posterQuality(opts: string); | ||
get disableNoscript(): boolean; | ||
private setupDom; | ||
@@ -30,0 +31,0 @@ private setupComponent; |
@@ -68,2 +68,5 @@ export class LiteYTEmbed extends HTMLElement { | ||
} | ||
get disableNoscript() { | ||
return this.hasAttribute('disablenoscript'); | ||
} | ||
setupDom() { | ||
@@ -188,3 +191,5 @@ const shadowDom = this.attachShadow({ mode: 'open' }); | ||
} | ||
this.injectSearchNoScript(); | ||
if (!this.disableNoscript) { | ||
this.injectSearchNoScript(); | ||
} | ||
} | ||
@@ -191,0 +196,0 @@ attributeChangedCallback(name, oldVal, newVal) { |
@@ -28,3 +28,3 @@ { | ||
"license": "MIT", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"type": "module", | ||
@@ -31,0 +31,0 @@ "main": "lite-youtube.js", |
@@ -26,3 +26,3 @@ [![npm version](https://badge.fury.io/js/@justinribeiro%2Flite-youtube.svg)](https://badge.fury.io/js/@justinribeiro%2Flite-youtube) ![min+gzip](https://img.shields.io/badge/min%2Bgzip-2.2kb-blue) ![min+br](https://img.shields.io/badge/min%2Bbr-1.7kb-blue) [![](https://data.jsdelivr.com/v1/package/npm/@justinribeiro/lite-youtube/badge)](https://www.jsdelivr.com/package/npm/@justinribeiro/lite-youtube) | ||
- _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 | ||
- _new in v1.7_: Adds support for 404 fallback posters; add noscript injector to lightdom for search indexing | ||
- _new in v1.7_: Adds support for 404 fallback posters; add noscript injector to lightdom for search indexing (disable via `disablenoscript` attribute in v1.7.1). | ||
@@ -219,2 +219,3 @@ ## Install via package manager | ||
## Auto-Pause video when scrolled out of view | ||
Note: the custom poster image will load with this set, but will then disappear without any user interaction because of the intersection observer starting. | ||
```html | ||
@@ -224,2 +225,8 @@ <lite-youtube videoid="VLrYOji75Vc" autopause></lite-youtube> | ||
## NoScript disable | ||
As of v1.7.0, we inject into the lightdom a noscript for SEO help. This can conflict with server side rendered noscript injects. To disable, simply pass `disablenoscript` to the component: | ||
```html | ||
<lite-youtube videoid="VLrYOji75Vc" disablenoscript></lite-youtube> | ||
``` | ||
## YouTube QueryParams | ||
@@ -226,0 +233,0 @@ |
Sorry, the diff of this file is not supported yet
54126
386
267