Try to search your question here, if you can't find : Ask Any Question Now ?

jQuery Audio Time Duration Change on Slider Click

HomeCategory: stackoverflowjQuery Audio Time Duration Change on Slider Click
julie asked 2 weeks ago

I noticed that the following code runs fine on desktop & laptops, but not on my Android mobile or other mobile devices, to change the duration of the song when user clicks on the slider:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

    <div id="timeline-box">
    <input id="seekslider" type="range" min="0" max="100" value="0" step="1"><br>           
    </div>

    **//jQuery to detect when user changes the timeline with the seekslider
    $(document).ready(function(){
      $("#seekslider").mouseup(function(e){
                var leftOffset = e.pageX - $(this).offset().left;
                var songPercents = leftOffset / $('#seekslider').width();
                audio.currentTime = songPercents * audio.duration;
            }); 
    });**

I’d appreciate it if someone could help me solve this issue with the duration change when clicking the slider in either jQuery or Javascript.

1 Answers
Best Answer
Arben answered 2 weeks ago
Your Answer

17 + 20 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com