marcostmunhoz / laracasts-transcriptions

A package to handle VTT file loading, parsing and rendering.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laracasts Transcriptions

A small package developed during the "Write a Composer Package With Me" series, from Laracasts.

Usage

use MarcosTMunhoz\LaracastsTranscriptions\Transcription;

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

foreach ($transcription->lines() as $line) {
    // Properties
    $line->position; // The current line position
    $line->timestamp; // Full line timestamp (start - end)
    $line->text; // The line text for the given timestamp

    // Methods
    $line->getBeginningTimestamp(); // Returns the beginning timestamp in H:i:s.v format
    $line->toHtml(); // Returns an HTML (anchor tag) representation of the line
}

About

A package to handle VTT file loading, parsing and rendering.

License:MIT License


Languages

Language:PHP 100.0%