PHP Classes

File: site/demos/mediaplayer.php

Recommend this page to a friend!
  Packages of Boss Ibrahim Mussa   Caelrik   site/demos/mediaplayer.php   Download  
File: site/demos/mediaplayer.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Caelrik
Build Web user interface from PHP components
Author: By
Last change:
Date: 8 days ago
Size: 808 bytes
 

 

Contents

Class file image Download
<?php

use Caelrik\Ui\Components\MediaPlayer;
use Caelrik\Ui\Support\Html;

$transcript = [
    [0, 'A soft tone starts.', 'Narrator'],
    [2, 'The tone goes on.'],
    [4, 'The tone fades out.'],
];

return [
    Html::raw('<div class="row g-4"><div class="col-md-7">'),
    MediaPlayer::make('lesson')
        ->label('A lesson in tones')
        ->source('../media/tone.wav', 'audio/wav')
        ->poster('../media/poster.svg')
        ->captions('../media/tone.en.vtt', 'en', 'English', default: true)
        ->transcript($transcript),
    Html::raw('</div><div class="col-md-5">'),
    MediaPlayer::make('podcast')
        ->audio()
        ->label('The tone podcast, episode 1')
        ->source('../media/tone.wav', 'audio/wav')
        ->transcript($transcript),
    Html::raw('</div></div>'),
];