SteveB

Using sound offline with iPad

Recommended Posts

Has anyone had any success using Phaser offline using a manifest file.

 

I've set up a manifest file to allow offline use. Works fine everywhere I've tested except on my iPad. The first time, when it downloads the files, it works fine. The second time it just stops.

 

I traced it down to the audio.

/**    * Called when a file is successfully loaded.    *    * @method Phaser.Loader#fileComplete    * @param {number} index - The index of the file in the file queue that loaded.    */    fileComplete: function (index) {...  case 'audio':                if (this.game.sound.usingWebAudio)                {                    file.data = this._xhr.response;                    this.game.cache.addSound(file.key, file.url, file.data, true, false);                    if (file.autoDecode)                    {                        var that = this;                        var key = file.key;                        this.game.cache.updateSound(key, 'isDecoding', true);                        this.game.sound.context.decodeAudioData(file.data, function (buffer) {                            if (buffer)                            {                                that.game.cache.decodedSound(key, buffer);                                that.game.sound.onSoundDecode.dispatch(key, that.game.cache.getSound(key));                            }                        });                    }

The problem is that once the files have been cached, the file.data = this._xhr.response is null and that causes a DOM exception 12 error when the sound is added.

 

 

Share this post


Link to post
Share on other sites

Hi, appreciate these original posts were a while ago now - but are people still encountering the same issue?

 

I'm working on an app that only has to work offline on iPad for now, which is all good apart from the audio that just doesn't play when the app is opened from the application cache offline on the iPad. The audio files have been added to the cache.manifest and I'm not getting any errors when the page opens up - just silence!

 

7

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.