document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() ); This site uses Akismet to reduce spam. Within ".container" I've added an image (which will be the album cover), then the three anchor tags will act as the controls for the player. The hide/show is animated using the jQuery animate to provide a stereo component-like feel, reminiscent of a CD tray ejection. For this reason our friends at Google have come up with a method to improve the audio tag's weaknesses. The top of the document is made up of the HTML5 doctype. Don't need of plugins. You can stylize the native audio player, just hide the controls and make your owns. How do I put three reasons together in a sentence? Anyhow, you can define the additional CSS styles to customize the audio player according to your needs. It borrows some design elements from the SoundCloud player and throws in useful features for those hosting their audio. Regarding the last one, we need to grab the length of the current audio, and how much of it has played, to calculate the percentage and set the correct width of the progress bar. Once the container for the player is complete, it's time to create the actual controls. Universal HTML5 Audio Player ProgressionPlayer - Responsive Audio/Video Player For a full DOM reference, go to our HTML Audio/Video DOM Reference. This will hide the cover and close the player back up. By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. The "controls" class is the container for the audio player control buttons. I'm glad this question isn't closed as it's evidently attracting worthwhile answers. it only works in Chrome. The volume and progress_bar elements are initialized with the jQueryUI progressbar control, and click handlers are set to allow the user to click within to change the position dynamically. The player includes all of the elements described in the original design. So, first lets get familiar with HTML5 audio tag attributes and some APIs we need to use in our demo. Use the CSS display grid property in which we'll place the player's controls. The "volume-container" contains the volume button and slider. When we start to utilize the audio tag with javascript we can start to create some really interesting and useful audio players. 26 HTML Audio Player For Websites In Codepen If you have a music related website and want to improve the design or add more functions capabilities for your music player to attract as well as increase the user experience, this article will help you to solve the above problem. However, for most cases, it's more than adequate. It also pulls metadata (including album cover) from music files which helps you create a very nice and customized audio player. If you want a function to be called once the audio has finished playing then you can use 'myaudio.addEventListener('ended',myfunc)' - This will call 'myfunc()' once the audio has finished. While the HTML5