HTML::Object::DOM::Element::Audio - HTML Object DOM Audio Class
use HTML::Object::DOM::Element::Audio; my $audio = HTML::Object::DOM::Element::Audio->new || die( HTML::Object::DOM::Element::Audio->error, "\n" ); <h2>Audio inserted with JavaScript</h2> <div id="myAudio"></div> my $div = document.getElementById( 'myAudio' ); # Create an element <audio> my $audio = document.createElement('audio'); # Set the attributes of the video $audio->src = 'https://example.org/some/where/audio/audio.ogg'; $audio->controls = 1; # true # Add the aido to <div> $div->appendChild( $audio );
Result:
<h2>Audio inserted with JavaScript</h2> <div id="myAudio"></div> <audio src="https://example.org/some/where/audio/audio.ogg" controls=""></audio> </div>
v0.2.0
This interface provides access to the properties of <audio> elements, as well as methods to manipulate them.
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +-----------------------------------+ +-----------------------------------+ | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Media | --> | HTML::Object::DOM::Element::Audio | +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +-----------------------------------+ +-----------------------------------+
Inherits properties from its parent HTML::Object::DOM::Element::Media
Inherits methods from its parent HTML::Object::DOM::Element::Media
Jacques Deguest <jack@deguest.jp>
Mozilla documentation, Mozilla documentation on audio element, Wikipedia on audio file formats
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.