@profitlich/template-toolkit 2.18.5 → 2.18.6

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.
@@ -22,14 +22,14 @@ export class MuxPlayer {
22
22
  });
23
23
  }
24
24
 
25
- #setupAutoplay(player) {
25
+ #setup(player) {
26
26
  // Guard Clause: Führe das Setup nur aus, wenn es noch nicht passiert ist.
27
27
  if (player.dataset.isSetup === 'true') {
28
28
  return;
29
29
  }
30
30
 
31
- player.muted = true;
32
- player.style.setProperty('--controls', 'none');
31
+ if (autoplay) player.muted = true;
32
+ if (autoplay) player.style.setProperty('--controls', 'none');
33
33
  if (this.#loop) player.loop = true;
34
34
 
35
35
  // Flag setzen, um zukünftige Ausführungen zu verhindern.
@@ -48,8 +48,8 @@ export class MuxPlayer {
48
48
  handleVisibilityChange(player) {
49
49
  const isVisible = window.getComputedStyle(player).display !== 'none';
50
50
 
51
- if (isVisible && player.hasAttribute('data-autoplay') && player.dataset.isSetup !== 'true') {
52
- this.#setupAutoplay(player);
51
+ if (isVisible && player.dataset.isSetup !== 'true') {
52
+ this.#setup(player);
53
53
  } else if (!isVisible) {
54
54
  this.#playPauseObserver.unobserve(player);
55
55
  player.pause();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@profitlich/template-toolkit",
3
- "version": "2.18.5",
3
+ "version": "2.18.6",
4
4
  "description": "Shared SCSS layout system, JS utilities, components and build scripts for profitlich template repos",
5
5
  "type": "module",
6
6
  "exports": {