|
| 1 | +--- |
| 2 | +title: Peertube shortcode |
| 3 | +linkTitle: Peertube |
| 4 | +description: Embed a PeerTube video in your content using the peertube shortcode. |
| 5 | +categories: [] |
| 6 | +keywords: [] |
| 7 | +--- |
| 8 | + |
| 9 | +> [!note] |
| 10 | +> To override Hugo's embedded `peertube` shortcode, copy the [source code][] to a file with the same name in the `layouts/_shortcodes` directory. |
| 11 | +
|
| 12 | +## Example |
| 13 | + |
| 14 | +To display a PeerTube video with this URL: |
| 15 | + |
| 16 | +```text |
| 17 | +https://toobnix.org/w/5jBegFpNbffA1nhmp32kqR |
| 18 | +``` |
| 19 | + |
| 20 | +Include this in your Markdown: |
| 21 | + |
| 22 | +```text |
| 23 | +{{</* peertube url="https://toobnix.org/w/5jBegFpNbffA1nhmp32kqR" */>}} |
| 24 | +``` |
| 25 | + |
| 26 | +Hugo renders this to: |
| 27 | + |
| 28 | +{{< peertube url="https://toobnix.org/w/5jBegFpNbffA1nhmp32kqR" >}} |
| 29 | + |
| 30 | +## Parameters |
| 31 | + |
| 32 | +url |
| 33 | +: (`string`) The URL of the PeerTube video. |
| 34 | + |
| 35 | +start |
| 36 | +: (`string`) The time, from the start of the video, when the player should start playing the video (e.g., `42s`, `6m7s`). |
| 37 | + |
| 38 | +stop |
| 39 | +: (`string`) The time, from the start of the video, when the player should stop playing the video (e.g., `42s`, `6m7s`). |
| 40 | + |
| 41 | +loading |
| 42 | +: (`string`) The loading attribute of the `iframe` element, either `eager` or `lazy`. Default is `eager`. |
| 43 | + |
| 44 | +width |
| 45 | +: (`int`) The width of the video in pixels. Responsive if `0`. Default is `0`. |
| 46 | + |
| 47 | +allowFullScreen |
| 48 | +: (`bool`) Whether to allow full screen playback. Default is `true`. |
| 49 | + |
| 50 | +autoplay |
| 51 | +: (`bool`) Whether to automatically play the video. Forces `mute` to `true`. Default is `false`. |
| 52 | + |
| 53 | +controls |
| 54 | +: (`bool`) Whether to display the video controls. Default is `true`. |
| 55 | + |
| 56 | +displayLink |
| 57 | +: (`bool`) Whether to display the video link. Default is `true`. |
| 58 | + |
| 59 | +displayTitle |
| 60 | +: (`bool`) Whether to display the video title. Default is `true`. |
| 61 | + |
| 62 | +displayWarning |
| 63 | +: (`bool`) Whether to display the privacy warning. Default is `true`. |
| 64 | + |
| 65 | +loop |
| 66 | +: (`bool`) Whether to indefinitely repeat the video. Default is `false`. |
| 67 | + |
| 68 | +mute |
| 69 | +: (`bool`) Whether to mute the video. Always `true` when `autoplay` is `true`. Default is `false`. |
| 70 | + |
| 71 | +p2p |
| 72 | +: (`bool`) Whether to enable peer-to-peer bandwidth sharing. Default is `true`. |
| 73 | + |
| 74 | +[source code]: <{{% eturl param %}}> |
0 commit comments