| 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 | use strict; | ||
| 18 | use warnings; | ||
| 19 | warnings::register_categories( 'HTML::Object' ); | ||
| 20 | use parent qw( HTML::Object::EventTarget ); | ||
| 21 | use vars qw( $VERSION ); | ||
| 22 | our $VERSION = 'v0.2.0'; | ||
| 23 | }; | ||
| 24 | |||
| 25 | use strict; | ||
| 26 | use warnings; | ||
| 27 | |||
| 28 | sub init | ||
| 29 | { | ||
| 30 | my $self = shift( @_ ); | ||
| 31 | $self->{_init_strict_use_sub} = 1; | ||
| 32 | $self->SUPER::init( @_ ) || return( $self->pass_error ); | ||
| 33 | return( $self ); | ||
| 34 | } | ||
| 35 | |||
| 36 | # Note: property | ||
| 37 | sub id : lvalue { return( shift->_set_get_scalar_as_object( 'id', @_ ) ); } | ||
| 38 | |||
| 39 | # Note: property | ||
| 40 | sub kind : lvalue { return( shift->_set_get_scalar_as_object( 'kind', @_ ) ); } | ||
| 41 | |||
| 42 | # Note: property | ||
| 43 | sub label : lvalue { return( shift->_set_get_scalar_as_object( 'label', @_ ) ); } | ||
| 44 | |||
| 45 | # Note: property | ||
| 46 | sub language : lvalue { return( shift->_set_get_scalar_as_object( 'language', @_ ) ); } | ||
| 47 | |||
| 48 | 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 |