NAME
HTML::Object::DOM::TextTrackCue - HTML Object DOM TextTrack Cue Class
SYNOPSIS
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));
VERSION
v0.2.0
DESCRIPTION
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.
PROPERTIES
endTime
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
id
A string that identifies the cue.
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
pauseOnExit
A boolean for whether the video will pause when this cue stops being displayed.
See also Mozilla documentation
startTime
A double that represents the video time that the cue will start 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->startTime ); # 0.1
$track->addCue( $cue1 );
See also Mozilla documentation
track
The TextTrack that this cue belongs to, or undef
if it does not belong to any.
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
AUTHOR
Jacques Deguest <jack@deguest.jp>
SEE ALSO
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.