HTML::O...kCueList(3)
π HTML::O...kCueList(3) β like, the whole manual, bestie π
okay so first things first: this lil page lives in the User Contributed Perl Documentation section, and the file is called HTML::O...kCueList(3) (the name got truncated, we love a mysterious queen). Anyway. Buckle up, we're learning about text track cues today and it's gonna be iconic β¨
πΈ NAME πΈ
HTML::Object::DOM::TextTrackCueList β the HTML Object DOM TextTrack Cue List Class. yes that's a lot of words. yes it's exactly what it sounds like. a list. of cues. for text tracks. slay π
π¦ SYNOPSIS π¦
use HTML::Object::DOM::TextTrackCueList;
my $list = HTML::Object::DOM::TextTrackCueList->new ||
die( HTML::Object::DOM::TextTrackCueList->error, "\n" );
that's it. that's the whole vibe check. construct it, or die with the error message and a newline. no cap, that's the pattern π«Ά
β VERSION β
v0.2.0
v0.2.0 era. we're living in it π
π DESCRIPTION π
So the TextTrackCueList represents a dynamically updating list of TextTrackCue objects. dynamically updating!! it's alive, it breathes, it changes on you β main character energy fr fr π
And plot twist: it inherits from HTML::Object::DOM::List. family tree time β¬οΈ
π§ INHERITANCE π§
+-----------------------+ +---------------------------+ +-------------------------+ +-------------------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::List | --> | HTML::Object::DOM::TextTrackCueList |
+-----------------------+ +---------------------------+ +-------------------------+ +-------------------------------------+
the whole glow-up line, in order: HTML::Object::Element β HTML::Object::EventTarget β HTML::Object::DOM::List β HTML::Object::DOM::TextTrackCueList. it's giving royal bloodline π
β¨ PROPERTIES β¨
length
An unsigned long that is the number of cues in the list. that's it. that's the property. lowkey perfect π
Example:
my $video = $doc->getElementById( 'video' );
$video->onplay = sub
{
say( $video->textTracks->[0]->cues->length ) # 5;
};
so you grab the video element, and when it starts playing (onplay), you say the length of the cues. in this example it's 5. five cues. a whole five of them π₯
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCueList/length> β the source, the blueprint, the og π
π METHODS π
forEach
This is an alias for "foreach" in Module::Generic::Array. same energy, different spelling, both iconic π¦
getCueById
Returns the first TextTrackCue object with the identifier passed to it. note the first β if multiple cues share an id, you're only getting the first one, so don't come for me π
Example:
my $video = $doc->getElementById( 'video' );
$video->onplay = sub
{
say( $video->textTracks->[0]->cues->getCueById( 'second' ) ) # a VTTCue object;
};
again: grab the video, on onplay you say the cue whose id is 'second', and what comes back is a VTTCue object. cute, correct, chef's kiss π
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCueList/getCueById> β yes, go read it, iykyk π
π AUTHOR π
Jacques Deguest <jack@deguest.jp> β the author, the legend, the moment π
π SEE ALSO π
- Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/TextTrackCueList> β literally the whole reference page, go forth and scroll π§
π 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. free software!! redistribute it, modify it, go off π
real talk bestie: the license text above is doing legal work, so keep it exactly as written when you pass it along. no edits, no vibes, just facts π«Ά
and that's the page!! brought to you by perl v5.42.2, dated 2026-02-15, filed under HTML::O...kCueList(3) β mwah, go build something cute with your cues πβ¨πΈ
π¦ 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