@mixd-id/web-scaffold 0.1.230406217 → 0.1.230406219

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.230406217",
4
+ "version": "0.1.230406219",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -1,12 +1,12 @@
1
1
  <template>
2
- <div :class="$style.comp" :style="computedStyle">
2
+ <div :class="$style.comp" :style="computedStyle" @click="!ready ? loadVideo() : null">
3
3
  <div :class="videoClass" class="absolute top-0 left-0 right-0 bottom-0 z-10"
4
4
  :style="{ opacity:ready ? 1 : 0 }">
5
5
  <div :id="id"></div>
6
6
  </div>
7
7
  <div :class="videoClass" class="relative flex items-center justify-center"
8
8
  :style="thumbnailStyle">
9
- <button class="w-[68px] h-[48px]" aria-label="Play" title="Play">
9
+ <button class="w-[68px] h-[48px]">
10
10
  <svg height="100%" version="1.1" viewBox="0 0 68 48" width="100%">
11
11
  <path class="ytp-large-play-button-bg" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z" fill="#333"></path>
12
12
  <path d="M 45,24 27,14 27,34" fill="#fff"></path>
@@ -27,17 +27,28 @@ const initScript = (callback, id) => {
27
27
 
28
28
  let script = document.getElementById('youtube-iframe-api')
29
29
  if(!script){
30
- const script = document.createElement('script')
31
- script.src = 'https://www.youtube.com/iframe_api'
32
- script.id = 'youtube-iframe-api'
33
- document.head.appendChild(script)
34
-
35
30
  window.onYouTubeIframeAPIReady = () => {
36
31
  while(callbacks.length > 0){
37
32
  const [ callback, id ] = callbacks.pop()
38
33
  callback()
39
34
  }
40
35
  }
36
+
37
+ const script = document.createElement('script')
38
+ script.src = 'https://www.youtube.com/iframe_api'
39
+ script.id = 'youtube-iframe-api'
40
+ document.head.appendChild(script)
41
+ }
42
+ else{
43
+ const intervalId = window.setInterval(() => {
44
+ if('YT' in window){
45
+ window.clearInterval(intervalId)
46
+ while(callbacks.length > 0){
47
+ const [ callback, id ] = callbacks.pop()
48
+ callback()
49
+ }
50
+ }
51
+ }, 500)
41
52
  }
42
53
  }
43
54