You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im working on some app that has calls, and im need to play incoming ringtone. Sometimes it happens that user open page and do not touch it at all (hence audiocontext are blocked), then at some point he got incoming call and no sound, its fine. User accept or decline call and im execute ion.sound.stop(ringtoneName). Still all fine at this point, as it was no sounds and im stop it - no sounds too. Also at this point audioContext are became to unblocked state and can be used without user 'gestures', in my case it will be used by event from webSocket. Next part are produce unexpected behaviour - when user receive one more call - it play sounds, all good, user accept or decline call, im execute stop() function BUT SOUND STILL PLAYS!
Have only one idea why it happens - first sound which was attempted to play with blocked context somehow 'captured' but not played, stop() does not drop it. So with second call to play() it start both sounds, and on second stop() it just stop one of them, and one of them stays. Not sure if i can prove this assumption, but it just looks like that.
It maybe obvious that i may fix issue with double call to stop() but its not, even if i will make second call with setTimeout, or if i will do 10 calls in loop, it still playing. BUT when im call stop() two times from console - it working fine.
Im using angular, maybe its important for this issue. for sounds im using this simple wrapper, and have another class that hold all sounds (variables type of SoundHandle). Im calling Play() and Stop() from events received by websocket
export class SoundHandle {
constructor(private sound_name: string, private opts?: { part: string }) { }
private get IonSound() { return window.ion.sound as IonSound };
public Play() {
this.IonSound.play(this.sound_name, this.opts);
}
public Stop() {
this.IonSound.stop(this.sound_name, this.opts);
//setTimeout(() => {
// this.IonSound.stop(this.sound_name, this.opts);
//}, 300);
}
}
I have live example, but its closed from public for the moment as it not in production yet. So if you will want to see what exactly happens on site - contact me and I will grant access to you, not in public conversation
Having problem with ion-sound v3.0.7, angular 9.1.0
The text was updated successfully, but these errors were encountered:
Im working on some app that has calls, and im need to play incoming ringtone. Sometimes it happens that user open page and do not touch it at all (hence audiocontext are blocked), then at some point he got incoming call and no sound, its fine. User accept or decline call and im execute ion.sound.stop(ringtoneName). Still all fine at this point, as it was no sounds and im stop it - no sounds too. Also at this point audioContext are became to unblocked state and can be used without user 'gestures', in my case it will be used by event from webSocket. Next part are produce unexpected behaviour - when user receive one more call - it play sounds, all good, user accept or decline call, im execute stop() function BUT SOUND STILL PLAYS!
Have only one idea why it happens - first sound which was attempted to play with blocked context somehow 'captured' but not played, stop() does not drop it. So with second call to play() it start both sounds, and on second stop() it just stop one of them, and one of them stays. Not sure if i can prove this assumption, but it just looks like that.
It maybe obvious that i may fix issue with double call to stop() but its not, even if i will make second call with setTimeout, or if i will do 10 calls in loop, it still playing. BUT when im call stop() two times from console - it working fine.
Im using angular, maybe its important for this issue. for sounds im using this simple wrapper, and have another class that hold all sounds (variables type of SoundHandle). Im calling Play() and Stop() from events received by websocket
I have live example, but its closed from public for the moment as it not in production yet. So if you will want to see what exactly happens on site - contact me and I will grant access to you, not in public conversation
Having problem with ion-sound v3.0.7, angular 9.1.0
The text was updated successfully, but these errors were encountered: