@justinribeiro/lite-youtube
Advanced tools
Comparing version 0.8.0 to 0.9.0
@@ -36,2 +36,3 @@ /** | ||
set autoLoad(value: boolean); | ||
get params(): string; | ||
/** | ||
@@ -38,0 +39,0 @@ * Define our shadowDOM for the component |
@@ -51,6 +51,6 @@ /** | ||
get videoStartAt() { | ||
return Number(this.getAttribute('videoPlay') || '0'); | ||
return Number(this.getAttribute('videoStartAt') || '0'); | ||
} | ||
set videoStartAt(time) { | ||
this.setAttribute('videoPlay', String(time)); | ||
this.setAttribute('videoStartAt', String(time)); | ||
} | ||
@@ -68,2 +68,5 @@ get autoLoad() { | ||
} | ||
get params() { | ||
return `start=${this.videoStartAt}&${this.getAttribute('params')}`; | ||
} | ||
/** | ||
@@ -211,3 +214,3 @@ * Define our shadowDOM for the component | ||
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen | ||
src="https://www.youtube.com/embed/${this.videoId}?autoplay=1&start=${this.videoStartAt}" | ||
src="https://www.youtube.com/embed/${this.videoId}?autoplay=1&${this.params}" | ||
></iframe>`; | ||
@@ -214,0 +217,0 @@ this.domRefFrame.insertAdjacentHTML('beforeend', iframeHTML); |
@@ -22,3 +22,3 @@ { | ||
"license": "MIT", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"main": "lite-youtube.js", | ||
@@ -25,0 +25,0 @@ "module": "lite-youtube.js", |
@@ -92,3 +92,3 @@ [![npm version](https://badge.fury.io/js/%40justinribeiro%2Flite-youtube.svg)](https://badge.fury.io/js/%40justinribeiro%2Flite-youtube) | ||
<!-- Start at 5 seconds --> | ||
<lite-youtube videoid="guJLfqTFfIw" start="5"></lite-youtube> | ||
<lite-youtube videoid="guJLfqTFfIw" videoStartAt="5"></lite-youtube> | ||
``` | ||
@@ -104,2 +104,11 @@ | ||
## YouTube QueryParams | ||
Use any [YouTube Embedded Players and Player Parameters](https://developers.google.com/youtube/player_parameters) you like | ||
```html | ||
<lite-youtube videoid="guJLfqTFfIw" params="controls=0&enablejsapi=1"> | ||
</lite-youtube> | ||
``` | ||
## Attributes | ||
@@ -110,8 +119,9 @@ | ||
| Name | Description | Default | | ||
| ------------ | ---------------------------------------------------------------- | ------- | | ||
| `videoid` | The YouTube videoid | `` | | ||
| `videotitle` | The title of the video | `Video` | | ||
| `videoplay` | The title of the play button (for translation) | `Play` | | ||
| `autoload` | Use Intersection Observer to load iframe when scrolled into view | `false` | | ||
| `start` | Set the point at which the video should start, in seconds | `0` | | ||
| Name | Description | Default | | ||
| -------------- | ---------------------------------------------------------------- | ------- | | ||
| `videoid` | The YouTube videoid | `` | | ||
| `videotitle` | The title of the video | `Video` | | ||
| `videoplay` | The title of the play button (for translation) | `Play` | | ||
| `videoStartAt` | Set the point at which the video should start, in seconds | `0` | | ||
| `autoload` | Use Intersection Observer to load iframe when scrolled into view | `false` | | ||
| `params` | Set YouTube query parameters | `` | |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24579
384
125