Hi, how to get the video URL in blocks preview? I am trying to extend the default Video block to have self-hosted video as an option.
Whatever I do I get
can't access property "url", this.content.selfhostedVideo is undefined
This is my code, files field selfhostedVideo
is working fine.
video: {
computed: {
captionMarks() {
return this.field("caption", { marks: true }).marks;
},
video() {
if (this.content.selfhostedVideo && this.content.selfhostedVideo.url) {
return this.content.selfhostedVideo.url;
}
return false;
}
},
template: `
<template>
<k-block-figure
:caption="content.caption"
:caption-marks="captionMarks"
:empty-text="$t('field.blocks.video.placeholder') + ' β¦'"
:is-empty="!video"
empty-icon="video"
@open="open"
@update="update"
>
<k-aspect-ratio ratio="16/9">
<video v-if="video" :src="video" />
</k-aspect-ratio>
</k-block-figure>
</template>
`
}