Gives ability to add props on block Video #2466
Replies: 5 comments
-
|
Thanks for bringing this up @AntoLC, I think that while @YousefED had submitted a PR to address this one property, I want to go a little further and allow you to have an object of attributes to apply to the video element (in case you want to set or override any other properties). I just couldn't figure out how to get the typings to work for this and left it. I'll add it to my todo list |
Beta Was this translation helpful? Give feedback.
-
Ah yes eventually, I guess it would be something like: export interface VideoOptions extends VideoHTMLAttributes<HTMLVideoElement> {
icon?: string;
} |
Beta Was this translation helpful? Give feedback.
-
|
Yea, something like that or callback that gives you the element and lets you do whatever you want with it (for example attach event listeners). Since that is more powerful, it is likely what I'm going to implement. |
Beta Was this translation helpful? Give feedback.
-
|
I put up a PR, I will discuss this with @YousefED, since I think it points to a larger architectural problem of customizing the default blocks |
Beta Was this translation helpful? Give feedback.
-
|
@nperez0111 What would next steps look like here? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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:
Then here:
BlockNote/packages/core/src/blocks/Video/block.ts
Lines 92 to 95 in 9e5ffa8
It would be:
Thank you !
Bonus
Beta Was this translation helpful? Give feedback.
All reactions