zz-shopify-components 0.25.1-beta.2 → 0.25.1-beta.3

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,6 +1,6 @@
1
1
  {
2
2
  "name": "zz-shopify-components",
3
- "version": "0.25.1-beta.2",
3
+ "version": "0.25.1-beta.3",
4
4
  "description": "Reusable Shopify components for theme projects",
5
5
  "keywords": [
6
6
  "shopify",
@@ -227,6 +227,9 @@
227
227
  : '';
228
228
  if (!nextValue || nextValue === this.value) return;
229
229
  this.value = nextValue;
230
+ if (nextValue === 'video') {
231
+ document.querySelector('product-video-tab').loadVideo();
232
+ }
230
233
  }
231
234
  _syncActive(value) {
232
235
  const normalized = String(value || '');
@@ -26,7 +26,7 @@
26
26
  <video
27
27
  id='product-video-intro-{{ product.id }}'
28
28
  data-type='intro'
29
- src='{{ intro_video.sources[0].url }}'
29
+ data-src='{{ intro_video.sources[0].url }}'
30
30
  poster='{{ intro_video.preview_image | image_url: width: 1000 }}'
31
31
  controls
32
32
  playsinline
@@ -44,6 +44,7 @@
44
44
  role='tabpanel'
45
45
  aria-labelledby='product-video-tab-livestream-{{ product.id }}'
46
46
  >
47
+ <span class='tw-daisy-loading !tw-display-block tw-bg-white tw-absolute tw-top-1/2 tw-left-1/2 tw-translate-x-1/2 tw-translate-y-1/2'></span>
47
48
  <fw-storyblock
48
49
  channel='firework'
49
50
  playlist='{{ livestream_id }}'
@@ -59,7 +60,7 @@
59
60
  role='tabpanel'
60
61
  aria-labelledby='product-video-tab-livestream-{{ product.id }}'
61
62
  data-type='livestream'
62
- src='{{ livestream_video.sources[0].url }}'
63
+ data-src='{{ livestream_video.sources[0].url }}'
63
64
  poster='{{ livestream_video.preview_image | image_url: width: 1000 }}'
64
65
  controls
65
66
  playsinline
@@ -197,6 +198,17 @@
197
198
  return el && (el.tagName === 'VIDEO' || el.tagName === 'AUDIO');
198
199
  }
199
200
 
201
+ loadVideo() {
202
+ this.panels.forEach((panel) => {
203
+ if (this.isMedia(panel)) {
204
+ if (panel.dataset.src) {
205
+ panel.src = panel.dataset.src;
206
+ panel.removeAttribute('data-src');
207
+ }
208
+ }
209
+ });
210
+ }
211
+
200
212
  changeTab(isInitial = false) {
201
213
  this.panels.forEach((panel) => {
202
214
  const isActive = panel.dataset.type === this.currentTab;