Skip to content
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

Clean up CldVideoPlayer and CldUploadWidget resources on:swap #10

Open
colbyfayock opened this issue Sep 16, 2024 · 0 comments
Open

Clean up CldVideoPlayer and CldUploadWidget resources on:swap #10

colbyfayock opened this issue Sep 16, 2024 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@colbyfayock
Copy link
Collaborator

Astro makes available the astro:before-swap event that can allow us to clean up any resources prior to clientside page change.

https://docs.astro.build/en/guides/view-transitions/#astrobefore-swap

We should listen for the astro:before-swap event in the CldVideoPlayer and CldUploadWidget components, and when it fires, run the destroy method on the given widget instance.

Example in Next.js: https://github.com/cloudinary-community/next-cloudinary/blob/main/next-cloudinary/src/components/CldUploadWidget/CldUploadWidget.tsx#L135-L140

@colbyfayock colbyfayock added the help wanted Extra attention is needed label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant