Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
Show progress bar as audio loads in Angular

I want to play audio on page load using this code

 <audio id="player">
 <source src='{{url}}'/>
</audio>
<progress min="0" max="100" value="0"></progress> 
 <div class="hp_slide">
<div class="hp_range" id="rangeslider"></div>
</div>

 <button id="playbtn" (click)="start_audio()">Play</button>

 start_audio()
    {  
      var button = <HTMLVideoElement> document.getElementById("playbtn");

      var audio = <HTMLVideoElement> document.getElementById("player");

      button.addEventListener("click", function(){
        if(audio.paused){
          audio.play();
          button.innerHTML = "Pause";
        } else {
          audio.pause();
          button.innerHTML = "Play";
        }
      }); 

     var element:HTMLElement=  document.getElementById('playbtn') as HTMLElement
     element.click(); 

     
     audio.addEventListener("timeupdate", (e)=>{

      var ct = audio.currentTime;
      var duration = audio.duration;
      var slider =document.getElementById('rangeslider'); 
      slider.stop(true,true).animate({'width':(ct +.25)/duration*100+'%'},250,'linear');

     });

getting this error property stop does not exist on HTMLELEMENT.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!