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

Add Soundcloud embeds for songs and playlists #9

Merged
merged 13 commits into from
Sep 18, 2019

Conversation

nicknish
Copy link
Contributor

@nicknish nicknish commented Sep 4, 2019

Hello! After sorting through some trouble with other gatsby embed plugins, I found this project a few days ago and I'm already excited about it. Thanks for the hard work!

I saw that Soundcloud embeds was an issue in #3, so I went ahead and gave it a go.

Closes #3

What:

Add Soundcloud embeds

Why:

Existing issue #3

How:

  1. Validate the URL is a standard song or playlist URL (e.g. https://soundcloud.com/clemenswenners/africa)
  2. Generate an iframe url that mirrors the standard Soundcloud embed generated from their website* (e.g. Go to song/playlist > Share > Embed)
  3. Return the iframe HTML string

Screenshots:

I created a CodeSandbox example to demo the output and to compare its appearance to the typical Soundcloud embed. Check it out below

https://codesandbox.io/s/soundcloud-dynamic-embed-zkjm9

*Implementation Notes:

  • By default, I've set the Soundcloud embed to NOT autoplay. Because this is a library, I thought it would be more flexible for most consumers' use cases (e.g. in case they want to embed multiple Soundcloud songs/playlists in succession)

Checklist:

  • Documentation
  • Tests
  • Ready to be merged

@nicknish nicknish marked this pull request as ready for review September 4, 2019 11:07
README.md Outdated Show resolved Hide resolved
@swyxio
Copy link

swyxio commented Sep 5, 2019

gorgeous!

@nicknish
Copy link
Contributor Author

nicknish commented Sep 7, 2019

Hi @MichaelDeBoey! Any feedback on this guy? ☝️

Also -- thanks @sw-yx, I appreciate your work!

Copy link
Owner

@MichaelDeBoey MichaelDeBoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nicknish!

I'm sorry for the late response, but apparently my notifications for this repo were disabled somehow. 😕

Thanks for taking your time to implement the SoundCloud transformer!
Really awesome work.

I've added some small improvements and better default-values (imo) before this one can be merged.

Let me know if you need some further help. 🙂

src/soundcloud.js Outdated Show resolved Hide resolved
src/soundcloud.js Outdated Show resolved Hide resolved
src/soundcloud.js Outdated Show resolved Hide resolved
src/soundcloud.js Outdated Show resolved Hide resolved
src/soundcloud.js Outdated Show resolved Hide resolved
src/soundcloud.js Outdated Show resolved Hide resolved
src/soundcloud.js Outdated Show resolved Hide resolved
src/__tests__/soundcloud.js Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@nicknish
Copy link
Contributor Author

nicknish commented Sep 15, 2019

@MichaelDeBoey Hi Michael. Thanks for taking a peek at my PR. 🎉

I updated it with your suggestions:

  • Revert extra spacing in docs
  • Use implicit returns when using arrow => functions
  • Remove encoding Soundcloud iframe source url
  • Update Soundcloud iframe default options:
    • show_teaser: false
    • hide_related: true

README.md Outdated Show resolved Hide resolved
@nicknish
Copy link
Contributor Author

@MichaelDeBoey Phew. Got rid of all those pesky trailing slashes. 😄 All ready for 👀again

src/soundcloud.js Outdated Show resolved Hide resolved
src/soundcloud.js Outdated Show resolved Hide resolved
@nicknish
Copy link
Contributor Author

All resolved. Will keep an eye on notifications in case there are any other changes necessary. I'll also keep in mind the changes here when making future contributions 😄

Copy link
Owner

@MichaelDeBoey MichaelDeBoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All seems good to be merged.

You just have to add the transformer in the main file, otherwise it won't run.

@nicknish
Copy link
Contributor Author

@MichaelDeBoey all set! Thanks for your patience with this one 😄

@MichaelDeBoey MichaelDeBoey force-pushed the nicknish/add-soundcloud branch from 2c2931d to b2acd99 Compare September 18, 2019 11:41
@MichaelDeBoey
Copy link
Owner

@nicknish No problem at all! 🙂
We're all here to help each other out 😉

Did some small nitpicks, but all good.

Thanks for the great contribution! 👊

@MichaelDeBoey MichaelDeBoey merged commit 9843fcf into MichaelDeBoey:master Sep 18, 2019
@MichaelDeBoey
Copy link
Owner

@all-contributors Please add @nicknish for code and test

@allcontributors
Copy link
Contributor

@MichaelDeBoey

I've put up a pull request to add @nicknish! 🎉

@MichaelDeBoey
Copy link
Owner

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nicknish nicknish deleted the nicknish/add-soundcloud branch September 18, 2019 19:40
@MichaelDeBoey MichaelDeBoey added the ⚙️ SoundCloud Issue or pull request regarding SoundCloud label Oct 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released ⚙️ SoundCloud Issue or pull request regarding SoundCloud
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support SoundCloud
3 participants