Add countdown audio per presentation
One audio file per poll (MP3, M4A, OGG, WAV) is uploaded in the admin settings and looped in the presenter view while a quiz runs. Format is detected by magic bytes, files are served with a fixed content type, copied with the poll and swept by images_cleanup. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cad09163d9
commit
2f7a401522
16 files changed
+648
-11
No files matched your search
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Migrations\BaseMigration;
|
||||
|
||||
/**
|
||||
* Optional audio file per presentation, played in the presenter view while a quiz countdown runs.
|
||||
* The file lives in the upload directory, see \App\Service\AudioService; the table only holds its
|
||||
* random file name.
|
||||
*/
|
||||
class AddAudioToPolls extends BaseMigration
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$table = $this->table('polls');
|
||||
if (!$table->hasColumn('audio')) {
|
||||
$table->addColumn('audio', 'string', ['null' => true, 'default' => null, 'limit' => 40])->update();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
$table = $this->table('polls');
|
||||
if ($table->hasColumn('audio')) {
|
||||
$table->removeColumn('audio')->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user