flowplayer 3 plugin: playlist

marie70 - September 18, 2009 - 23:55
Project:SWF Tools
Version:6.x-2.5
Component:SWF Tools
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm using swf tools, filefield and flowplayer 3. My playlist plays fine but I would like to show the list of mp3s. Does swf tools support the flowplayer javascript plugin called playlist ? If yes how do I get it working? If no is there another method?

thank you

#1

Stuart Greenfield - September 19, 2009 - 08:39
Category:support request» feature request
Status:active» postponed

Does swf tools support the flowplayer javascript plugin called playlist ?

Not yet is the quick answer.

However, there are plans to improve the FlowPlayer 3 support and there has previously been discussion about an "advanced FlowPlayer 3" module. In practice, I will probably work up something for Drupal 7 with something of a rethink about how the module should work, and then port the code back.

If nothing else, the FlowPlayer JS plug-ins rely on using the FlowPlayer embedding JS, which isn't currently enabled in SWF Tools. So we need to add support for both.

Watch this space!

#2

gausarts - September 19, 2009 - 15:50

I'd love this feature, too. So, I'll keep all my ears on it :)

Currently the workaround was mentioned here => http://drupal.org/node/563222#comment-1988534

Not very ideal, but at least I can have a playlist built from several nodes and nodereferences :)

#3

marie70 - September 19, 2009 - 19:46

Thank you so much for suggesting that workaround. I used the media_browser module and got my playlist of mp3s to display and link to the flowplayer! I used the config. instructions here http://drupal.org/node/479012 using mp3 files instead of video.

I use flowplayer for video as well so I have the height and width set for video, do you know how I can theme it for this view only so I can make the player smaller?
The way I did it before with the filter was:
<swf files="1.mp3&&2.mp3" params="width=175&&height=30">

#4

gausarts - September 19, 2009 - 20:51

Apart from generic solution inside content-field-field_video.tpl, I give specific theming for views blocks as well. This one goes to views-view-fields--VIEWNAME--displayID.tpl with (custom) image and video file paths pulled from views:

<?php
//prepare the thumbnail using imagecache preset
$preview = 'imagecache/thumb_320x260/' . $fields['field_thumb_fid']->content;

print
swf($fields['field_video_fid']->content, array('params' => array('width' => '320', 'height' => '260'),'flashvars' => array('image' => $preview)));
?>

I never used swftools syntax as I don't want my users to have access to them. So I have to do it automatically from template layer :)

#5

Stuart Greenfield - September 20, 2009 - 20:21

As part of the work to implement the flowplayer embedding method I think this will become quite simple. Locally I have a very crude implementation so that when a playlist is detected a list is added below the player with hyperlinks that start each movie. It's not very elegant or pretty, but it works which is the main thing I was trying to test.

This is probably now my incentive to come back and really get SWF Tools playlists up and running properly. I've never really revisited the feature as it was inherited when I adopted SWF Tools. At the moment the available fields all just get populated with the filename, unless you manually call the swf() function with your own data.

What we need is a bit of an overhaul so that you can specify sensible titles (or get them automatically from a file description or similar). Then some themable output to let you style the list how you want. Integration via CCK and possibly ID3 would seem logical.

But, the main thing is that using the FlowPlayer embedding method looks like it will be pretty simple to support plugins!

I'm not making any promises about when this feature will become official, but at least we now know it is possible!

#6

Stuart Greenfield - September 21, 2009 - 22:16
Status:postponed» active

OK - this is getting really interesting now. I did some more work on the code and have extracted the function that generates the player and the playlist in to a flowplayer3_playlist.tpl.php file. This means that the player and playlist can be customised without having to touch the flowplayer3 module itself.

I've never tried this before, but it should mean that a website can now over-ride the default configuration with its own implementation and produce entirely customised presentations. This is great as it means SWF Tools becomes nothing more than the mechanism to handle the flash stuff, but presentation is now in the hands of the end user.

