Imagine a scenario where I have a service that either returns an error or a video URL to be played. If a video is present, React will display the video; if not, it shows the error message. I want to ensure that there is always a placeholder/error message with the same height across all devices as the video that should be displayed.
In simpler terms, I want to establish rules such as: if a 16:9 video is expected, then set the height of the error message placeholder equal to the height of the video in that specific screen size.
Is there a way to calculate this dynamically while maintaining responsiveness based on aspect ratio? Does this concept seem logical?
Appreciate any insights you can provide. Thank you!