HTML::O...kCueList(3)

πŸ“¦ version 0.6.0, in alpine 3.24

πŸ’– 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 🌟


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