You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What do you guys think? I noticed that changing the poster will show a blank thumbnail for a brief moment because the new thumbnail needs to get downloaded. I've already tried putting a prefetch element into the , but couldn't get it to work yet (it doesn't create a request):
By the way i think it would be cool if the type for the poster prop was importable. You can technically get to it through Parameters<typeof LiteYouTubeEmbed>["0"]["poster"] but yeah i'll let it speak for itself lmao
I'll make a PR for that little export.
The text was updated successfully, but these errors were encountered:
This hook has a disadvantage: the thumbnail will briefly blink because when the timeout runs, the state update will immediately unload the old image and then start loading the new image, so there's a "downtime". I was playing around with dynamically adding a <link> prefetch element to preload the bigger thumbnail but couldn't get that to work.
That's why i didn't end up using the hook i wrote above. Maybe someone has a better solution :)
Title pretty much says it all.
I was curious so i wrote this custom hook who's return value i pass to the
poster
prop:What do you guys think? I noticed that changing the poster will show a blank thumbnail for a brief moment because the new thumbnail needs to get downloaded. I've already tried putting a prefetch element into the , but couldn't get it to work yet (it doesn't create a request):
By the way i think it would be cool if the type for the
poster
prop was importable. You can technically get to it throughParameters<typeof LiteYouTubeEmbed>["0"]["poster"]
but yeah i'll let it speak for itself lmaoI'll make a PR for that little
export
.The text was updated successfully, but these errors were encountered: