Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9270233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:19:04+00:00 2026-06-18T15:19:04+00:00

I have an audio element inside my page that starts playing at a button

  • 0

I have an audio element inside my page that starts playing at a button click.

Is there a way to pause the audio when the user presses the iPhone HOME button and Safari goes into background?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:19:05+00:00Added an answer on June 18, 2026 at 3:19 pm

    Make use of a loop, to check if the user is on the webpage. Store the time.

    var lastSeen;
    var loop = function (){
        lastSeen = Date.now();
        setTimeout(loop, 50);
    };
    loop();
    
    var music = document.getElementById('music');
    music.addEventListener('timeupdate', function (){
        if(Date.now() - lastSeen > 100){
            this.pause();
        }
    }, false);
    

    source: Stop HTML5 audio from looping when iOS Safari is closed

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an audio element in a HTML5 page. I start playing the audio
I have an HTML5 audio player that should play when an element has been
Using HTML5 I have 2 Audio elements and 1 video element on a page.
I have an audio element in a webpage, and I want to ensure that
If you have audio encoded at 44100Hz that means you have 44100 samples per
I have an audio track with an image slideshow - e.g. there's image 1
I have an Audio app using AVAudioPlayer on iOS. Whenever music is playing my
Im a newb. I have a audio sound playing as soon as the new
Anyone have experience playing audio (right now specifically mp3s) with python using a any
I have an audio element in a webpage for a client and i have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.