Doubt regarding CoverVideo and Video Addition flow
ritvij14 opened this issue · 1 comments
ritvij14 commented
Hello!
I am using this project as a reference for another project, where we are using Fabric. I have 2 doubts related to this:
- In the video addition flow, user first uploads and then presses the + button to add the video to the canvas. Is there a way to skip this step? So the user just needs to upload and the video is added to the canvas as well?
- For the above I tried adding from a Video Element instance made from the video File (not part of the dom). Adding it to the canvas did not work. Also, tried using
fromURL
function offabric.Image
but when using it likefabric.CoverVideo.fromURL
the browser gives an error sayingfabric.CoverVideo.fromURL is not a function
. What's the right approach? Some way to add the video directly or some way to add the fromURL function to CoverVideo class as well?
AmitDigga commented
Hi @ritvij14
I am little busy in other projects.
First part
This problem might be solved by overriding this method
fabric-video-editor/src/store/Store.ts
Lines 91 to 93 in 06285e1
You need to call this addVideo()
inside addVideoResource
. Be sure to wrap addVideo()
with setTimeout
, as video might not be available till next react render
fabric-video-editor/src/store/Store.ts
Line 407 in 06285e1
Second Part
I cannot provide a solution for this as I have dig deep.