Next.js Discord

Discord Forum

Would like to know how to appropriately change the background to a gif or a mp4 looped video

Unanswered
Bombay-duck posted this in #help-forum
Open in Discord
Bombay-duckOP
Hello!

Would like to know how to appropriately change the background to a gif or a mp4 looped video with less / little lag

I am currently using Typescript, NextU (component library) any recommendations to have a less laggy background

2 Replies

@Bombay-duck Hello! Would like to know how to appropriately change the background to a gif or a mp4 looped video with less / little lag I am currently using Typescript, NextU (component library) any recommendations to have a less laggy background
you can make a transparent background for you video and then put it inside a relative box. Then put the video and another div (background) inside this box. Make the background position: absolute, and height 100% and width 100%, so it fills out the box, like the video does. Now you have an element behind the video (maybe you also need to do something with zIndex) and you can change this element like you want. You can conditionally render stuff inside or change stuff with css or ...
@Bombay-duck solved?