Support embed YouTube playlist (#1342)
This commit is contained in:
parent
a65a2d52c7
commit
3cb61c3bcd
|
@ -1,3 +1,3 @@
|
||||||
<div {% if class %}class="{{class}}"{% endif %}>
|
<div {% if class %}class="{{class}}"{% endif %}>
|
||||||
<iframe src="https://www.youtube-nocookie.com/embed/{{id}}{% if autoplay %}?autoplay=1{% endif %}" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
<iframe src="https://www.youtube-nocookie.com/embed/{{id}}{% if playlist %}?list={{playlist}}{% endif %}{% if autoplay %}?autoplay=1{% endif %}" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -164,6 +164,7 @@ Embed a responsive player for a YouTube video.
|
||||||
The arguments are:
|
The arguments are:
|
||||||
|
|
||||||
- `id`: the video id (mandatory)
|
- `id`: the video id (mandatory)
|
||||||
|
- `playlist: the playlist id (optional)
|
||||||
- `class`: a class to add to the `<div>` surrounding the iframe
|
- `class`: a class to add to the `<div>` surrounding the iframe
|
||||||
- `autoplay`: when set to "true", the video autoplays on load
|
- `autoplay`: when set to "true", the video autoplays on load
|
||||||
|
|
||||||
|
@ -172,6 +173,8 @@ Usage example:
|
||||||
```md
|
```md
|
||||||
{{/* youtube(id="dQw4w9WgXcQ") */}}
|
{{/* youtube(id="dQw4w9WgXcQ") */}}
|
||||||
|
|
||||||
|
{{/* youtube(id="dQw4w9WgXcQ", playlist="RDdQw4w9WgXcQ") */}}
|
||||||
|
|
||||||
{{/* youtube(id="dQw4w9WgXcQ", autoplay=true) */}}
|
{{/* youtube(id="dQw4w9WgXcQ", autoplay=true) */}}
|
||||||
|
|
||||||
{{/* youtube(id="dQw4w9WgXcQ", autoplay=true, class="youtube") */}}
|
{{/* youtube(id="dQw4w9WgXcQ", autoplay=true, class="youtube") */}}
|
||||||
|
|
Loading…
Reference in a new issue