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(() => {
152152 return props .vimeoOptions ?.id || props .id
153153})
154154
155+ const videoId = computed (() => ` vimeo-embed:${id .value } ` )
155156const { data : payload } = useAsyncData (
156- ` vimeo-embed:${ id . value } ` ,
157+ videoId ,
157158 // 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+ }),
159165 {
160- watch: [ id ] ,
161- },
166+ lazy: true ,
167+ }
162168)
163169
164- const placeholder = computed (() => payload .value ?.thumbnail_large )
170+ const placeholder = computed (() => {
171+ return payload .value ?.thumbnail_url
172+ })
165173
166174let player: Vimeo | undefined
167175// 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