@profitlich/template-toolkit 2.20.0 → 2.21.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.
|
@@ -26,11 +26,24 @@ export class MuxPlayer {
|
|
|
26
26
|
#loop;
|
|
27
27
|
#noLowRes;
|
|
28
28
|
#onPlayerCreated;
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
#disableTracking;
|
|
30
|
+
#envKey;
|
|
31
|
+
#metadata;
|
|
32
|
+
|
|
33
|
+
constructor({
|
|
34
|
+
loop = false,
|
|
35
|
+
noLowRes = false,
|
|
36
|
+
onPlayerCreated = null,
|
|
37
|
+
disableTracking = false,
|
|
38
|
+
envKey = null,
|
|
39
|
+
metadata = null,
|
|
40
|
+
} = {}) {
|
|
31
41
|
this.#loop = loop;
|
|
32
42
|
this.#noLowRes = noLowRes;
|
|
33
43
|
this.#onPlayerCreated = onPlayerCreated;
|
|
44
|
+
this.#disableTracking = disableTracking;
|
|
45
|
+
this.#envKey = envKey;
|
|
46
|
+
this.#metadata = metadata;
|
|
34
47
|
this.#lazyLoadObserver = new IntersectionObserver(this.#handleLazyLoad.bind(this));
|
|
35
48
|
this.#playPauseObserver = new IntersectionObserver(this.#handlePlayPause.bind(this));
|
|
36
49
|
}
|
|
@@ -91,7 +104,6 @@ export class MuxPlayer {
|
|
|
91
104
|
const player = document.createElement('mux-player');
|
|
92
105
|
player.playbackId = playbackId;
|
|
93
106
|
player.streamType = 'on-demand';
|
|
94
|
-
player.playsInline = true;
|
|
95
107
|
player.style.aspectRatio = aspectRatio;
|
|
96
108
|
player.thumbnailTime = 0;
|
|
97
109
|
if (this.#noLowRes) {
|
|
@@ -126,6 +138,15 @@ export class MuxPlayer {
|
|
|
126
138
|
player.setAttribute('data-autoplay', 'false');
|
|
127
139
|
}
|
|
128
140
|
|
|
141
|
+
if (this.#disableTracking) {
|
|
142
|
+
player.setAttribute('disable-tracking', '');
|
|
143
|
+
} else if (this.#envKey) {
|
|
144
|
+
player.setAttribute('env-key', this.#envKey);
|
|
145
|
+
if (this.#metadata) {
|
|
146
|
+
player.metadata = this.#metadata;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
129
150
|
const setStatus = value => player.setAttribute('data-status', value);
|
|
130
151
|
|
|
131
152
|
player.addEventListener('loadstart', () => setStatus('loadstart'));
|
package/package.json
CHANGED