From b90b91649321cdce626fb059a34d6b3a4cb59756 Mon Sep 17 00:00:00 2001 From: samsepi0l Date: Fri, 22 Mar 2024 12:16:30 +0100 Subject: [PATCH 1/2] Add player parameters https://github.com/paulirish/lite-youtube-embed?tab=readme-ov-file#custom-player-parameters --- layouts/shortcodes/youtubeLite.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/shortcodes/youtubeLite.html b/layouts/shortcodes/youtubeLite.html index 398f9f79..4375eb38 100644 --- a/layouts/shortcodes/youtubeLite.html +++ b/layouts/shortcodes/youtubeLite.html @@ -1,4 +1,5 @@ {{- $id := .Get "id" | default "SgXhGb-7QbU" -}} {{- $label := .Get "id" | default "Blowfish" -}} +{{- $params := .Get "params" -}} - + From e36c227ce1b1874470896b79de0aa6021e9bfffd Mon Sep 17 00:00:00 2001 From: d4rklynk Date: Wed, 27 Mar 2024 19:26:05 +0100 Subject: [PATCH 2/2] Add documentation about youtubeLite params variable --- exampleSite/content/docs/shortcodes/index.md | 32 +++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/exampleSite/content/docs/shortcodes/index.md b/exampleSite/content/docs/shortcodes/index.md index 8c29faa3..9dc2d3c3 100644 --- a/exampleSite/content/docs/shortcodes/index.md +++ b/exampleSite/content/docs/shortcodes/index.md @@ -738,17 +738,39 @@ consectetur adipiscing elit. A shortcut to embed youtube videos using the [lite-youtube-embed](https://github.com/paulirish/lite-youtube-embed) library. This library is a lightweight alternative to the standard youtube embeds, and it's designed to be faster and more efficient. -| Parameter | Description | -| --------- | ----------------------------------- | -| `id` | [String] Youtube video id to embed. | -| `label` | [String] Label for the video | +| Parameter | Description | +| --------- | -------------------------------------------- | +| `id` | [String] Youtube video id to embed. | +| `label` | [String] Label for the video | +| `params` | [String] Extras parameters for video playing | **Example 1:** ```md {{}} - ``` {{< youtubeLite id="SgXhGb-7QbU" label="Blowfish-tools demo" >}} + +**Example 2:** + +You can use all of Youtube's [player parameters](https://developers.google.com/youtube/player_parameters#Parameters) for the `params` variable, as demonstrated below: + +> This video will start after 130 seconds (2m10) + +```md +{{}} +``` + +> This video will not have UI controls, will start playing at 130 seconds and will stop 10 seconds later. + +To concatenate multiple options as shown below, you need to add the `&` character between them. + +```md +{{}} +``` + +{{}} + +More informations can be found on the [youtubeLite GitHub repo](https://github.com/paulirish/lite-youtube-embed/blob/master/readme.md#custom-player-parameters) and Youtube's [player parameters](https://developers.google.com/youtube/player_parameters#Parameters) page.