Okay thank you.
Changed the code to this:
but getting this error:
Loading.js:27 Uncaught (in promise) DOMException
import TweenLite from "gsap";
import TweenLite from "gsap";
class Loading{
constructor(){
this.smokeVideo = document.querySelector("#js-loading-video");
this.smokeVideo.addEventListener("ended", () => this.removeLoadingSection()); // ERROR HERE NOW
this.AnimationEffects();
}
textAnimation(){
let textContent = document.querySelector("#js-loading-text-content");
TweenLite.to(textContent, 0.7, {
opacity: 0,
delay: 2.5,
onComplete: () => this.playVideo()
});
}
AnimationEffects(){
this.textAnimation();
}
playVideo(){
this.smokeVideo.play();
this.smokeVideo.playbackRate = 1.5;
}
removeLoadingSection(){
TweenLite.set(document.querySelector("#js-loading"), {display: "none"});
}
}
export default Loading;