How to get self hosted video url in block preview?

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: `
          :empty-text="$t('') + ' …'"

          <k-aspect-ratio ratio="16/9">
            <video v-if="video" :src="video" />



selfhostedvideo is an array, so (simple example code):

  <ul @dblclick="open">
    <template v-if="content.videofile">
        <source :src="videofile.url" mime="">
    <template v-else>
      <div>No file selected</div>
export default {
  computed: {
    videofile() {
      return this.content.videofile[0] || {};
1 Like

Thanks! :pray:

I must add one thing, if someone else finds this thread in the future.

For this kind of preview is best to use all small caps for the field name. This name “videoFile” didn’t work, but this “videofile” does work.