Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7058443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:06:48+00:00 2026-05-28T04:06:48+00:00

I am trying to customise audio tag in HTML5. To play around with controls

  • 0

I am trying to customise audio tag in HTML5. To play around with controls is easy but is there a way to show and customise the progress bar of the track and volume controller?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:06:48+00:00Added an answer on May 28, 2026 at 4:06 am

    Here’s an example of javascript controlled audio player that uses css stylable elems:

    <!doctype html>
    <html lang="en">
        <head>
           <style>
                html, body {padding:50px;}
                * {margin:0px;padding:0px;}
                #audioWrapper {position:relative;display:inline-block;}
                .audioPlayer {position:absolute;left:0px;bottom:0px;
                     display: block;height:48px;width:400px;}
                #playPauseButton {position: absolute;top: 13px;left: 10px;
                     display:inline;width: 18px;height: 22px;
                     background: url(/images/player.png) no-repeat -20px -2px;
                     cursor: pointer;}
                #playPauseButton.playing {background-position:0px -2px;}
                #playPauseButton:active {top:10px;}
                #timeRemaining {position:absolute;top:17px;right:5px;font-size:11px;
                     font-weight:bold;color:#fff;}
                #timeLine {position: absolute;top: 19px;left: 50px;right: 50px;
                     height: 6px;padding: 2px;border-radius: 5px;background: #546374;}
               #slideHandle {position: absolute;top: -6px;left: 0;width: 20px;
                    height: 20px;margin-left: -10px;
                    background: url(/images/player.png) no-repeat -39px -3px;
                    cursor: pointer;}
               .audioPlayerBackground {height:400px;width:400px;}
            </style>
            <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
            <script type="text/javascript" src="/js/jquery-ui-1.8.17.custom.min.js"></script>
            <script type="text/javascript">
                function setupAudio(){
                    var userSetSliderPosition = false;
                    var audioSliderCreated = false;
    
                    if(!!document.createElement('audio').canPlayType) {
                        var audioElemStr = '<audio><source src="/sound/Mozart_-_Bassoon_Concerto_in_Bb_major_-_Allegro.ogg" type="audio/ogg"></source></audio>';
                        $(audioElemStr).insertAfter(".audioPlayer #timeRemaining");
    
                        audioPlayer = $('.audioPlayer audio').get(0);
                        slideHandle = $('.audioPlayer #slideHandle');
                        timeRemainingElem = $('.audioPlayer #timeRemaining');
    
                        $("#playPauseButton").click(function() {    
                            if (audioPlayer.paused) { audioPlayer.play(); }
                            else { audioPlayer.pause(); }    
                        });
    
                        $(audioPlayer).bind('play',function() {
                            $("#playPauseButton").addClass('playing');  
                          }).bind('pause ended', function() {
                            $("#playPauseButton").removeClass('playing');   
                        });  
    
                        $(audioPlayer).bind('timeupdate', function() {
                            var audioPlayerDuration = audioPlayer.duration;
    
                            if (!userSetSliderPosition){
                                var audioPlayerCurrentTime = audioPlayer.currentTime;
                                var audioPlayerRemainingTime  = parseInt(audioPlayerDuration - audioPlayerCurrentTime);
                                var slideHandlePercentComplete = (audioPlayerCurrentTime / audioPlayerDuration) * 100;
                                var minutes = parseInt(audioPlayerRemainingTime/60);
                                var seconds = parseInt(audioPlayerRemainingTime%60);
    
                                slideHandle.css({left: slideHandlePercentComplete + '%'}); 
                                timeRemainingElem.text(minutes + ':' + (seconds < 10 ? ('0' + seconds) : seconds));
                            }
    
                            if (!audioSliderCreated) {
                                audioSliderCreated = true;
                                $('.audioPlayer #timeLine').slider({
                                    max: audioPlayerDuration,
                                    step: 0.01,
                                    animate: "slow",         
                                    slide: function() {            
                                        userSetSliderPosition = true;
                                    },
                                    stop:function(e,ui) {
                                        userSetSliderPosition = false;        
                                        audioPlayer.currentTime = ui.value;
                                    }
                                });
                            }
                        });
                    }
                }
            </script>
        </head>
        <body onload="setupAudio();">
            <div id="audioWrapper">
                <img class="audioPlayerBackground" alt="" src="/images/spaceJunk.png" />
                <div class="audioPlayer">
                    <div id="playPauseButton"></div>
                    <div id="timeLine">
                        <div id="slideHandle" class ="ui-slider-handle"></div>
                    </div>
                    <div id="timeRemaining"></div>
                    <!--audio and source tags will be inserted here, if the browser supports them-->
                </div>
            </div>
        </body>
    </html>
    

    You can see an example of it running here: http://www.vdstudios.net/tutorials/html/stylableAudioPlayer.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm obviously not trying to play full spectrum audio, but is there some way
I'm trying to work out if there is a way to customise the HTML
Im trying tu customize horizontal progress bar in my application. I want it to
I'm trying to customise the standard WiX Progress Dialog (I want to make it
Is there any way to customise which languages are installed with Visual Studio 2012?
I am trying to customise a site's CSS using a Blackberry Pearl (8120) but
I have a slight problem trying to customise the look of the action bar
I'm trying to customise the sc-player-minimal.html example included with the JS custom player package.
im trying to customize this page indicator with half succes, but after many hours
I'm trying to customise the output from a WordPress plugin called Showtime. Showtime contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.