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 9215999
In Process

The Archive Base Latest Questions

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

I have an HTML5 web page which uses audio via JavaScript. I have a

  • 0

I have an HTML5 web page which uses audio via JavaScript. I have a basic version which loads the correct audio file (e.g., ogg vs mp3 etc), and then correctly plays sprites from that file. This basic version has only 1 javascript file, and it works on all OS/browser combinations I’ve tried, including: OSX (Safari, Chrome, Firefox), iOS 5 and 6 (Safari), Windows 7 (Firefox, Chrome), and Android 4.2 (Firefox).

I now take the code and insert it into the production version. Now, the HTML page loads many other JavaScript files (e.g., jquery, jquery ui, flot). However, all of the audio code is in a single file that is included via

<script src="/foo/bar/sound.js"></script>. 

In both cases, the code in sound.js is invoked by the user clicking on a button. On all platform/browser combinations mentioned above, the combined code works EXCEPT on iOS (tested on iOS 5 and 6 on both iPad2 and iPad3). The error I’m getting is

INVALID_STATE_ERR: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable.

This occurs on a line that tries to set mySound.currentTime based on the particular sprite needed:

mySound.currentTime = spriteData[currentSound].start;

mySound is my sound object, and the spriteData is correct. Oddly, the same code that fails on real iPads works just fine in the iOSSimulator, regardless of whether I simulate iOS 5 or iOS 6.

How do I go about debugging this situation? I’m at a loss of where to look and what to try. Any suggestions would be appreciated.

  • 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-18T02:19:35+00:00Added an answer on June 18, 2026 at 2:19 am

    I finally found a solution. On all platforms the following works in the standalone code, but when combined with the rest of the production page, fails on iOS (even iOS 6.1):

    audioSprite = document.createElement('audio');
    audioSprite.setAttribute("src","/foo/bar/file.xxx");
    

    where xxx is mp4, ogg, wav, or mp3, depending on what the browser can handle.

    Changing these two lines — and keeping everything else the same — to the following works on iOS on the production page:

    audioSprite = new Audio('http://example.com/foo/bar/file.xxx');
    

    I still don’t know why the second version works and the first doesn’t.

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

Sidebar

Related Questions

I have a page which uses a tag template. My web.xml is very basic.
So, I have web page that uses javascript to let a user select different
I have a web page with a read-only text box which shows some HTML
I have downloaded the web page into an html file. I am wondering what's
I have a main page which uses a ViewModel I have created: public class
We have an ASP.NET web application which uses ASP.NET Ajax. We open it from
I have a little web app that uses the Facebook like widget. This page
there's web page which uses zend framework. the web actually uses rewrites. I googled
I have a Spring MVC web app which uses FreeMarker for rendering the views
I am developing a web page that uses the HTML5 video tag. When I

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.