Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to change the size of audio player in html5 [duplicate]

Is there any possibility of changing the size if the audio player in html5 produced using audio tag.

like image 992
samdonly1 Avatar asked Nov 23 '12 20:11

samdonly1


People also ask

Can you style HTML audio player?

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.

What is the correct HTML5 element for playing audio files?

The HTML <audio> element is used to play an audio file on a web page.

How do you change audio in HTML?

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.

Is audio supported in HTML5?

HTML5 Audio is a subject of the HTML5 specification, incorporating audio input, playback, and synthesis, as well as speech to text, in the browser.


1 Answers

<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

like image 64
xavier.seignard Avatar answered Sep 19 '22 10:09

xavier.seignard