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

128
Views
Play audio on page load

I am trying to play audio on the page load. I have a website that sends a notification to users and plays a notification sound. Sometimes the notification is sent before user interaction with the browser, in this case, the sound is not getting played.

I am using the following code:

const audioCtx = new AudioContext();
        const audio = new Audio(site_url+"/audio/pristine.mp3");
        const source = audioCtx.createMediaElementSource(audio);
        source.connect(audioCtx.destination);
        audio.play();

Please guide me what can be done about this.

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!