Note that there are some explanatory texts on larger screens.

plurals
  1. POINVALID_STATE_ERROR only on iOS but not on Android, OSX, or Windows
    primarykey
    data
    text
    <p>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).</p> <p>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 </p> <pre><code>&lt;script src="/foo/bar/sound.js"&gt;&lt;/script&gt;. </code></pre> <p>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</p> <pre><code>INVALID_STATE_ERR: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable. </code></pre> <p>This occurs on a line that tries to set mySound.currentTime based on the particular sprite needed:</p> <pre><code>mySound.currentTime = spriteData[currentSound].start; </code></pre> <p>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. </p> <p>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.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload