File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -152,16 +152,24 @@ const id = computed(() => {
152
152
return props .vimeoOptions ?.id || props .id
153
153
})
154
154
155
+ const videoId = computed (() => ` vimeo-embed:${id .value } ` )
155
156
const { data : payload } = useAsyncData (
156
- ` vimeo-embed:${ id . value } ` ,
157
+ videoId ,
157
158
// TODO ideally we cache this
158
- () => $fetch (` https://vimeo.com/api/v2/video/${id .value }.json ` ).then (res => (res as any )[0 ]),
159
+ () => $fetch (` https://vimeo.com/api/oembed.json ` , {
160
+ params: {
161
+ url: ` https://vimeo.com/${id .value } ` ,
162
+ format: ' json' ,
163
+ }
164
+ }),
159
165
{
160
- watch: [ id ] ,
161
- },
166
+ lazy: true ,
167
+ }
162
168
)
163
169
164
- const placeholder = computed (() => payload .value ?.thumbnail_large )
170
+ const placeholder = computed (() => {
171
+ return payload .value ?.thumbnail_url
172
+ })
165
173
166
174
let player: Vimeo | undefined
167
175
// we can't directly expose the player as vue will break the proxy
You can’t perform that action at this time.
0 commit comments