Commit 009653d
authored
Allow web audio unlock via mouse click
Scenario in Chrome for desktop:
1. Game loads
2. Game automatically starts some playing music (web audio, not HTML5 audio)
- If the user pressed a key or clicked the canvas with the mouse before the music started playing, they now hear the music.
- If the user did not press a key, nor click the canvas with the mouse before the music started playing, they will not hear the music until they press a key, however no amount of mouse clicking will let them hear the music.
This fix allows a mouse click to get the music playing audibly, even if they didn't interact with the canvas (via keyboard or mouse) before it started playing.1 parent d37aa4b commit 009653d
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
0 commit comments