Playlists in Drupal 7?

Events happening in the community are now at Drupal community events on www.drupal.org.
gusaus's picture

I'm trying to create an audio library similar to this with Drupal 7. While I've replicated a good deal of functionality using Views, Media, and jPlayer, I'm stuck on the playlist functionality. Any suggestions on how to do this in Drupal 7? Example again below:

https://skitch.com/gusaus/r599d/getty-images-search

Comments

Not possible yet in Drupal 7?

gusaus's picture

As far as I can tell this type of functionality does not yet exist for Drupal 7 and some of the key modules are no longer supported.

http://drupal.org/project/audio
http://drupal.org/project/playlist
http://drupal.org/project/xspf_playlist

It seems like this functionality would be useful in Drupal 7. Does anyone know the best way to achieve?

Gus Austin

I'd check out Node Queue for

zirafa's picture

I'd check out Node Queue for doing something like this.

Also Media Gallery

gusaus's picture

I already have Node Queue on a sandbox, but it wasn't apparent right away how you'd use that to create playlists from the node itself. Media Gallery which comes with Drupal Gardens also provides some similar functionality.

I set up this issue and the larger Music Feature/Distro project on Drupal Kata - http://drupalkata.com/music/node/1666

Gus Austin

node queue is not a first stop

fending's picture

I agree that node queue is not a match for this. It can sort of do the job, but certainly not in its current D7 state and not in a person-centric way. I've used xspf and xspf_playlist.module before on different projects, and like what one can do with it there. It requires a file or well formed file-equivalent to exist, and has some nice player frontends.

I'll need to check out the Kata project, Gus -- I might like to revive my non-drupal xspf project as a D7 deal this summer for its revival, kicking in some code. Do you have a pressing timeframe for your need?

There are a few D7 playlist solutions

gusaus's picture

Thanks Brian - I think it totally makes sense to update XSPF playlist to Drupal 7. There also are at least a couple other modules such as jPlayer and MediaFront that support playlists, but I can't figure out how to create the 'Add to Playlist' link which would then bring up a playlist cck type. This functionality was fairly obvious with the Playlist module and it's probably one of the first places people new to Drupal still look. Would it make sense to rework the playlist module or create an API? Looks like that option has been brought up before - http://drupal.org/node/275902

SoundCloud also provides some great examples of the functionality we're looking for. I posted some screengrabs here -
http://drupalkata.com/music/node/1666#comment-1276

Gus Austin

some progress

fending's picture

There's been a little progress toward this state in xspf_playlist.module, last alpha for 6.x-2.0 in Oct 2010. http://drupal.org/node/939528 I agree about your screengrab comment re drupal gardens implementing this kind of thing as a out-of-the-box solution. There are many things close to select container (playlist), add note, and add node reference to list. An API is likely the way to go, paving the way for a custom storage method or just using node/field storage.

So in answer to your question, I think it makes sense to rework playlist module or similar with an API/UI separation. Barriers to that include identifying the module whose path is most closely aligned with that vision, laying out basic API features, and seeing if the approach is sensible.

Please be sure to post back here if & when you're moving the subject forward just on Kata.

Any short term solutions?

gusaus's picture

SoundCloud also provides some great examples of the functionality we're looking for - is there any way to do something like this in Drupal 7?

http://drupalkata.com/music/node/1666#comment-1276

Gus Austin

Thoughts on best approach from others?

gusaus's picture

Would be good to get thoughts on best approach from the developers/maintainers of the modules we're talking about. Especially since it sounds more and more like we should rework an existing module.

Gus Austin

Downloading a playlist?

gusaus's picture

Let's say we do find a solution for creating playlists. Is there currently a way to allow users to select and download multiple files? Something like views bulk operations (http://drupal.org/project/views_bulk_operations) could get you part way, but there's no option to compress and download the files selected. This module might have done the trick on Drupal 5 - http://drupal.org/project/bulk_operations

Any solutions for Drupal 7?

Gus Austin

not directly, I don't think

fending's picture

There's this roll-your-own approach http://drupal.org/node/83253 and another d6 module that uses an external library http://drupal.org/project/pclzip to zip all files attached to a node. But nothing that would directly grab a form-based reference to an arbitrary list of field-stored files (checkboxes on a page), read data from those files in order to zip them up, and start to download them. If you don't attempt a d7 port of bulk_operations.module, that first link and its comments look like a good starting point for a new contrib (if the licensing from its source project isn't an issue).

No modern solutions?

gusaus's picture

Thanks again for the feedback Brian! I came across some of the examples you referenced and was a bit surprised most of the solutions or discussions circled around Drupal 4 or 5. Being there are so many large music/media related sites built on Drupal, you'd think more features/solutions/site recipes would currently be available in the wild. Not much interest it seems?

Gus Austin

loopduplicate's picture

There is much interest. But there are not enough people who know how to implement the solutions. Drupal's growth is held back mostly because of the shortage of knowledgeable developer/themers and because many current developers work alone or in small isolated teams.

Sometimes people do not want to give away their code. They have worked hard on it and have made money using it.

They may fear that giving away their secret recipes will somehow leave them without work because other developers can just follow their instructions and steal their clients.

They may not be confident that their code is well formed and so may reason that hackers will be able to exploit it more easily if it's published.

OK. They is sometimes me. I'm trying to change my ways. I'm trying to learn from companies such as Acquia and Phase2 whose success is largely due to a strategy that focuses on marketing themselves by helping the open source community.

I'm trying to learn that sharing my code is good. It's just scary. I promise that if I end up creating any great Drupal 7 based solution for music, I'll share.

Once again, there is much interest, just not enough know-how. Or at least that's what my stupid brain thinks.

Peace out

Hi, I understand what you are

shushu's picture

Hi,
I understand what you are saying about developers, and about yourself.
Be sure - no one will steal anything, basically since when you decide the code is not "yours" - there is nothing to steal...
Sharing your code will just make you a stronger person in the development community, will bring you more work, and will make your work more fun.
When other people use your code, you get to be proud. When people open bugs (and sometimes even suggest how to solve them) - you get even prouder. And hackers ? They just the reason to make your code better...

As a sole developer myself, I really think you should just need to start - release the smallest thing, just something you made and you think people can benefit from. Don't be afraid.

If you want any help - just ask :-)
Shushu

VBO might work eventually

gusaus's picture

Looks like something like this was working on the D6 version of VBO and a desired feature for D7 - http://drupal.org/node/1222844

Maybe we could help w/ that!

Gus Austin

Here's what I have so far

gusaus's picture

This sandbox, graciously hosted by WebEnabled can be cloned and made available to anyone who wants to use, improve, and share back. As mentioned above we also have a group on Drupal Kata to facilitate collaboration on this and other features that would make up a music distribution that's been discussed in this group for years.

I'm stuck on the features we're discussing, but could most likely bring on one sponsor and help wrangle others. Any takers?

Gus Austin

How to clone Sandbox...

chrowe's picture

The WebEnabled docs say "Click/Visit the web-application's share-url, and fill in the required details."
http://www.webenabled.com/clones

Have you shared the share-url for the sandbox somewhere?

I am excited to work on this.

Thanks

Hey guys, If you need help in

marcrobinsone's picture

Hey guys,

If you need help in staging a clonable site on WebEnabled, let me know so I can ask the sysadmins to setup a non-expiring environment / vhost.

Share URL?

chrowe's picture

The site seems to be there http://drupal7media.sandbox.drupalkata.com/ Not sure what deal gusaus has with them so I don't know if it is in danger of expiring.

My issue is that I can't clone it since I don't have the share-url

... in that case, we should

marcrobinsone's picture

... in that case, we should ask gusaus for a share-link.

Might want to set up a proper development environment

gusaus's picture

Hey all - At this point I'm not sure how helpful it would be to share my sandbox since playlists will soon be a feature of the Pushtape music distribution. I think the best bet would be to focus our efforts around that platform, including setting up a proper development environment and workflow. Farsheed is making good progress on the discography feature.

Gus Austin

Sounds good

chrowe's picture

I created http://drupal.org/node/1256798 to follow up on this.

Playlists with the flag module

gusaus's picture

You can use the flag module as a way for people to 'bookmark', 'favorite', or essentially add tracks to a playlist. Problem is there's no obvious way for users to create/share multiple lists. This add-on to flag might provide a solution - http://drupal.org/project/flag_lists

Then again, there's no D7 version of that module.

