lib/HTML/Object/DOM/MediaTrack.pm

filter: Statementstmt 72.4% 21 / 29 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 58.3% 7 / 12 Podpod 100% 5 / 5 totaltotal 68.7% 33 / 48 CC 2 SCAR 7.3
CC
2
Cov
68%
init
6.0
id
2.0
kind
2.0
CRAP 2.1
« lib/HTML/Object/DOM/TextTrackCue.pm ↑ Summary lib/HTML/Object/DOM/Window.pm »
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/DOM/MediaTrack.pm
3 ## Version v0.2.0
4 ## Copyright(c) 2021 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2021/12/30
7 ## Modified 2022/09/18
8 ## All rights reserved
9 ##
10 ##
11 ## This program is free software; you can redistribute it and/or modify it
12 ## under the same terms as Perl itself.
13 ##----------------------------------------------------------------------------
14 package HTML::Object::DOM::MediaTrack;
15 BEGIN
16 {
17 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶ warnings::register_categories( 'HTML::Object' );
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶ use parent qw( HTML::Object::EventTarget );
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 our $VERSION = 'v0.2.0';
23 };
24  
25 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 sub init
29 {
30 0 ▶ my $self = shift( @_ );
Subroutine init: not called CC=2 SCAR=17.9
Pod documented
31 0 $self->{_init_strict_use_sub} = 1;
32 0 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 0 0 0
33 0 return( $self );
34 }
35  
36 # Note: property
37 0 ▶sub id : lvalue { return( shift->_set_get_scalar_as_object( 'id', @_ ) ); }
Subroutine id: not called CC=1 SCAR=6.9
Pod documented
38  
39 # Note: property
40 0 ▶sub kind : lvalue { return( shift->_set_get_scalar_as_object( 'kind', @_ ) ); }
Subroutine kind: not called CC=1 SCAR=6.9
Pod documented
41  
42 # Note: property
43 0 ▶sub label : lvalue { return( shift->_set_get_scalar_as_object( 'label', @_ ) ); }
Subroutine label: not called CC=1 SCAR=6.9
Pod documented
44  
45 # Note: property
46 0 ▶sub language : lvalue { return( shift->_set_get_scalar_as_object( 'language', @_ ) ); }
Subroutine language: not called CC=1 SCAR=6.9
Pod documented
47  
48 1 1;
49 # NOTE: POD
50 __END__
51  
52 =encoding utf-8
53  
54 =head1 NAME
55  
56 HTML::Object::DOM::MediaTrack - HTML Object
57  
58 =head1 SYNOPSIS
59  
60 use HTML::Object::DOM::MediaTrack;
61 my $this = HTML::Object::DOM::MediaTrack->new ||
62 die( HTML::Object::DOM::MediaTrack->error, "\n" );
63  
64 =head1 VERSION
65  
66 v0.2.0
67  
68 =head1 DESCRIPTION
69  
70 This is a shared interface for L<HTML::Object::DOM::AudioTrack> and L<HTML::Object::DOM::VideoTrack>
71  
72 =head1 INHERITANCE
73  
74 +-----------------------+ +---------------------------+ +-------------------------------+
75 | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::MediaTrack |
76 +-----------------------+ +---------------------------+ +-------------------------------+
77  
78 =head1 METHODS
79  
80 =head2 id
81  
82 A string which uniquely identifies the track within the media. This ID can be used to locate a specific track within an audio track list by calling C<AudioTrackList>.getTrackById(). The ID can also be used as the fragment part of the URL if the media supports seeking by media fragment per the Media Fragments URI specification.
83  
84 See also L<Mozilla documentation for audio id|https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/id> and See also L<Mozilla documentation for video id|https://developer.mozilla.org/en-US/docs/Web/API/VideoTrack/id>
85  
86 =head2 kind
87  
88 A string specifying the category into which the track falls. For example, the main audio track would have a kind of "main".
89  
90 See also L<Mozilla documentation for audio kind|https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/kind> and L<Mozilla documentation for video kind|https://developer.mozilla.org/en-US/docs/Web/API/VideoTrack/kind>
91  
92 =head2 label
93  
94 A string providing a human-readable label for the track. For example, an audio commentary track for a movie might have a label of "Commentary with director John Q. Public and actors John Doe and Jane Eod." This string is empty if no label is provided.
95  
96 See also L<Mozilla documentation for audio label|https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/label> and L<Mozilla documentation for vide label|https://developer.mozilla.org/en-US/docs/Web/API/VideoTrack/label>
97  
98 =head2 language
99  
100 A string specifying the audio track's primary language, or an empty string if unknown. The language is specified as a BCP 47 (RFC 5646) language code, such as "en-US" or "pt-BR".
101  
102 See also L<Mozilla documentation for audio language|https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack/language> and L<Mozilla documentation for video language|https://developer.mozilla.org/en-US/docs/Web/API/VideoTrack/language>
103  
104 =head1 AUTHOR
105  
106 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
107  
108 =head1 SEE ALSO
109  
110 L<HTML::Object::DOM::AudioTrack>, L<HTML::Object::DOM::VideoTrack>
111  
112 =head1 COPYRIGHT & LICENSE
113  
114 Copyright(c) 2021 DEGUEST Pte. Ltd.
115  
116 All rights reserved
117  
118 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
119  
120 =cut
« lib/HTML/Object/DOM/TextTrackCue.pm ↑ Summary lib/HTML/Object/DOM/Window.pm »