AmitDigga/fabric-video-editor

Doubt regarding CoverVideo and Video Addition flow

ritvij14 opened this issue · 1 comments

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 of fabric.Image but when using it like fabric.CoverVideo.fromURL the browser gives an error saying fabric.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?

Hi @ritvij14
I am little busy in other projects.

First part

This problem might be solved by overriding this method

addVideoResource(video: string) {
this.videos = [...this.videos, video];
}

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

addVideo(index: number) {

Second Part

I cannot provide a solution for this as I have dig deep.