Closed barata0 closed 7 years ago
Hi @barata0, thanks for submitting this. I think the bug in the example is in a slightly different place. If the ordering of the inputs is changed in the original example the code will work as expected (same as your solution works). But be a bit simpler and have no need to connect each video node to the destination as well as the transition:
var videoNode1 = videoCtx.video("./video1.mp4");
videoNode1.start(0);
videoNode1.stop(4);
var videoNode2 = videoCtx.video("./video2.mp4");
videoNode2.start(2);
videoNode2.stop(6);
var crossFade = videoCtx.transition(VideoContext.DEFINITIONS.CROSSFADE);
crossFade.transition(2,4,0.0,1.0, "mix");
videoNode1.connect(crossFade); //Swap so videoNode1 is connected first.
videoNode2.connect(crossFade);
If you update this pull request with this change i'll happily merge it so you have commits contributing to the project. Or I can do this myself.
Kind regards, Matt
No problem. You can do it. Thanks for the explanation and the great project
The nodes were only visible during the crossFade. Connecting them to the videoCtx.destination make them visible before and after that making the effect more impressive. The transition value was wrong also going from 0 to 1 means 1st clip started on fade.