Is there any possibility of changing the size if the audio player in html5 produced using audio tag.
HTML 5 audio tags can be styled. By using the audio tag with “controls” attribute, the default browsers player is used. You can customize by not using the browsers controls. You can also add CSS classes to each one of the elements and style them accordingly.
The HTML <audio> element is used to play an audio file on a web page.
getElementById("my-audio"). setAttribute('src', 'AUDIO_SRC_FILE'); In the above snippet, we have used the JavaScript setAttribute() that used to change the attribute of any HTML element. In our code we take the advantage of the setAttribute() method to change the audio file of our HTML5 audio player.
HTML5 Audio is a subject of the HTML5 specification, incorporating audio input, playback, and synthesis, as well as speech to text, in the browser.
<audio>
can be styled as any other html element.
To increase the width just use the css property width
.
Some html:
<audio id="player" controls autoplay>
<source src="http://xseignard.github.com/webGLWebAudioAPI/sound/OGLikeCapone.ogg" type="audio/ogg">
Your browser does not support the audio tag.
</audio>
And the css:
#player {
width: 100%;
}
Regards
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With