I would like to display Sound Cloud audio clips on my Drupal site.

I've tried adding the code supplied by Sound Cloud to a custom provider enabled Embedded Audio Field and it did not work.

Any chance that you can add this to either the Embedded Audio Field or Embedded Video Field?

Here is some example code that Sound Cloud gives.

<div style="font-size: 11px;"><object height="81" width="100%">  <param name="movie" value="http://player.soundcloud.com/player.swf?track=raiden-shakedown-mix-5&amp;show_comments=false&amp;auto_play=false&amp;color=ff7700"></param>  <param name="allowscriptaccess" value="always"></param>  <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?track=raiden-shakedown-mix-5&amp;show_comments=false&amp;auto_play=false&amp;color=ff7700" type="application/x-shockwave-flash" width="100%"> </embed> </object> <div style="padding-top: 5px;"><a href="http://soundcloud.com/shakedowndnb/raiden-shakedown-mix-5">Raiden -Shakedown Mix #5</a>  by  <a href="http://soundcloud.com/shakedowndnb">Shakedowndnb</a></div></div> 
CommentFileSizeAuthor
#20 media_soundcloud.zip17.35 KBjoachim
#3 soundcloud.patch6.75 KBrobloach

Comments

sdk’s picture

Hello there,

in order for custom content to play you need to supply an URL that is pointing directly to an audio file.

Something like:

www.example.com/test.mp3

The code mentioned above is an embed code for the soundcloud player i suppose. There is no direct link to the track because the music on soundcloud is download protected. It should work with any other direct link to a soundfile.

Cheers

sdk

cookiesunshinex’s picture

http://player.soundcloud.com/player.swf?track=raiden-shakedown-mix-5
redirects to
http://a1.soundcloud.com/player.swf?track=raiden-shakedown-mix-5&remote_...

I posted a message on the soundcloud help forum asking whether soundcloud URLs support oembed (needed for easily creating the provider files).

This is the response I got.
======
hi,
yes, the good news is we just started supporting oembed, so you could definitely use it to power soundcloud on drupal.

there's no documentation yet, but you can do e.g:

http://soundcloud.com/oembed?url=http://soundcloud.com/forss/flickermood...

or follow the
-tag to the oembed endpoint on each track/sets/groups page...

cheers,
eric

robloach’s picture

Status: Active » Needs work
StatusFileSize
new6.75 KB

It also supports setting the color and showing the comments.

Babalu’s picture

thank you, but for me it works just the url, but not the share code

Mindexperiment’s picture

I'm interested in this topic.. so how can I embed a soundcloud player on a node?? using embed media field..
Thanks

robloach’s picture

You apply the patch I uploaded, test it out, and if it works for you, set the issue to RTBC. If it doesn't work for you, then post a review of what you found, maybe help fix it up a bit, so that progress can be made with it :-) .

Mindexperiment’s picture

Ok I try to use the patch but there's seem to be an error..

First what I have to insert on the url field?? I try different type of link but sometime I get: "You have specified an invalid media URL or embed code." and sometime "The player doesn't shown"

I take a look o the code and I can find the solution.. need more accurate help on the url field description for the end user.

Babalu’s picture

on my website the patch works, but just with the url, not with the share code or the embed code (look: http://funnydate.de/blog/babalu)

Mindexperiment’s picture

@babalu wich url??? the direct link to the track? where you find it on soundcloud??

Babalu’s picture

Mindexperiment’s picture

Ok now it works.. Maybe someone can implement the color of the player and the artwork.. :O)

Stay up!!

lexter.grouve’s picture

so from what i understand it is possible to integrate soundcloud track but only with the soundcloud player and with default look& feel as there is no possibility to change the seetings???

dieslepo’s picture

Have installed the module patch (it shows up in admin) and tried various URLs - none of which seem to work.

Any suggestions for where I could be going wrong?

dieslepo’s picture

Have installed the module (it shows up in admin) and tried various URLs - none of which seem to work.

Any suggestions for where I could be going wrong?

joeytheman’s picture

@dieslepro did you enable soundclick for Providers Supported when you configured your CCK field?

joachim’s picture

Confirming this patch works for me. (Although anyone who finds anything worth listening to on soundcloud gets a cookie...)

However, the policy for emfield module appears now to be that provider plugins are to be hosted as separate projects on drupal.org.

I've reworked the patch as a full module and I can make a project for it here. Does anyone want to co-maintain it?

problue solutions’s picture

joachim is your module available to download anywhere?

joachim’s picture

I can zip it up and post it here but then we still have the problem that successive fixes or improvements get posted as subsequent attachments.

This needs to be a proper project with CVS & an issue queue. I can set all that up, but I would like someone to volunteer to be a co-maintainer as I have too many projects I maintain already.

problue solutions’s picture

Yeah I understand, unfortunately i dont have the experience required to volunteer (I only have very limited php knowledge and module development which I'm assuming rules me out as a co-maintainer), I will however test and help debug anything you come up with, or do anything else required.

Soundcloud is becoming the industry standard platform for labels and artists for promos and demos, so a module would most definitely be very useful. A fully fledged soundcloud module that talks to the API allowing uploads and all sorts would be incredible, quite a bit of work though I'd imagine!

If you could post the zip in the meantime I'd really apprecaite it, I fully understand your concearns about doing so, but it would help me a lot right now until this can be brought in as a proper project.

joachim’s picture

StatusFileSize
new17.35 KB

Okay here it is.

A bit of PHP knowledge would be needed, as well as being able to use CVS and make patches, but these are all things that can be learned on the go. It's more about having the free time!

jorisx’s picture

Was just looking for this!
Thanx for the patch Joachim :) gonna test out later today!

edit
Just tested it and it works like a charm :)
enable the module and just copy and pasting the url from soundcloud!
I've set the width to 100% which stretches the soundcloud player from side to side in my block :)

beautiful! keep up the good work :)

pribeh’s picture

Tested with emfield 1.24. After saving a node with a soundcloud url (of an embeddable track) inputted into the audio field I get the following error message and no display of the audio player/field:

warning: Parameter 6 to emaudio_soundcloud_audio() expected to be a reference, value given in /var/www/thomas/testing.londonfuse.ca/sites/all/modules/emfield/emfield.module on line 622.

Which refers to the following line:

return emfield_include_hook($module, $provider, $hook) ? call_user_func_array($function, $args) : NULL;

Which is the last line in:

function emfield_include_invoke() {
  $args     = func_get_args();
  $module = array_shift($args);
  $provider  = array_shift($args);
  $hook     = array_shift($args);
  $function = $module .'_'. $provider .'_'. $hook;
  emfield_system_list($module, $provider);
  return emfield_include_hook($module, $provider, $hook) ? call_user_func_array($function, $args) : NULL;
}

Thanks for initial work on this joachim.

joachim’s picture

Title: Sound Cloud provider for Embedded Audio Field » add a link to Sound Cloud provider for Embedded Audio Field
Component: Embedded Audio Field » Miscellaneous
Status: Needs work » Active

The release date of Emfield 1.24 is 2010-Jul-20. That's after I posted the module code. So obviously something has changed since.

This is exactly why this needs to be a project, as it we can't just keep updating the zipfile here every time that happens.

I've posted the same code as my zipfile above here: http://drupal.org/project/media_soundcloud

As I said earlier: co-maintainer(s) needed. The site I needed this for is now complete and I haven't the time to take this on as a personal project.

Please re-file the problem in #22 on that issue queue.

In the meantime, setting this issue back to active as it's now about asking the maintainer of emfield to add a link on the emfield project page to the new module :)

aaron’s picture

Status: Active » Fixed

got it! thanks, @joachim. sorry, i only now realized i hadn't chimed in on this thread earlier to state that emfield no longer adds new providers to the core module, and is in fact in the process of unloading its current providers.

thanks,
aaron

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.