Gus Austin

Some ideas - Flag and Node

MickC's picture

Some ideas - Flag and Node Queue are architecturally similar in that they both use separate tables. Both are compatible with views.
You could use Views to stream the playlist, based on either Flag or Node Queue, using the flag or queue as the argument for the view.
Node queue is designed for multiple queues and sub-queues - even OG queues - and is draggable to re-sequence.
Alternatively Flag Weights could be used - I suspect that having multiple flags for each playlist could be unwieldy, whereas node queue allows addition of nodes from the queue itself. Having said all that, draggable views could also be useful if there is another criteria for designating the playlist - e.g. terms...

Step 1: Add to or create a new playlist from the track

gusaus's picture

Thanks for the feedback Mick! What you're describing (I think) has to do more with organizing the playlists themselves. Before that, I want to be able to add a track to an existing or new playlist. Seems like a playlist (cck) could be referenced or created w/ in a track (cck) similar to the what you see in these screenshots -

http://drupalkata.com/music/node/1666
http://drupalkata.com/music/node/1666#comment-1276

Adding a track to favorites comes pretty close but again there's only one list -
http://drupal7media.sandbox.drupalkata.com/

I can clone the sandbox if anyone has an idea how to do this.

Gus Austin

Sure, Flag will do that - I

MickC's picture

Sure, Flag will do that - I do something similar for adding events from a list to your personal calendar. Example here http://musicosity.com/events - registered users see an ajax toggle 'Add/Remove' in the 'My Events' column. Then the users own calendar shows all events they have added - it is a view with a relationship to the flag with the option set to 'current user'.
'Add to Playlist' could work the same way, then use flag weights or draggable views to reorder. However this implies just 1 setlist per user corresponding to the one flag. If you wanted multiple playlists per user then might need something like user tags to then filter the playlist by tag. Node queue may do something similar, but would need to check it out.
Alternatively, would be nice to have dedicated playlist functionality developed, but in the meantime this could get us off the starting blocks...

Already have flag workin

gusaus's picture

Flag definitely does the trick for one list per user - if you signin w/ demo/demo you'll see that working here -
http://drupal7media.sandbox.drupalkata.com/

I installed nodequeue, but it wasn't obvious if/how users could create multiple playlists with that.

A copy of the sandbox (need to create a free webenabled acct) is available for anyone who wants to hack around and try to set it up -
http://www.webenabled.com/we_application/snAzyNnD/share/generic

Gus Austin

Nice one Gus - have you tried

MickC's picture

Nice one Gus - have you tried Flag Weights or Draggable Views yet for reordering? http://drupal.org/project/flag_weights

Intalled and enabled

gusaus's picture

Those modules are installed, enabled, and ready for someone to make this all work! I'll dig around a bit more tomorrow.

Gus Austin

Should we bring back the Playlist module?

gusaus's picture

