Every slide gets an embed URL /e/{key}/{id} for presentation software
like Canva. The page goes live while it is visible, keeps itself live
with heartbeats and pauses when it disappears; stale embeds are paused
lazily. The embed key is separate from the admin token and only allows
showing, activating, pausing and voting controls of that slide.
Participants see a pause page while no slide is live. The presenter
can pause (P) and resume the paused slide with the arrow keys; the
dashboard has a pause button.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
1.1 KiB
PHP
30 lines
1.1 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
use Migrations\BaseMigration;
|
|
|
|
/**
|
|
* Slides embedded in other presentation software (e.g. Canva) and pausing.
|
|
*
|
|
* polls.embed_key - secret of the embed URLs /e/{key}/{slide}; may only show,
|
|
* activate and pause slides (not the admin token)
|
|
* polls.embed_seen_at - last heartbeat of the embedded slide that is live;
|
|
* null = slide was chosen in Plenario itself (no timeout)
|
|
* polls.paused_slide_id - slide that was live before pausing, → resumes it
|
|
*/
|
|
class AddEmbedToPolls extends BaseMigration
|
|
{
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function change(): void
|
|
{
|
|
$this->table('polls')
|
|
->addColumn('embed_key', 'string', ['limit' => 64, 'null' => true, 'default' => null, 'after' => 'join_code'])
|
|
->addColumn('embed_seen_at', 'datetime', ['null' => true, 'default' => null, 'after' => 'current_slide_id'])
|
|
->addColumn('paused_slide_id', 'integer', ['null' => true, 'default' => null, 'after' => 'embed_seen_at'])
|
|
->addIndex(['embed_key'], ['unique' => true])
|
|
->update();
|
|
}
|
|
}
|