As before, I have it generating a very basic playlist, but the important thing is that it is generating playlists. In fact, it can generate multiple playlists, so if you have more than one player on display with a playlist then you get each one in turn.

At the moment I'm only passing very basic parameters to the template function, but the concept looks right.

I don't think it's necessary to extract basic (non-playlist) players in to a template as the code simply spits out markup ready for the page. It's wrapped in tags so the player can be themed with CSS as required.

I'm changing the status to active as the code is looking very promising!

It needs quite a bit more work, and as noted above, to really be of use I need to overhaul the playlist handling mechanism so the content becomes a little more meaningful that just a list of file names. But the potential of this means that priority is now much higher up the list.

Watch this space!

NB - I've not committed the code yet. I need to branch DRUPAL-6--2 as I try to use the current branch for debug activities, and new features go on the next branch. I wasn't intending such a big change to get underway so it's kind of caught me out!

#7

gausarts - September 22, 2009 - 00:39

SWF Tools becomes nothing more than the mechanism to handle the flash stuff

Glad to hear it. It'll make swftools lighter as expected and many will be very thankful as I am with the change.

Currently I am playing around to replace media_browser with just views and simple flowplayer HTML. It works beyond drupal, but inside drupal I can't even get the player to show up yet :) I still need swftools to handle the flash stuff.

Customization seems easier with JW, but when it comes to flowPlayer with its javascripts, I am stuck.

I can't wait to see it released :)

Thanks

#8

gausarts - September 22, 2009 - 02:15

Yahoo, finally made it. A real playlist with flowplayer :) To those who may have trouble, in my case it's browser cache, javascripts ordering and the flvs themselves, flowplayer doesn't want to play corrupt metadata flvs.

I'll continue with the current inflexible method for the playlist until swftools release.

#9

Stuart Greenfield - September 22, 2009 - 20:14

Branch DRUPAL-6--3 is now created to track the work that is being done on enhanced playlist support for FlowPlayer3. Branch DRUPAL-6--2 remains as the current stable branch for "good" code that works.

If you want to experiment with the new features then fetch the code from CVS, but the code at any time may be messy, incomplete and not feature complete!

At the moment the playlist feature is demonstrated using CSS and markup/images that I have simply copied from flowplayer.org. I've done this purely for convenience so there is something to play with and show what might be possible.

So, at the moment a playlist passed in to the FlowPlayer3 module will be rendered using tabs as in the example at http://flowplayer.org/plugins/javascript/playlist.html

To set up the new code you need to do the following:

  • Make sure you have the flowplayer embedding JavaScript at shared/flowplayer3/example/flowplayer-3.1.4.min.js This is the default location when you copy the contents of the flowplayer3.zip download.
  • Make sure you have the flowplayer 3 playlist JavaScript at shared/flowplayer3/flowplayer.playlist-3.0.7.min.js
  • Activate FlowPlayer3 embedding from the FlowPlayer3 settings page. Expand the FlowPlayer3 embedding section. Check "Use FlowPlayer3 embedding" and "Generate HTML playlists (experimental)".

FlowPlayers will now render using the flowplayer JavaScript which exposes the code necessary to make the playlists work. If you submit a playlist to the player then you should get the playlist down the left, and the player on the right. At the moment the playlist function within SWF Tools itself doesn't create very pretty output so you just see the filename, but remember this is work in progress. You can test the code using either the [swf] input filter, or you can use CCK with the SWF Tools playlist formatter. Note that at the moment the output with CCK isn't very pretty as you see the full file path, but we can work on that!

If you want to change the configuration of the player and/or the playlist you need to over-ride flowplayer3-playlist.tpl.php. For now the easiest way is probably just to edit the copy in the flowplayer3 directory, but you could do it the "official" way and place a copy in your theme!

If you play with the code let me know how you get on. I'm not going to do much in the way of support for now - the code is just being made available so people can play with it.

If you try it out let me know how you get on.

#10

gausarts - September 22, 2009 - 22:42

Hi, I am willing to test it out. Is it the right URL => http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/swftools/fl... ? It is 6 months old.

I have built a very inflexible playlist (views thumbnails and its attachment), and yet have trouble to merge the video and audio player as one, and things get complicated when nodereferences take place with 3 node types involved. I used to manage this easier with media_browser and swftools which is why I am still hoping for the release and willing to test it out.

Attached is what I've done so far. At least I have a real expectation when I can progress with your playlist.

Thanks for great support

AttachmentSize
playlist.png 95.88 KB

#11

Stuart Greenfield - September 23, 2009 - 19:09

It's a bit tricky fetching code from the web view of the repository. I've just created a development release for DRUPAL-6--3, so when the package is generated you can get it from there if you'd like to experiment!

#12

gausarts - September 23, 2009 - 19:12

Okay. Still access denied by now. Thanks

#13

gausarts - September 23, 2009 - 20:35

Hi,
While I am waiting for the 6.3 branch, I manage to set setup a playlist with JW and multiple nodes. Only now without media_browser :)

To those who may be interested in JW playlist, this may help you out => http://home5.inet.tele.dk/nyboe/flash/mediaplayer4/JW_API_xmpl_5-2-1-0.html

And a more detailed discussion on passing LOAD event to the player => http://www.longtailvideo.com/support/forum/JavaScript-Interaction/13061/...

See also the working basic implementation in the last function in wijering4.module, wijering4_accessible.

I realize that I did it mostly from the template layers. So I always hope a real solution will be included in the next release if possible, too.

Thanks

#14

Stuart Greenfield - September 23, 2009 - 20:51

That's quite neat - what I've liked with the experiments I've been doing with FlowPlayer is the ability to take the playlist outside of the player so it can be styled using HTML and CSS. The sample page on the link you've pasted suggests that the same approach can be done with Wijering.

For now I'm going to concentrate on FlowPlayer and getting its code about right as I've never really touched the playlisting feature since I adopted SWF Tools. But once the code is settled down for FP it should be fairly easy to give users the option of a similar playlist feature for Wijering.

And if we can get SWF Tools playing nicely with CCK playlists with thumbnails and everything then in theory you could build YouTube out of Drupal and just a few add-on modules!! (Ok, that's maybe a little ambitious...)

#15

krabbe - October 16, 2009 - 23:26

**subscribe**

#16

elgwiedo - October 19, 2009 - 15:15

Hi Stuart

As I needed a MP3 playlist and already have SWF tools installed for playing FLV and YouTube, I wanted to install your 6.3 Dev zip file.
However I cannot find the following JS files "flowplayer.playlist-3.0.7.min.js" ?

OF which package it is part of ?

thx
eG

#17

marie70 - October 28, 2009 - 22:56

Thank you so much for your help. Everything is working great but I still haven't been able to change the size of the player when mp3s are playing.

I have content type: player_mp3s
and a field of the type file, called: field_audio_mp3

I have copied the file content-field.tpl.php from the CCK theme folder into my theme folder and renamed it:
content-field-field_audio_mp3.tpl.php
(not sure if this is right, have also tried content-field-field_audio_mp3-player_mp3s.tpl.php)

I've replaced the line:

<?php
print $item['view']
?>

With the line:

<?php
print swf($fields['field_audio_mp3_fid']->content, array('params' => array('width' => '175', 'height' => '30'))) 
?>

I upload the new file and the players stays at the same default size.
I'm not the best at this so if you can see what I'm doing wrong I would appreciate it.

EDIT: OK I got it, I made two mistakes. One: I didn't put a copy of the original content-field.tpl.php in my theme folder.
Two: instead of copying the code exactly from post #4 (that I think was meant for theming the view), I used:

<?php
print swf($item['filepath'], array('params' => array('width' => '175', 'height' => '30')))  
?>

In addition to post #4 I got the ideas from here http://drupal.org/node/450946#comment-1563786
Thanks for the help

#18

AndyF - November 7, 2009 - 02:05

subscribe

 
 

Drupal is a registered trademark of Dries Buytaert.