As far as I can tell, the Audio module came the closest to providing this type of functionality but it never really worked in Drupal 6 and beyond (http://drupal.org/node/342556). As this probably wasn't the obvious choice for people wanting to create an 'add to playlist' for video or 'sets' for photos, are there any site recipes or best practices?

Would it make sense to bring back the Playlist module?

Gus Austin

Hey Gus, Can the "add to

zirafa's picture

Hey Gus,

Can the "add to playlist" action be on the node edit form, or are you looking for something that is more like a link on the node view itself?

Pretty much like it was before

gusaus's picture

I'll have to dig around for some examples of how this worked w/ the audio module (and playlist?), but I think it's pretty similar. Here again are a couple screenshots/examples of what we'd like to do in Drupal 7.

http://drupalkata.com/music/node/1666

So the link would be on the node itself.

Gus Austin

node-ref

dgoutam's picture

I am not sure but seems like it could be case of node-ref.

References in D7

gusaus's picture

References (http://drupal.org/project/references) could be the glue that holds them together, but we still need the UI that enables you to attach the tracks to playlists. As far as I can tell, there is no module or feature that provides that out of the box.

Gus Austin

References in D7 plus Corresponding Nodereferences

g76's picture

a thought, wouldn't corresponding nodereferences work? You would create a nodereference to the track from the playlist and also the reverse: to the playlist from the track. Both would get updated and nodereferences can be added/created both ways. Then it's deciding to use node reference create or node connect for D7. It would be nice if noderelationships was ported, but I don't think it is yet.

Gus, I've made some progress

zirafa's picture

Gus,

I've made some progress on this and have created a little UI that helps connect a track to a playlist/album using a node reference select field. The workflow looks like this:

node/add/track
Album [dropdown select list]
- Album 1
- Album 2
- Album 3
- Create New

If Create New is selected, it will prompt you for a name and upon saving the track will create a new album with that name that is then associated with the track.

I'll post some code to try out probably early next week.

Working on this too

gusaus's picture

Great to hear! Fending is currently helping develop this for a client and we'll be pushing community useful code/experiments to the sandbox referenced above. Will the UI you're working on enable you to add tracks to playlists similar to these examples? That seems to be the trickiest piece.

Would be great trade notes as and code as we go.

Gus Austin

Hey Gus,What I've got going

zirafa's picture

Hey Gus,

What I've got going simply assigns a track to an album from the track's node edit form using some tweaking of the node reference form. It should be possible to add some extra UI for the workflow you are going for though I'm trying to keep things pretty simple for now...certainly we should trade notes though!

interesting

fending's picture

So the nodereference "lives" with the track? What about the playlist node having node references to the tracks? Perhaps this is what the form magic is, dunno. My thinking here, though, is extensibility -- allowing for a multitenant set of playlists where one person can own and have edit privs to a playlist... including node refs selected from the global pool of tracks. Does that user story / use case make sense?

Yes, the way mine works is a

zirafa's picture

Yes, the way mine works is a 1-1 relationship between track and album - the album is just a target and the noderef lives with the track.

I think I'd do playlists differently - create a playlist content type with multiple nodereferences to tracks. The pool of tracks to choose from via the nodereference can be controlled through the noderef configuration. Cool thing is doing it this way you can just use the default cck tabledrag for multiple fields to sort.

You make a good point though. I used to think playlists and albums were one and the same idea but the workflow for each is different and the user scenario is different. Maybe I'm wrong and there is a simple way to go the other direction but at least from a UI perspective they seem like two different beasts.

The old playlist module comes close

gusaus's picture

The old playlist module comes close to what we're trying to do. This thread shows a few examples.

Would either of these approaches get us close?

Gus Austin

To expand on my above comment

zirafa's picture

To expand on my above comment - it seems like the real issue is having a workflow where you can view a list of songs and have some way of adding this to a user's playlist. Here's how I'd approach it on first glance:

1) Create a playlist content type with cck noderef field. Set the number to unlimited to allow multiple noderef items per playlist.
2) Create a new module that adds a special menu item to do playlist operations and adds a link per audio. This was pretty much how the old playlist module worked. The song would have a link that said something like "add to playlist" and clicking it would show a special form.

audio_playlist/%node

the %node is the song in question, and the next step is to show a form that loads up all the playlists they can add it to. Upon clicking submit, the form submit function would go and load the playlist node and add the new track in the URL as a nodereference field.

You add a special link to audio files and a "add to playlist" form, that when submitted modifies the noderef values for the playlist content type. The old module used audio_attach, but noderef basically does the same thing.

Does that make sense?

right on

fending's picture

Yeah, the Playlist feature is more ad hoc than Album data. Relative to playlists, tracks are on fewer albums... but I guess this could work for Albums, too if the UI is sorted. But a noderef from within Playlist is the goal here.

The confusing part of the conversation above, I think, is that one wishes to act of the Playlist node(s) from with the Track node context. In Gus's case, it's an arbitrary list of track nodes (individual track as you mentioned, or filtered view, or view of tracks by album, etc). You're right that the challenge in that is strictly in UI implementation (though not a theming problem by any means), and having sufficient callbacks to handle: create Playlist node, add noderef to Playlist node, remove noderef from Playlist node, etc cases.

For sure. Having one callback

zirafa's picture

