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

SoundCloud Embedding Support #20

Closed
TheNotary opened this issue Feb 11, 2015 · 2 comments
Closed

SoundCloud Embedding Support #20

TheNotary opened this issue Feb 11, 2015 · 2 comments

Comments

@TheNotary
Copy link

Hey, it's good to see you're still giving life to the repo, Veger. How would you feel about adding a sound cloud tag, and making it available for use through the [media] tag. I think this feature would really make the gem look nice.

Example:
http://jsfiddle.net/33sdey01/1/

Resource:
(Note that the 'share' widget isn't being tested against firefox, so you need chrome to get the embed link copied, heh)
https://soundcloud.com/pages/embed

Example wordpress BBCode in the wild:
[soundcloud url="https://api.soundcloud.com/tracks/34019569" params="auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true" width="100%" height="450" iframe="true" /]

Let me know how you feel. It looks pretty straight forward and just needs a tag to be inserted and also a tiny bit of code to escape the '/' characters.

@veger
Copy link
Owner

veger commented Feb 11, 2015

I suppose such a tag would be very similar as the [vimeo]-tag. Something like this, would probably work:

 :soundcloud => {
        :html_open => '<iframe width="400" height="300" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player?url=%between%></iframe>',
        :html_close => '',
        :description => 'Soundcloud',
        :example => '[soundcloud]http%3A%2F%2Fsoundcloud.com%2Fximekon%2Fsets%2Fximekon-2012-latest-works%2F&visual=true&auto_play=true&show_comments=true[/soundcloud]',
        :only_allow => [],
        :require_between => true},

The %between% parameter might indeed need some 'HTML-escaping' (so the user does not have to escape the URL himself).

As this is (sort-of) straightforward, I do not really feel the need to add this tag:

  • It clutters the default-tags, and the gem is made such that it is possible to (easily) add custom tags (use multiple methods).
  • The tag (as I defined it above) is not very elegant, as the user needs to provide a complete URL. It would be much better to add (lots of) parameters, that constructs the full URL. Although this makes the tag very complex (hence not suitable to add as a default).

On the other hand: I suppose it would be convenient to add a way to escape any parameter, by adding a new field to the parameter description. I opened issue #21 for this.

I hope you understand my reasoning for not implementing this tag.
Of course, if some generic/reusable code support is required (besides parameter escaping) to make this tag work, we can add it to the code-base.

@TheNotary
Copy link
Author

Understood, and I can see your point. I think after issue 21 is tackled, end users can easily add the soundcloud tag, so this issue can be closed. I had another thought on making custom tags easier to work with, I'll post the separate issue there.

@veger veger closed this as completed Feb 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants