Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

audio customization

<script type="text/javascript">
            $(
                function(){
                    var aud = $('audio')[0];
                    $('.playpause').on('click', function(e){
                        e.preventDefault();
                    if (aud.paused) {
                        aud.play();
                        /* from play icon to pause icon */
                        $('.playpause .fa-play').remove();
                        $('.playpause').append('<i class="fa fa-pause"></i>');
                    }
                    else {
                        aud.pause();
                        /* from play icon to pause icon */
                        $('.playpause .fa-pause').remove();
                        $('.playpause').append('<i class="fa fa-play"></i>');
                    }

                })
                $('.next').on('click', function(e){
                    e.preventDefault();
                    aud.src = '{$content:audio-file}';
                })
                $('.previuos').on('click', function(e){
                    e.preventDefault();
                    aud.src = '{$content:audio-file}';
                })
                aud.ontimeupdate = function(){
                    $('.progress').css('width', aud.currentTime / aud.duration * 100 + '%')
                }
            })
        </script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: google apps script getsheetbyname 
Javascript :: react js charts with camvas 
Javascript :: javascript sleep 1 minute 
Javascript :: jquery on method 
Javascript :: add material angular 
Javascript :: password regex javascript 
Javascript :: array.splice 
Javascript :: js not startswith 
Javascript :: convertir lista a Json en Java 
Javascript :: angular generate validator 
Javascript :: bind this react 
Javascript :: import file in chrome extension 
Javascript :: how add class to ckeditor image 
Javascript :: run node app locally 
Javascript :: javascript sort multidimensional array by sum 
Javascript :: javascript assign multiple variables to same value ES6 
Javascript :: Create a react project easily 
Javascript :: chart-js-2 
Javascript :: how to edit a fil with vanilla js 
Javascript :: javascript split text after x characters 
Javascript :: length of array 
Javascript :: jquery get label text only for input 
Javascript :: isodate mongodb nodejs 
Javascript :: Alpine.js: button using @click function not working 
Javascript :: embed a picture from a link js 
Javascript :: axios delete set content type 
Javascript :: react switch case 
Javascript :: js create a auto call function inside function 
Javascript :: delete js 
Javascript :: web scrape example js 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =