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

150
Views
Audio playback after event (e.g. resume audio after call)

I'm working on a small web application that plays my favourite radio live streams. Now there's an issue when the stream gets interrupted by a call or different media: it disappears. I would expect the audio to automatically resume after the event ends (e.g. end of call), however this is not the case. I have searched through the forums but nothing seems to compare/work. I have tried a boolean to determine the playing state, but this just messes up whenever I manually hit the stop button. Here's my code so far:

const radioList = [
    {
        "radioName": "Ibiza Live",
        "radioStream": "https://streams.radio.co/sdc9cfaf77/listen",
        "imgUrl": "../img/ibizalive.png"
    },
];

const radioContainer = document.querySelector('.stationsContainer');

// Render markup
const radioMarkup = (img, name, audio) => {
    const html = `
        <div class="station">
            <img src="${img}" alt="${name}" data-id="station">
            <div class="live">
                <div>
                    <div></div>
                    <div></div>
                    <div></div>
                    <div></div>
                </div>
            </div>
            <audio src="${audio}"></audio>
        </div>
    `
    radioContainer.innerHTML += html;
}

radioList.forEach(i => {
    radioMarkup(i.imgUrl, i.radioName, i.radioStream);
})

// Play radio
const audio = document.querySelectorAll("audio");
const stationList = document.querySelectorAll(".stationsContainer .station");

stationList.forEach((station, i) => {
    station.addEventListener('click', () => {
        stopAllAudio();
        audio[i].load();
        audio[i].play();
    })
})

How can I make the audio resume after an event?

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!