HTML-Object

 view release on metacpan or  search on metacpan

lib/HTML/Object/DOM/Element/Media.pm  view on Meta::CPAN

    say($obj->currentSrc); # ""

See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/currentSrc>

=head2 currentTime

This returns whatever number you set it to under perl, as a L<Module::Generic::Number> object.

Normally, under JavaScript, this returns a double-precision floating-point value indicating the current playback time in seconds; if the media has not started to play and has not been seeked, this value is the media's initial playback time. Setting t...

Example:

    my $video = $doc->createElement('$video');
    say( $video->currentTime );
    $vide->currentTime = 35;

See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/currentTime>

=head2 defaultMuted

A Boolean that reflects the C<muted> HTML attribute, which indicates whether the media element's audio output should be muted by default.

Example:

    my $video = $doc->createElement('video');
    $video->defaultMuted = 1; # true
    say( $video->outerHTML ); # <video muted=""></video>

See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/defaultMuted>

=head2 defaultPlaybackRate

This returns whatever number you set it to under perl, as a L<Module::Generic::Number> object.

Normally, under JavaScript, this returns a double indicating the default playback rate for the media.

Example:

    my $obj = $doc->createElement('video');
    say($obj->defaultPlaybackRate); # 1

See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/defaultPlaybackRate>

=head2 disableRemotePlayback

A boolean that sets or returns the remote playback state of the HTML attribute, indicating whether the media element is allowed to have a remote playback UI.

Example:

    my $obj = $doc->createElement('audio');
    # <audio></audio>
    $obj->disableRemotePlayback = 1; # true
    # <audio disableremoteplayback=""></audio>

See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/disableRemotePlayback>

=head2 duration

This returns whatever number you set it to under perl, as a L<Module::Generic::Number> object.

Normally, under JavaScript, this returns a read-only double-precision floating-point value indicating the total duration of the media in seconds. If no media data is available, the returned value is C<NaN>. If the media is of indefinite length (such ...

Example:

    my $obj = $doc->createElement('video');
    say( $obj->duration ); # NaN

See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/duration>

=head2 ended

Returns a Boolean that indicates whether the media element has finished playing.

Example:

    my $obj = $doc->createElement('video');
    say($obj->ended); # false

See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/ended>

=head2 error

Read-only.

This returns a L<HTML::Object::MediaError> object for the most recent error, or C<undef> if there has not been an error.

Example:

    my $video = $doc->createElement('video');
    $video->onerror = sub
    {
        say( "Error " . $video->error->code . "; details: " . $video->error->message );
    }
    $video->src = 'https://example.org/badvideo.mp4';

See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/error>

=head2 loop

A Boolean that reflects the C<loop> HTML attribute, which indicates whether the media element should start over when it reaches the end.

Example:

    my $obj = $doc->createElement('video');
    $obj->loop = 1; # true

See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/loop>

=head2 mediaKeys

This always returns C<undef> under perl.

Normally, under JavaScript, this returns a L<MediaKeys object|https://developer.mozilla.org/en-US/docs/Web/API/MediaKeys> or C<undef>. L<MediaKeys|https://developer.mozilla.org/en-US/docs/Web/API/MediaKeys> is a set of keys that an associated L<HTML:...

See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/mediaKeys>

=head2 muted

Is a boolean that determines whether audio is muted. true if the audio is muted and false otherwise. This does not affect the DOM.

Example:

    my $obj = $doc->createElement('video');
    say( $obj->muted ); # false

See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/muted>



( run in 1.265 second using v1.01-cache-2.11-cpan-97f6503c9c8 )