質問

I've build a web app which contains video and audio (both on-click). The app uses applicationCache to store all files on an iPad with iOS7.

Video works perfectly in the cached (offline) version!

The only (big) problem is, that the audio-files are loaded but not able to be played. I've read a lot about some problems regarding this, but I didn't find out if it is possible to play cached audio files or not.

For the web app I'm using createjs (with preloadjs and sounds).

I've also recognized that when the audio-files begin to load (offline, with preloadjs) it throughs the following error in the console (from iPad):

SyntaxError: DOM Exception 12: An invalid or illegal string was specified.

… for every single audio-file (mp3).

AND it dramatically delays the (pre)load progress/process.

How can I get rid of this delay? How to run the audio files correctly? If "playing audio" is not possible on iPad/iOS7.1, is there any event or detection, that tells me that audio is not available … so that I can output an alert like "Please connect to the internet in order to hear this audio-file"?

Thx in advance!

役に立ちましたか?

解決

the issue with PreloadJS sounds like the fail timeout, which occurs when a fileload is attempted and no response is received. I have not heard one way or the other if loading audio works from applicationCache, but it sounds like PreloadJS is trying to load it externally rather than from appCache. It could have something to do with WebAudio needing to use XHR for loading audio, whereas video would use a tag.

Here is a related post that might have some answers.

Hope that helps.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top