Files
Plenario/templates/Admin/present.php
T
gnilebeinandClaude Opus 5.5 1c509e31c2
CI / Deploy / test (push) Successful in 46s
CI / Deploy / deploy (push) Skipped
Add YouTube video slide type
Admins paste a YouTube link (watch, youtu.be, shorts, live, embed).
The link is checked via oEmbed on save and with a "check link" button
(not found / not embeddable is rejected, unreachable saves with a
warning). Start time can be entered or is taken from the link's
timecode; autoplay is optional. The presenter embeds the video via
youtube-nocookie.com; participants get the link plus a share button
(Web Share API, falls back to copying).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 15:08:12 +01:00

71 lines
3.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Presenter screen. Rendered empty and filled by webroot/js/plenario.js
* (Plenario.presenter) from /admin/{token}/state.
*
* Keyboard: ←/→ slides, V voting on/off, H hide results, F fullscreen, Q QR code.
*
* @var \App\View\AppView $this
* @var \App\Model\Entity\Poll $poll
* @var string $adminToken
* @var string $joinUrl
* @var string $joinBaseUrl
* @var int $pollIntervalMs
*/
$this->assign('title', $poll->title);
$host = preg_replace('#^https?://#', '', $joinBaseUrl);
?>
<div class="stage"
data-presenter
data-state-url="<?= $this->Url->build(['_name' => 'admin:state', 'token' => $adminToken]) ?>"
data-control-url="<?= $this->Url->build(['_name' => 'admin:control', 'token' => $adminToken]) ?>"
data-interval="<?= (int)$pollIntervalMs ?>">
<header class="stage__top">
<div class="stage__join">
<?= __('Mitmachen auf') ?> <strong><?= h($host) ?></strong>
<?= __('mit Code') ?> <strong class="stage__code"><?= h($poll->formattedJoinCode()) ?></strong>
</div>
<button type="button" class="stage__qr" data-qr-toggle aria-keyshortcuts="Q" title="<?= __('QR-Code vergrößern (Q)') ?>">
<img src="<?= $this->Url->build(['_name' => 'admin:qr', 'token' => $adminToken]) ?>" alt="<?= __('QR-Code') ?>">
<kbd class="ctrl__key" aria-hidden="true">[Q]</kbd>
</button>
</header>
<main class="stage__main">
<p class="stage__type" data-type></p>
<h1 class="stage__question" data-question><?= __('Lade …') ?></h1>
<p class="stage__description" data-description></p>
<div class="stage__media" data-media hidden></div>
<div class="stage__results" data-results></div>
</main>
<footer class="stage__controls">
<a class="ctrl" href="<?= $this->Url->build(['_name' => 'admin', 'token' => $adminToken]) ?>" title="<?= __('Zur Verwaltung') ?>">✎</a>
<button type="button" class="ctrl" data-action="prev" aria-keyshortcuts="ArrowLeft PageUp" title="<?= __('Vorherige Folie (←)') ?>">
<span aria-hidden="true">←</span><span class="sr-only"><?= __('Vorherige Folie') ?></span>
</button>
<span class="ctrl-counter" data-counter>–</span>
<button type="button" class="ctrl" data-action="next" aria-keyshortcuts="ArrowRight PageDown Space" title="<?= __('Nächste Folie (→ oder Leertaste)') ?>">
<span aria-hidden="true">→</span><span class="sr-only"><?= __('Nächste Folie') ?></span>
</button>
<button type="button" class="ctrl ctrl--wide" data-action="toggle" data-voting aria-keyshortcuts="V" title="<?= __('Abstimmung öffnen/schließen (V)') ?>">
<span data-label></span> <kbd class="ctrl__key" aria-hidden="true">[V]</kbd>
</button>
<button type="button" class="ctrl ctrl--wide" data-hide-results aria-keyshortcuts="H" title="<?= __('Ergebnisse ein-/ausblenden (H)') ?>">
<span data-label><?= __('Ergebnisse verbergen') ?></span> <kbd class="ctrl__key" aria-hidden="true">[H]</kbd>
</button>
<span class="ctrl-counter" data-participants></span>
<button type="button" class="ctrl" data-fullscreen aria-keyshortcuts="F" title="<?= __('Vollbild (F)') ?>">
<span aria-hidden="true">⛶</span><span class="sr-only"><?= __('Vollbild') ?></span>
<kbd class="ctrl__key" aria-hidden="true">[F]</kbd>
</button>
</footer>
<div class="qr-overlay" data-qr-overlay hidden>
<img src="<?= $this->Url->build(['_name' => 'admin:qr', 'token' => $adminToken]) ?>" alt="<?= __('QR-Code') ?>">
<p><?= h($joinUrl) ?></p>
<p class="qr-overlay__hint"><kbd class="ctrl__key">[Esc]</kbd> <?= __('oder Klick zum Schließen') ?></p>
</div>
</div>