@bagelink/vue 1.4.62 → 1.4.64

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": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.4.62",
4
+ "version": "1.4.64",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -66,7 +66,7 @@ defineExpose({ play, pause })
66
66
  const embedType = $computed<'YouTube' | 'Vimeo' | undefined>(() => {
67
67
  const youtubeRegex = /youtube\.com|youtu\.be/
68
68
  if (youtubeRegex.test(props.src || '')) return 'YouTube'
69
- const vimeoRegex = /vimeo\.com/
69
+ const vimeoRegex = /(?:player\.)?vimeo\.com/
70
70
  if (vimeoRegex.test(props.src || '')) return 'Vimeo'
71
71
  })
72
72
 
@@ -90,10 +90,15 @@ const videoUrl = $computed(() => {
90
90
  return `https://www.youtube.com/embed/${videoId}?${queryParams}`
91
91
  }
92
92
  if (embedType === 'Vimeo') {
93
- const vimeoRegex
94
- // eslint-disable-next-line regexp/no-unused-capturing-group
95
- = /vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/)?(\d+)(?:$|\/|\?)/
96
- const videoId = props.src?.match(vimeoRegex)?.[3]
93
+ // Handle both regular Vimeo URLs and player.vimeo.com embed URLs
94
+ const playerVimeoRegex = /player\.vimeo\.com\/video\/(\d+)/
95
+ const regularVimeoRegex = /vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/)?(\d+)(?:$|\/|\?)/
96
+
97
+ const playerMatch = props.src?.match(playerVimeoRegex)
98
+ const regularMatch = props.src?.match(regularVimeoRegex)
99
+
100
+ const videoId = playerMatch?.[1] || regularMatch?.[3]
101
+ console.log(videoId, { playerMatch, regularMatch })
97
102
  return `https://player.vimeo.com/video/${videoId}`
98
103
  }
99
104
  }
@@ -104,24 +109,13 @@ const videoUrl = $computed(() => {
104
109
  <template>
105
110
  <div ref="videoContainer" class="bgl_vid" :class="{ vid_empty: !src, vid_short: isYoutubeShort }">
106
111
  <iframe
107
- v-if="embedType"
108
- :src="videoUrl"
109
- :style="{ aspectRatio }"
110
- frameborder="0"
111
- title="Video"
112
+ v-if="embedType" :src="videoUrl" :style="{ aspectRatio }" frameborder="0" title="Video"
112
113
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
113
- referrerpolicy="strict-origin-when-cross-origin"
114
- allowfullscreen
114
+ referrerpolicy="strict-origin-when-cross-origin" allowfullscreen
115
115
  />
116
116
  <video
117
- v-else-if="src"
118
- ref="video"
119
- :autoplay="autoplay === true"
120
- :muted="mute"
121
- :loop="loop"
122
- :style="{ aspectRatio }"
123
- :controls="controls"
124
- :playsinline="playsinline"
117
+ v-else-if="src" ref="video" :autoplay="autoplay === true" :muted="mute" :loop="loop"
118
+ :style="{ aspectRatio }" :controls="controls" :playsinline="playsinline"
125
119
  >
126
120
  <source :src="src" :type="`video/${videoFormat}`">
127
121
  </video>
@@ -145,7 +139,8 @@ const videoUrl = $computed(() => {
145
139
  }
146
140
 
147
141
  .bgl_vid.vid_short {
148
- max-width: 56.25vh; /* Limit width for shorts to maintain aspect ratio */
142
+ max-width: 56.25vh;
143
+ /* Limit width for shorts to maintain aspect ratio */
149
144
  margin: 0 auto;
150
145
  }
151
146
  </style>