HTML::O...TrackCue(3)

πŸ“¦ version 0.6.0, in alpine 3.24

okay so bestie, welcome to HTML::O...TrackCue(3) β€” yes that's the shorthand, and the full glow-up name is below, courtesy of the User Contributed Perl Documentation ✨ this one's all about the TextTrackCue class and honestly? it's giving foundational πŸ’…


🌸 NAME 🌸

HTML::Object::DOM::TextTrackCue β€” the HTML Object DOM TextTrack Cue Class, no cap πŸŽ€


✨ SYNOPSIS ✨

here's the vibe check, literally just run it:

use HTML::Object::DOM::TextTrackCue;
my $this = HTML::Object::DOM::TextTrackCue->new ||
    die( HTML::Object::DOM::TextTrackCue->error, "\n" );

my $video = $doc->getElementById('myVideo');
var $caption = $video->addTextTrack('caption');
$caption->addCue(new HTML::Object::DOM::VTTCue("Test text", 01.000, 04.000,"","","",true));

like, that's the whole entrance. slay πŸ¦‹


πŸ’œ VERSION πŸ’œ

v0.2.0 β€” she's a work in progress and we love her for it 🫢


🧚 DESCRIPTION 🧚

So HTML::Object::DOM::TextTrackCue is inherited by HTML::Object::DOM::VTTCue, and she's part of a whole girlie collection alongside HTML::Object::DOM::TextTrackCueList πŸ‘‘

TextTrackCue is an abstract class β€” which is the fancy way of saying she's the blueprint, not the final boss. She's the basis for all the various derived cue types, like VTTCue, and you'll be working with those derived types instead, iykyk. The tea: these cues represent strings of text that get shown for some duration of time during the performance of a TextTrack πŸ“Ίβœ¨

And the cue is carrying the whole itinerary: the start time (when the text pops up on screen), the end time (when it gets yanked back off), plus a bunch of other information. main character energy fr fr πŸ’…


🌈 PROPERTIES 🌈

πŸ’– endTime

A double that represents the video time when the cue stops being displayed β€” in seconds. bye bestie, you're done being famous ⏱️

Example:

my $video = $doc->querySelector('video');
my $track = $video->addTextTrack("captions", "Captions", "en");
$track->mode = 'showing';

my $cue1 = HTML::Object::DOM::VTTCue->new(0.1, 0.9, 'Hildy!');
say( $cue1->endTime ); # 0.9
$track->addCue( $cue1 );

See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCue/endTime πŸ”₯

πŸŽ€ id

A string that identifies the cue. name tag but for subtitles, iconic 🏷️

Example:

my $video = $doc->querySelector('video');
my $track = $video->addTextTrack("captions", "Captions", "en");
$track->mode = 'showing';

my $cue1 = HTML::Object::DOM::VTTCue->new(0, 0.9, 'Hildy!');
$cue1->id = 'first';
$track->addCue( $cue1 );

See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCue/id πŸ’«

πŸ¦‹ pauseOnExit

A boolean β€” basically whether the video will hit the brakes when this cue stops being displayed. the cue said "not so fast" πŸ˜­βœ‹

See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCue/pauseOnExit ⭐

🌸 startTime

A double that represents the video time when the cue starts being displayed β€” in seconds. her grand entrance moment 🎬

Example:

my $video = $doc->querySelector('video');
my $track = $video->addTextTrack("captions", "Captions", "en");
$track->mode = 'showing';

my $cue1 = HTML::Object::DOM::VTTCue->new(0.1, 0.9, 'Hildy!');
say( $cue1->startTime ); # 0.1
$track->addCue( $cue1 );

See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCue/startTime 🌟

πŸ’€ track

The TextTrack that this cue belongs to β€” or undef if she doesn't belong to any. lone wolf vibes, we've all been there πŸ™ˆ

Example:

my $video = $doc->querySelector('video');
my $captiontrack = $video->addTextTrack("captions", "Captions", "en");
$captiontrack->mode = 'showing';

my $cue1 = HTML::Object::DOM::VTTCue->new(0, 0.9, 'Hildy!');
$captiontrack->addCue( $cue1 );
say( $cue1->track ); # a TextTrack object.

See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCue/track 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Jacques Deguest <jack@deguest.jp> β€” the mastermind behind all this, we stan πŸ«‘πŸ’–


⭐ SEE ALSO ⭐

Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCue β€” go read the source, bestie, it's lowkey the blueprint πŸ“šβœ¨


Copyright(c) 2021 DEGUEST Pte. Ltd.

All rights reserved. πŸŽ€

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. so like, go off, share the love πŸ’œ


and that's the whole page, bestie 🧚✨ sign-off time: this one's from perl v5.42.2, dated 2026-02-15 β€” periodt πŸ’…πŸ’–

πŸ“¦ where this page comes from