@profitlich/template-toolkit 2.11.1 → 2.13.0
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.
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import '@mux/mux-player';
|
|
2
|
-
import config from '../../config.json' with { type: 'json' };
|
|
3
2
|
import './mux-player.scss';
|
|
4
3
|
|
|
5
4
|
export class MuxPlayer {
|
|
6
5
|
#lazyLoadObserver;
|
|
7
6
|
#playPauseObserver;
|
|
8
7
|
#loop;
|
|
8
|
+
#resolution;
|
|
9
9
|
#onPlayerCreated;
|
|
10
10
|
|
|
11
|
-
constructor({ loop = false, onPlayerCreated = null } = {}) {
|
|
11
|
+
constructor({ loop = false, resolution = '1080p', onPlayerCreated = null } = {}) {
|
|
12
12
|
this.#loop = loop;
|
|
13
|
+
this.#resolution = resolution;
|
|
13
14
|
this.#onPlayerCreated = onPlayerCreated;
|
|
14
15
|
this.#lazyLoadObserver = new IntersectionObserver(this.#handleLazyLoad.bind(this));
|
|
15
16
|
this.#playPauseObserver = new IntersectionObserver(this.#handlePlayPause.bind(this));
|
|
@@ -70,7 +71,7 @@ export class MuxPlayer {
|
|
|
70
71
|
player.playsInline = true;
|
|
71
72
|
player.style.aspectRatio = aspectRatio;
|
|
72
73
|
player.thumbnailTime = 0;
|
|
73
|
-
player.minResolution =
|
|
74
|
+
player.minResolution = this.#resolution;
|
|
74
75
|
|
|
75
76
|
if (container.dataset.accentColor) {
|
|
76
77
|
player.accentColor = container.dataset.accentColor;
|
package/package.json
CHANGED
|
@@ -28,7 +28,9 @@ export class ImagesLoaded {
|
|
|
28
28
|
if (img.complete && img.naturalHeight > 0) {
|
|
29
29
|
this.#signalLoaded(img);
|
|
30
30
|
} else {
|
|
31
|
-
//
|
|
31
|
+
// Noch nicht geladenen Bildern Atrribut geben zum Ausblenden mit CSS
|
|
32
|
+
img.setAttribute(this.#attributeName, 'false');
|
|
33
|
+
// Auf das erfolgreiche Lade-Event warten
|
|
32
34
|
img.addEventListener('load', () => this.#signalLoaded(img));
|
|
33
35
|
|
|
34
36
|
// Fehlerbehandlung (optional)
|