Comments (10)
chrome://flags/
does have an "Autoplay policy" flag actually, so far it works. :)
from sound.
Thanks for the compliments.
I don’t think you can avoid this. We are heading to a world where all audio and video media requires an interaction. I’m not a huge fan either. You can design around it by creating a start button?
from sound.
It's a good idea, but one of the target devices (arcade box) will only have button controls connected to it (directional joystick, 5 action buttons), currently a keypress is not resuming the audio context. :(
I guess I can build with an older version of Chromium for now until the Chrome devs implement some none pointer-device way or resuming audio context...
from sound.
I wonder if there is there a flag in Chrome to prevent this behavior?
from sound.
Follow-up article: https://www.bleepingcomputer.com/news/google/google-fixes-issue-that-broke-millions-of-web-based-games-in-chrome/
Looks like they temporarily reverting the change until more developers can integrated interaction-to-play audio. I might add a note about this in the readme because it's an important design consideration.
from sound.
Sorry to bump an old post--
I added a "start" button that then plays the main menu state and starts the audio. Yet, I still get this warning:
The Web Audio autoplay policy will be re-enabled in Chrome 70 (October 2018). Please check that your website is compatible with it. https://goo.gl/7K7WLu
Is that warning something that always pops up? OR is it telling me my current implementation simply doesn't work correctly? Thanks!
from sound.
How do we resume the audio context after user interaction?
from sound.
Based on this setter @OptimusPi I believe you should be able to set paused = false
, ala
PIXI.sound.context.paused = false;
from sound.
maybe it could be useful for someone, it took me a while sorting out those annoying warnings.
You can load dynamically 'pixi-sound' after a user click/swipe and store it in a lazy loader var.
if (!this.pixiSound) {
this.pixiSound = await import('pixi-sound')
}
then, in order to use it:
this.pixiSound.default
from sound.
Building off the previous comment, this work well for me:
document.addEventListener('click', async () => {
globalThis.PIXI.sound = (await import('pixi-sound')).default;
}, { once: true });
from sound.
Related Issues (20)
- Sound Library not stopping paused Sounds on stop all
- Does the new @pixi/assets loader support loading sounds? HOT 2
- Version 5 error HOT 2
- Problem with dependencies v5.0.0 HOT 1
- Assets Loader with Sound should use the exact order of the audio formats defined HOT 2
- Format fallback with different filename bases HOT 1
- Not able to load base64 sound assets on production HOT 8
- v4.x doesn't respect `utils.supported`, which loads everything in `utils.extensions` anyway HOT 2
- Bug: Failed to set the 'buffer' HOT 4
- undefined is not an object (evaluating 'this.find(t).play') HOT 1
- Sound is suspended while window loses focus HOT 6
- `disableAutoPause` doesn't disable auto-resume HOT 4
- Sound does not work well on some browsers on iOS HOT 4
- Parser for Pixi Assets does not register properly HOT 2
- Uncaught TypeError just by following the Tutorial HOT 2
- Calling .stop() on a sound whilst the browser window is blurred does not actually stop the sound HOT 4
- Sine tone generated is one octave too low
- [bug] HTMLAudioInstance.ts HOT 2
- Safari Changing to different tab not muting sound HOT 1
- global sprite aliases?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sound.