@grame/faustwasm 0.16.3 → 0.16.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/standalone/create-node.js +304 -250
- package/assets/standalone/faust-pwa.js +63 -12
- package/assets/standalone/faustwasm/index.js +1 -1
- package/assets/standalone/faustwasm/index.js.map +2 -2
- package/assets/standalone/index-pwa.js +12 -5
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs-bundle/index.js +8 -4
- package/dist/cjs-bundle/index.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm-bundle/index.js +8 -4
- package/dist/esm-bundle/index.js.map +2 -2
- package/libfaust-wasm/libfaust-wasm.js +1 -1
- package/libfaust-wasm/libfaust-wasm.wasm +0 -0
- package/package.json +6 -3
- package/src/instantiateFaustModuleFromFile.ts +2 -1
- package/test/faustlive-wasm/faustwasm/index.js +1 -1
- package/test/faustlive-wasm/faustwasm/index.js.map +2 -2
|
@@ -40,19 +40,26 @@ const FAUST_DSP_VOICES = 0;
|
|
|
40
40
|
// Create PWA and UI
|
|
41
41
|
await pwa.create();
|
|
42
42
|
|
|
43
|
-
// Event listener to handle user interaction
|
|
43
|
+
// Event listener to handle user interaction. The whole start sequence is
|
|
44
|
+
// launched from the event handler rather than split across delayed tasks so
|
|
45
|
+
// iOS keeps it associated with the user activation.
|
|
44
46
|
function handleUserInteraction() {
|
|
45
|
-
|
|
47
|
+
|
|
46
48
|
// Resume AudioContext synchronously
|
|
47
49
|
pwa.resumeAudioContext();
|
|
48
50
|
|
|
49
51
|
// Activate MIDI and Sensors
|
|
50
|
-
pwa.activateMIDISensors()
|
|
51
|
-
|
|
52
|
+
pwa.activateMIDISensors();
|
|
53
|
+
}
|
|
52
54
|
|
|
53
|
-
//
|
|
55
|
+
// Register several activation events because iOS standalone PWAs do not
|
|
56
|
+
// behave identically across versions: some fire pointer events reliably,
|
|
57
|
+
// others are more consistent with touchend or click.
|
|
58
|
+
window.addEventListener('pointerdown', handleUserInteraction, { passive: true });
|
|
59
|
+
window.addEventListener('touchend', handleUserInteraction, { passive: true });
|
|
54
60
|
window.addEventListener('click', handleUserInteraction);
|
|
55
61
|
window.addEventListener('touchstart', handleUserInteraction);
|
|
62
|
+
window.addEventListener('keydown', handleUserInteraction);
|
|
56
63
|
|
|
57
64
|
// Deactivate AudioContext, MIDI and Sensors on user interaction
|
|
58
65
|
window.addEventListener('visibilitychange', function () {
|
package/dist/cjs/index.js
CHANGED