Embedding soundcloud link on featured image post to launch mp3 player on

So I've been searching the web and I can't find a good answer on how to have a featured image with a play button, once I click the play button it launches a mp3 player built on wordpress site and where i can change Or add. Much like this site -> indieshuffle.com.

Does anyone know how to do that or at least give me some material to start with even a theme would be amazing

Answers


Although its a very simple task, if you dont have enough knowledge of programming then it will be hard to achieve. And not many people will help you on stackoverflow without any existing code to show them.

Here's how i would have achieved it. First i would attach the featured image to the post (the default functionality). Then i would create a custom field to save the soundcloud id of the song. Then in your theme you should wrap the featured image with a div and have a play button on hover. Then use javascript/jquery to look for click events (ie. what should it do when someone clicks on the image). Then i would use the Soundcloud API and use the play function to play the desired song. Here is a code i got from the API docs.

<script src="http://connect.soundcloud.com/sdk.js"></script>
<script>
SC.initialize({
  client_id: 'YOUR_CLIENT_ID'
});

// stream track id 293
SC.stream("/tracks/293", function(sound){
  sound.play();
});
</script>

Just take it slow, start from the beginning and go through the points i mentioned, it would be much easier to help if you start somewhere and ask a specific question.

You might already be familiar with the embed code, but if you just want to show the song in your post you can use the embed code in your post. Something like this https://soundcloud.com/pages/embed. There are also some wordpress plugins for soundcloud that will automatically embed the code if you give it the id of the song.


Need Your Help

Please comment on this simple software protection schema

protection drm

I was asked implement a licensing schema for our product. They are very expensive products with few customers sparsely distributed around the world and basically every one of them has a design