Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: Sound doesn't play after unlocked the lock screen #31

Open
StephanGerbeth opened this issue Nov 5, 2017 · 5 comments
Open

iOS: Sound doesn't play after unlocked the lock screen #31

StephanGerbeth opened this issue Nov 5, 2017 · 5 comments

Comments

@StephanGerbeth
Copy link

Hi,

at first: great library 馃憤

Browser Specs:
iOS Version: 11.1
Browser: Safari

Scenario:
Everytime i hit a button i want to play an audio. I use WaudBase64 to load the sounds.

Problem:
At the first loading of the page the audio is playing wonderful. Everytime i mash the button the sound plays. But when i lock the screen of my iPhone during the page is opened, unlock the screen after some seconds and i try to hit the button one more time the code will be excuted but no sound is audible.

Code

import {
    Waud,
    WaudBase64
} from 'exports-loader?Waud=global.Waud,WaudBase64=global.WaudBase64Pack,AudioManager=global.AudioManager!waud.js';

let audioLibrary = null;

Waud.init();
Waud.enableTouchUnlock(function() {});

export function loadAudioFile(url) {
    return new Promise(function(resolve) {
        new WaudBase64(url, resolve);
    }).then(function(sounds) {
        audioLibrary = sounds;
        return sounds;
    });
}

export function play(id) {
    let sound = audioLibrary.get(id);
    // i get the right sound object
    if(sound) {
        // will be called properly everytime i hit the button
        sound.play();
    }
}

Do you have some help or a bug fix for me, please?

Cheers
Stephan

@StephanGerbeth StephanGerbeth changed the title iOS: Sound doesn't play after unlocked lock screen iOS: Sound doesn't play after unlocked the lock screen Nov 5, 2017
@adireddy
Copy link
Member

adireddy commented Nov 5, 2017

Hey @StephanGerbeth, not sure if this issue is specific to iOS 11.1. Will test it when I get a chance. Is the issue happening in waud sample page? http://www.waudjs.com/sample/

@StephanGerbeth
Copy link
Author

StephanGerbeth commented Nov 5, 2017

yeah this also happen in your sample page.
it won't happen everytime, but often enough -> looks like a race condition.

i also had this bug on iOS 11.0.x.

@DanScott90
Copy link

DanScott90 commented Feb 7, 2018

@adireddy I also have this issue, not sure I can add much more detail. Issue seems to be iOS 11 only:

Reported Issue Devices:
iPhone 7 (11.1.1) - Safari / Chrome 62
iPhone 5S (11.1.2) - Safari / Chrome 62
iPhone 8 (11.0.0) - Safari / (Untested)
iPhone 8+ (11.0.3) - Safari / (Untested)

@adireddy
Copy link
Member

adireddy commented Feb 9, 2018

Got some time to look into this issue. Are you guys using Waud.autoMute()?

@DanScott90
Copy link

I'm not. Manually pausing/resuming audio when getting focusOff/focusOn events.
I'm not actually muting the sounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants