-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add loading indicator when video is loading? #182
Comments
the vimeo element must be in the DOM for the video to load. Your approach can probably work, if you keep the vimeo component mounted unconditionally: <>
{loading ? (
<div
style={{
width: 210 * scaleImageFactor,
height: 90 * scaleImageFactor,
}}
>
... Loading
</div>
) : null}
<Vimeo
video={project.vimeoId}
width={210 * scaleImageFactor}
height={90 * scaleImageFactor}
responsive={true}
onLoaded={() => setLoading(false)}
/>
</> Then you can use CSS to put your loading overlay on top of the video. you would need to call |
I see what you want to achieve. So you're saying there was no thought involved yet to show a loading screen as long as the video is loading? As I'm seeing big layout changes when the video is loaded as there is no placeholder meanwhile. *Thank you for your fast answer! |
well, I did think about it and concluded that this library should not have that functionality. but it should provide the events necessary so you can implement it yourself, and my previous reply is just a suggestion of how you might achieve it. If more events are needed that are provided by the vimeo SDK then the library should provide access to those. |
Problem
I want to show a loading indicator as long as the video is loading.
Is there any workaround for now?
What I've tried but for sure can't work because of the architecture:
Potential Solution
A prop like
loadingOverlay={<div><p>...loading</p></<div>
which accepts anJSX.Element
as a loading placeholder for the video.The text was updated successfully, but these errors were encountered: