Skip to content

Gives ability to add props on block Video #2203

@AntoLC

Description

@AntoLC

Is your feature request related to a problem? Please describe.
We have pages with lot of videos and some of them can be huge.
We don't want that they download automatically in background.
To do so, it could be nice to have the ability to add preload="none" on the video tag.

The problem is to override the block Video seems quite complicated from packages/core/src/blocks/Video/block.ts.

But we could use directly and createVideoBlockSpec, it could be nice to be able to add some property to it, to have the ability to add props on the video tag, example:

...
video: createVideoBlockSpec({
   preload: 'none', // ("none" | "metadata" | "auto")
}),

Then here:

video.controls = true;
video.contentEditable = "false";
video.draggable = false;
video.width = block.props.previewWidth;

It would be:

      video.preload = config.preload;

Thank you !

Bonus

  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions