mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
feat: PeerTube integration — alternate audio/video labels, FilePond pools, shared SMTP credentials, channel by name, test button, resumable upload, embed improvements, fix alt labels/curl_close/deprecation
This commit is contained in:
35
app/templates/partials/peertube-embed.php
Normal file
35
app/templates/partials/peertube-embed.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* peertube-embed.php
|
||||
*
|
||||
* Renders a PeerTube video/audio embed iframe from a stored peertube_ids:{uuid} value.
|
||||
*
|
||||
* Expected variables:
|
||||
* string $peertubeUuid — the PeerTube video shortUUID
|
||||
* string $title — title attribute for the iframe
|
||||
* string $instanceUrl — base URL of the PeerTube instance (e.g. https://videos.erg.be)
|
||||
* int $width — iframe width (default 560)
|
||||
* int $height — iframe height (default 315)
|
||||
*/
|
||||
|
||||
$peertubeUuid = $peertubeUuid ?? '';
|
||||
$title = $title ?? 'PeerTube video';
|
||||
$instanceUrl = $instanceUrl ?? '';
|
||||
$width = $width ?? 560;
|
||||
$height = $height ?? 315;
|
||||
|
||||
if ($peertubeUuid === '' || $instanceUrl === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$embedUrl = rtrim($instanceUrl, '/') . '/videos/embed/' . $peertubeUuid;
|
||||
?>
|
||||
<iframe
|
||||
title="<?= htmlspecialchars($title) ?>"
|
||||
width="<?= (int)$width ?>"
|
||||
height="<?= (int)$height ?>"
|
||||
src="<?= htmlspecialchars($embedUrl) ?>"
|
||||
style="border: 0px;"
|
||||
allow="fullscreen"
|
||||
sandbox="allow-same-origin allow-scripts allow-popups allow-forms"
|
||||
></iframe>
|
||||
Reference in New Issue
Block a user