HTML::Object::DOM::TextTrackCue - HTML Object DOM TextTrack Cue Class
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));
v0.2.0
This class is inherited by HTML::Object::DOM::VTTCue and is part of a collection with HTML::Object::DOM::TextTrackCueList
TextTrackCue is an abstract class which is used as the basis for the various derived cue types, such as VTTCue; you will instead work with those derived types. These cues represent strings of text presented for some duration of time during the performance of a TextTrack. The cue includes the start time (the time at which the text will be displayed) and the end time (the time at which it will be removed from the display), as well as other information.
TextTrackCue
A double that represents the video time that the cue will stop being displayed, in seconds.
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
A string that identifies the cue.
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 );
A boolean for whether the video will pause when this cue stops being displayed.
A double that represents the video time that the cue will start being displayed, in seconds.
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 );
The TextTrack that this cue belongs to, or undef if it does not belong to any.
undef
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.
Jacques Deguest <jack@deguest.jp>
Mozilla documentation
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.
To install HTML::Object, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::Object
CPAN shell
perl -MCPAN -e shell install HTML::Object
For more information on module installation, please visit the detailed CPAN module installation guide.