@ejfdelgado/ejflab-common 1.9.0 → 1.9.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ejfdelgado/ejflab-common",
3
3
  "type": "commonjs",
4
- "version": "1.9.0",
4
+ "version": "1.9.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ejfdelgado/ejflab-common.git"
@@ -9,6 +9,7 @@ await ModuloSonido.play('/assets/sounds/finish.mp3');
9
9
 
10
10
  class ModuloSonido {
11
11
  static sonidos = {};
12
+ static sincId = null;
12
13
  static createAudio({ source, volume = 100, loop = false }) {
13
14
  return new Promise((resolve, reject) => {
14
15
  const audio = new Audio();
@@ -42,6 +43,9 @@ class ModuloSonido {
42
43
  return await Promise.all(promesas);
43
44
  };
44
45
 
46
+ static setSincId(id) {
47
+ ModuloSonido.sincId = id;
48
+ }
45
49
 
46
50
  static async play(llave, loop = false, volume = 1) {
47
51
  let ref = null;
@@ -55,6 +59,9 @@ class ModuloSonido {
55
59
  && ref.readyState > 2;
56
60
  if (!isPlaying) {
57
61
  ref.loop = loop;
62
+ if (ModuloSonido.sincId) {
63
+ ref.setSinkId(ModuloSonido.sincId);
64
+ }
58
65
  ref.play();
59
66
  }
60
67
  };
package/src/MyThrottle.js CHANGED
@@ -1,4 +1,6 @@
1
1
 
2
+ // Low pressure implementation in two ways...
3
+
2
4
  function debounce(fn, delay) {
3
5
  let timer = null;
4
6