herrthees/kirby-peertube

A Kirby CMS plugin to embed PeerTube videos using a simple KirbyTag. Supports autoplay, custom start/end times, and works with any PeerTube instance.

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Type:kirby-plugin

pkg:composer/herrthees/kirby-peertube

1.1.1 2025-10-08 17:47 UTC

This package is not auto-updated.

Last update: 2025-12-03 18:26:40 UTC


README

A plugin for Kirby CMS to easily embed PeerTube videos using a KirbyTag.

Deutsch | English

Features

  • Embed PeerTube videos with a simple KirbyTag
  • Responsive embed with 16:9 aspect ratio
  • Support for autoplay, muting, loop and more

Requirements

  • Kirby 5+
  • PHP 8.1+

Installation

Manual Installation

  1. Download the plugin
  2. Extract to /site/plugins/peertube

The folder structure should look like this:

site/
  plugins/
    peertube/
      index.php

Composer (coming soon)

composer require herrthees/kirby-peertube

Usage

Basic Usage

(peertube: https://peertube.example.com/videos/watch/abc123-def456)

With Parameters

(peertube: https://peertube.example.com/videos/watch/abc123-def456 
  autoplay: true 
  start: 30)

Available Parameters

ParameterTypeDefaultDescription
autoplaybooleanfalseAuto-play video (video will be muted)
mutedbooleanfalseStart video muted
loopbooleanfalseLoop the video
controlsbooleantrueShow video controls
startinteger-Start time in seconds
endinteger-End time in seconds
p2pboolean-Enable P2P streaming
titlebooleantrueShow/Hide embed title.
warningtitlebooleantrueShow/Hide P2P warning title.
subtitlestring-Subtitle language
widthstring100%Container width
heightstring400Container height
classstringpeertube-videoCSS class prefix

Examples

Autoplay with Muting

Note: Modern browsers require muting for autoplay. The plugin automatically mutes videos when autoplay is enabled.

(peertube: https://peertube.example.com/videos/watch/abc123 autoplay: true)

Start at Specific Time

(peertube: abc123-def456 start: 60)

Or with minutes and seconds:

(peertube: abc123-def456 start: 2m15s)

Loop Video

(peertube: abc123-def456 loop: true)

Combining Multiple Options

(peertube: https://peertube.example.com/videos/watch/abc123-def456 
  autoplay: true 
  loop: true 
  start: 30 
  end: 90)

Supported URL Formats

The plugin recognizes the following PeerTube URL formats:

  • https://peertube.example.com/videos/watch/video-id
  • https://peertube.example.com/w/video-id

Output

The plugin generates a responsive iframe embed:

<div class="peertube-video-wrapper" style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%;">
  <iframe 
    src="https://peertube.example.com/videos/embed/video-id" 
    title="PeerTube-Video" 
    frameborder="0" 
    allowfullscreen 
    sandbox="allow-same-origin allow-scripts allow-popups allow-forms" 
    style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;">
  </iframe>
</div>

Browser Autoplay Policies

Modern browsers have strict autoplay policies - autoplay only works with muted videos. The plugin handles this automatically by muting videos when autoplay is enabled (can be manually unmuted by the user).

Contributing

This is my first Kirby plugin. Suggestions and improvements are welcome. Please submit a pull request.

Report Issues

For issues, please report on:

Support

Credits

License

AGPL-3.0-or-later

See LICENSE for the full license text.

Created for the Kirby CMS community

README created locally with assistance from Gemma3:27b-AI