mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-01-22 14:35:43 -06:00
Merge pull request #1362 from d4rklynk/pr-youtubelite
✨ Add player parameters for youtubeLite shortcode
This commit is contained in:
commit
ab361bebb9
2 changed files with 29 additions and 6 deletions
|
@ -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.
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
| 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 |
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
**Example 1:**
|
||||
|
||||
```md
|
||||
{{</* youtubeLite id="SgXhGb-7QbU" label="Blowfish-tools demo" */>}}
|
||||
|
||||
```
|
||||
|
||||
{{< 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
|
||||
{{</* youtubeLite id="SgXhGb-7QbU" label="Blowfish-tools demo" params="start=130" */>}}
|
||||
```
|
||||
|
||||
> 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
|
||||
{{</* youtubeLite id="SgXhGb-7QbU" label="Blowfish-tools demo" params="start=130&end=10&controls=0" */>}}
|
||||
```
|
||||
|
||||
{{</* youtubeLite id="SgXhGb-7QbU" label="Blowfish-tools demo" params="start=130&end=10&controls=0" */>}}
|
||||
|
||||
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.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{{- $id := .Get "id" | default "SgXhGb-7QbU" -}}
|
||||
{{- $label := .Get "id" | default "Blowfish" -}}
|
||||
{{- $params := .Get "params" -}}
|
||||
|
||||
<lite-youtube videoid="{{ $id }}" playlabel="{{ $label }}"></lite-youtube>
|
||||
<lite-youtube videoid="{{ $id }}" playlabel="{{ $label }}" params="{{ $params }}"></lite-youtube>
|
||||
|
|
Loading…
Reference in a new issue