I’m using a component to load a video and an image. When I change the “ambience,” the shader handles the transition using a progress value, showing the image of the next video. Meanwhile, I load the next video by updating selectedAmbience. Once the new video is loaded (I check this by observing changes in duration), I reset progressValue to 0 without a transition.
Issues
A black screen appears initially before the video starts playing.
Sometimes, a black screen flickers briefly as soon as the component renders.
I’d like to know when a video has fully loaded so I can switch properly, without relying on the duration property.
Description
I’m using a component to load a video and an image. When I change the “ambience,” the shader handles the transition using a progress value, showing the image of the next video. Meanwhile, I load the next video by updating selectedAmbience. Once the new video is loaded (I check this by observing changes in duration), I reset progressValue to 0 without a transition.
Issues
Video
https://x.com/_smontlouis/status/1839301672633311314
Version
1.3.11
Steps to reproduce
Copy the code pasted
Snack, code example, screenshot, or link to a repository
Code