HTML::O...TrackCue(3)
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 & LICENSE π
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
- alpine 3.24: perl-html-object-doc 0.6.0-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms