@profitlich/template-toolkit 2.20.1 → 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
- constructor({ loop = false, noLowRes = false, onPlayerCreated = null } = {}) {
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
  }
@@ -125,6 +138,15 @@ export class MuxPlayer {
125
138
  player.setAttribute('data-autoplay', 'false');
126
139
  }
127
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
+
128
150
  const setStatus = value => player.setAttribute('data-status', value);
129
151
 
130
152
  player.addEventListener('loadstart', () => setStatus('loadstart'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@profitlich/template-toolkit",
3
- "version": "2.20.1",
3
+ "version": "2.21.0",
4
4
  "description": "Shared SCSS layout system, JS utilities, components and build scripts for profitlich template repos",
5
5
  "type": "module",
6
6
  "exports": {