brianchirls / Seriously.js

A real-time, node-based video effects compositor for the web built with HTML5, Javascript and WebGL
MIT License
3.87k stars 354 forks source link

Seriously - Angular 2 #121

Open REPTILEHAUS opened 8 years ago

REPTILEHAUS commented 8 years ago

Im trying to use this plugin in an angular 2 web app. Im coming across a problem where it works the first time a page is loaded but then when i naviagate away and then back to the page the videos dont show in the canvas.. Ive tried resetting the seriously instances using the following

        this.seriously.destroy();
        this.seriouslyB.destroy();

        if (this.seriously) { this.seriously = null; console.log('destroyed s1'); }
        if (this.seriouslyB) { this.seriouslyB = null; console.log('destroyed s2'); }

in the angular 2 ngOnDestroy method, which basically gets fired when you navigate to a different page and then I am reinitiating seriously using the ngOnInit method which basically fires them again using this code

                this.seriouslyB = new Seriously();
                this.thevideoB = this.seriouslyB.source('#videoB');
                this.targetB = this.seriouslyB.target('#canvasB');
                this.targetB.source = this.thevideoB;
                this.seriouslyB.go();

             this.seriously = new Seriously();
                this.thevideo = this.seriously.source('#video');
                this.target = this.seriously.target('#canvas');
                this.target.source = this.thevideo;
                this.seriously.go();

am i missing anything that could help.. its a pretty big blocking factor and if I cant get it to work il have to scrap the plugin from the project which I really dont want to do.

z639 commented 7 years ago

Similar issue for me, did you find a solution ?