For sure. Having one callback form that acts as a mediator could help simplify the UI. i.e. a single callback url that takes parameters such as track, playlist, and operation to perform (add, remove). This could be a single form with dropdown select boxes for each and if the URL contains one of the parameters it hides it from display. For instance if you provide the track (song #2) and the operation (add) then the only thing the user sees is a dropdown box to select the playlist. But if there are no parameters in the URL it just shows three select boxes to perform a playlist operation. In that sense it's a single form that can be pre-populated (and hides the pre-populated choices). The choice to "Create new playlist" would prompt for the name of the new playlist and create that playlist node before performing the playlist operation.

Just throwing some potential ideas out there!

Contextual Administration?

gusaus's picture

Not sure how many people are familiar with this module, but from I can tell, it could provide some of the functionality we're looking for -
http://drupal.org/project/context_admin

Any thoughts or working examples of D7 playlists?

Gus Austin

Added this as a Pushtape feature request

gusaus's picture

Might as well start filling up the issue queue! http://drupal.org/node/1223882

Gus Austin

Using SoundCloud Player

clicchick's picture

Hey, I came across this group while trying to put a simple playlist on my website. Just thought I'd share my solution (for now):

  1. Decided to use SoundCloud to host the music files, and found this in the documentation:
    http://developers.soundcloud.com/docs/custom-player
  2. Downloaded css and javascript files from github:
    http://github.com/soundcloud/soundcloud-custom-player/archives/master
  3. Added css and javascript via preprocess hook:
    $scplayer_style = path_to_theme() .'/css/sc-player-standard.css';
    $scplayer_js = array( path_to_theme() .'/js/soundcloud.player.api.js',
                     path_to_theme() .'/js/sc-player.js');

    if(file_exists($scplayer_style)) {
        drupal_add_css($scplayer_style);
    }
    foreach($scplayer_js as $f) {
       if(file_exists($f)) {
          drupal_add_js($f);
    }
    }
  4. Created a block with the following simple HTML:
    <div class="sc-player">
      <a href="http://soundcloud.com/matas/hobnotropic">My dub track</a>
       <a href="http://soundcloud.com/van-rivers/lykke-li-im-good-im-gone-van-rivers-the-subliminal-kid-remix">Lykke Li remix</a>
       <a href="http://soundcloud.com/forss/forss-vs-borg-deadline-live-in-milan-2004">Forss live</a>
       <a href="http://soundcloud.com/max-richter/wwb-the-haunted-ocean-1">Max Richter: The Haunted Ocean 1</a>
    </div>
  5. Fiddled with the CSS to make it pretty.

Only local images are allowed.

Drupal beginner here! So lemme know if you spot any glaring mistakes or have a suggestion or something. :)

This looks great!

gusaus's picture

Nice job! - This is the first example Soundcloud on Drupal 7 I've seen. There are a couple modules, but nothing for Drupal 7.

http://drupal.org/project/soundcloud
http://drupal.org/project/media_soundcloud

Possibly what you've done might be a good catalyst for some upgrades.

Is there a live site where we could see this?

Gus Austin

Thanks!

clicchick's picture

Yea, I was hoping someone had already written a module for Drupal 7, cuz I've never developed a module before (not yet, anyway!). I just needed a simple playlist solution, so this block should work for now. Maybe when I've have time I'll try my hand at a module...

No live site yet! But when it's live, I'll definitely post the link here.

Nice one. I like how the api

zirafa's picture

Nice one. I like how the api uses simple html combined with some javascript to render the playlist. I wonder if this could combine or play nicely with Soundmanager2...

That link you asked for

clicchick's picture

www.mbube.org/about-mbube

It's towards the bottom.

Thats great!

gusaus's picture

Giving people an easy way to select/embed their favorite media players/widgets (jPlayer, SoundCloud, SoundManager 2, 8tracks, etc) would be a really nice Pushtape feature.

Gus Austin

Take a look

shriji's picture

Hi Gus,

I know it is now very old post...but I have implemented something like this...

http://www.shrimaanmandir.org/satsang/download

you might have already produced something like this...if not, i would be glad to share the info.

Thanks

It would be great if you do a

dbinoj's picture

It would be great if you do a brief writeup on how you did this! Thanks :)

Drupal 7 - Ready for Playlists Yet?

WebmistressM's picture

Im curious if the media module and people needing to do playlists on an artist/album basis are concepts which are ready for the Drupal 7 environment. This is for mp3s hosted on the site with the Drupal site I am creating.

Would love to see an install

summit's picture

Would love to see an install profile for music to test! Would that be possible?
Greetings, Martijn

Music

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: