laracasts/transcriptions

Load and parse VTT files.

Installs: 8 510

Dependents: 0

Suggesters: 0

Security: 0

Stars: 60

Watchers: 1

Forks: 6

Open Issues: 2

pkg:composer/laracasts/transcriptions

v0.3.4 2024-01-08 14:32 UTC

This package is auto-updated.

Last update: 2025-10-08 18:21:57 UTC


README

This small PHP package assists in the loading and parsing of VTT files.

Usage

use Laracasts\Transcriptions\Transcription;

$transcription = Transcription::load('path/to/file.vtt');

foreach ($transcription->lines() as $line) {
    // $line->body
    // $line->toHtml()
    
    // $line->timestamp->begin()
    // $line->timestamp->beginSeconds()
    // $line->timestamp->end()
    // $line->timestamp->endSeconds()
    
    // json_encode($line);
}

// Group lines into full sentences.
// $transcription->lines()->groupBySentence();

License

This package is open-sourced software licensed under the MIT license.