delucis / astro-embed

Low-JavaScript embed components for Astro websites
https://astro-embed.netlify.app
MIT License
194 stars 30 forks source link

feat: Spotify Embed #72

Open vasfvitor opened 10 months ago

vasfvitor commented 10 months ago

Hello, this aims to solve #32

NOT READY TO MERGE

Basically it provides a interface to Spotify iframe snippet, so it's not overly optmized as lite-vimeo and lite-youtube where the iframe only loads on interaction. Should this be done to the Spotify iframe (I don't know how, btw, but could try)?

For reference there's a Svelte and Eleventy library around that utilize this same approach, simple iframe embed. Found this too: https://github.com/luwes/spotify-audio-element

I couldn't get tests to work, neither by npm t, or npm run test:ci, actually the latter runs but all fails. But I want to write tests for it.

I've tried to use the Spotify oembedAPI but I'm not sure the tradeoffs are worth it. Benefits were having embed html snippet and a 300x300 thumbnail image that would allow us to create a link card component as an option over embedded player (if desired), OTOH more code would be need to allow the current customization options. I'm willing to rewrite if needs so.

Preview:

Thank you.

changeset-bot[bot] commented 10 months ago

⚠️ No Changeset found

Latest commit: 5b058e121e43f4bcb51ad0f189537449f16bf469

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR