The best information I have found on the subject of embedding a more advanced Flash Player than the Drupal default can be found in the topic on "Change Audio Player Type" that can be found here:
The harryhobbes code shown on that page works for me and I've posted a short discussion on that page of an alternative player that I can almost get to work and am looking for some help on . It is (IMHO), a visually improved Flash Player that would be nice to have working in Drupal. In particular, it allows customization of the color scheme.
Here is a link to the new candidate player:
http://jeroenwijering.com/?item=Flash_MP3_Player
And here are a couple of links to demo sites:
http://www.musiklab.co.uk/music.html
http://www.chicagomusicpromotions.com/
You can download the player here:
http://jeroenwijering.com/upload/flash_mp3_player.zip
Hoping to find some embedded Flash gurus out there who can get this player working in Drupal.
Comments
I did a little fiddling with
I did a little fiddling with this, and it works but there are 2 problems. Neither are unsolvable but both will require a very small module. I may do some stuff with the views bonus pack so that you can use views to create playlists for it.
In any case, the problems are:
1) A single mp3 file given to the player must have 'mp3' as an extension, or it assumes the file is a playlist and chokes on it.
2) In order to do dynamic playlists, it needs to call back to the server.
Either way, the fix to this is something with hook_menu(). At the moment I'm fiddling with this and the views bonus pack. No idea if I'll finish or not, as I'm not sure how motivated I am.
-- Merlin
[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]
-- Merlin
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]
Slim Player Alternative
Merlin: Thanks for the interest.
1. In the case I was testing I was trying to play a single file and it was a someaudiofile.mp3 file. This mp3 file and all the others like it play perfectly using the default Drupal Flash Player (that little triangle to start and the little square to stop player) as well as the Slim Player.
2. Could it be the player only plays playlists? Are you certain that it will take a single file as an input?
-- InterceptPoint
Jeroen's player accepts either
a single mp3 file with the extension of .mp3 (and plays as a small player without a playlist), or an xml playlist. This behaviour can be changed by altering the action script of course.
You can also optionally give it various variables via a configuration xml file, and optionally get the player to send statistics as it is playing to a url of your choice.
I think Jeroen's version 3 audio and video player is due out soon.
Yes it will (I tested it)
Yes it will (I tested it) but it requires the URL to end in .mp3 -- and the audio module provides urls in the form of audio/play/NID
It wouldn't be TOO hard to create a very small module to take a different URL (say, mp3/play/NID.mp3), strip off the .mp3 part, and pass it to the audio player. If you know how to create a module, that is.
BTW I did get this player working with views so that you can use Views (with the Views Bonus Pack) to create a playlist. In both 5.0 and 4.7 -- the new tarballs for the views bonus pack will be generated within 8 hours.
For more, see my blog post: http://www.angrydonuts.com/audio_playlists_in_a_flash_playe
-- Merlin
[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]
-- Merlin
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]
Slim Player Alternative
Patrick/Merlin: Much thanks.
Just to make sure we are on the same page, I am modifying the theme.php file to override the default player. A couple of questions:
1. Will that still be required with a new Views based approach?
2. Assuming my node is 568 and my mp3 file is somemusic.mp3, can I write code in theme.php to get a string reference to the mp3 file in node 568. If you can do that then you should just be able to pass the legit .mp3 reference to the player. Just hoping.
-- InterceptPoint
No, the views based approach
No, the views based approach doesn't override the actual player, so you basically end up with the ability to use different players for one-offs. It is pretty easy to use, I think.
I can't think of a way to modify the string in the theme to make the player accept it.
-- Merlin
[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]
-- Merlin
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]
I Tried Your Views Approach - But having problems
I'm trying out your Views Approach.
Edit: I figured this one out myself
I've installed the 4 Nov 06 4.7 version of the Views Bonus Pack and generated a new view per the directions in the readme file. But ... when I try to access the view I get a 403 Permission Denied message.
-- InterceptPoint
Cannot Find Audio:Playlist
Merlin: I'm trying to get your Views-based Alternate Flash Player system working.
I've installed the latest Views Bonus Pack but Audio:Playlist does not show up on the Type Dropdown list for either Page or Block. I'm sure I've got the right version installed and the audio module is installed and working. For reference, here are the readme.txt instructions that I'm following:
Any idea what I'm doing wrong?
I do not know if this issue
I do not know if this issue has been solved... but i have figured out how to use by http://jeroenwijering.com/?item=Flash_MP3_Player.
This works for Drupal 4.7.3.
First you got to download the player and put it in the folder /players/mp3player.swf (the name of the new player)
Go to audio.theme and at about line 175
that's all!
Do let me know if it helps cuz i really hope to contribute back to Drupal which has help me build up a few of my social networking sites.
This patch method is working
This patch method is working great in Firefox for me, but unfortunately not at all in IE? Its just displaying a blank white rectangle where it should display the player?
Anyone got any suggestions on how to fix this?
From line 167, this is my
From line 167, this is my code to work in both Firefox and IE. Take note of the comments double stroke //
my email is simonwoo888@gmail.com , just in case you cant get me.
Thank you!!!
Thank you , thank you , thank you! You're a legend, its all working sweet now it seems, and what an improvement! :)
Have a great day buddy
cheers
Possible bug?
Hi, I've just noticed that when an MP3 is uploaded with the character "&" in the filename, the flash player does not load. When the "&" is removed and the same MP3 reuploaded, it loads fine.
Any ideas on how to correct this?
I believe the problem is due
I believe the problem is due to the way multiple flashvars can be "stacked" by using an "&" symbol in the flashvars string.
Any way to avoid this? Some way perhaps for the flashplayer code snippet to call the file as "domain.com/some %26 file.mp3" instead of domain.com/some & file.mp3" ?
I'm still looking into
I'm still looking into Drupal as a solution for my needs so I don't want to go modifying any code, but it seems like the answer to that problem would be to wrap the filename in the PHP function urlencode(). I've done this before passing text to an .swf and it works. I'd really like to see these things wrapped up into an official module update because for a first time Drupal user (even though I'm a seasoned PHP programmer), I don't like the idea of modding modules especially because i have to remember all those mods and roll them into any updates that come out... and I'd be running Drupal to prevent having worries like that :-)
Hey thanks so much for the
Hey thanks so much for the input - I'm not entirely sure what wrapping the filename in urlencode entails? If you could clarify that for me, I'd really appreciate it.
I hear you about not wanting to hack the modules code, I'm the same wherever possible - but I find some things never get done in open source, and I have no choice other than to make alterations to what is essentially my sites primary function, in order to keep my userbase happy. And this player has done just that - it works infinitely better than the old default audio module player I had been using, which was plagued by performance issues, and the lack of features.
Sure. Without getting too
Sure. Without getting too deep into the code, I think you'd need to replace $node->audio_file->origname with urlencode($node->audio_file->origname). The urlencode function will convert tricky characters like spaces and ampersands in filenames into %20, %26, etc.
You can read more about urlencode here.
This particular change isn't so much a feature request as it is a bugfix. Any filename with questionable characters should always be handled this way.
Ah right I see
Thanks I'll give that a go.
Cheers
If you find that it works
If you find that it works properly, shoot me an e-mail with all the changes - mark@markscudder.com - because this is one mod I'll definitely need when I get all this stuff figured out and set up.
Will do
I should get onto that tomorrow.
One thing I did realize is that I'm not using the very latest version of the audio module, so perhaps it has already been addressed, though I doubt it somehow.
Its also on a 4.7 drupal site, and I believe the audio module for drupal 5.1 has had a whole raft of changes. In any case, I'll try it and let you know, as it could quite possibly be required in whichever version of the audio module you or anyone else requires.
I don't think it's been
I don't think it's been addressed, you just get another inline player but not the good one. I'd also like to have the thing pop in its own window, if it's more than a few minutes worth of audio sometimes you want to leave it playing and keep on browsing the site. At least I do.
(How the heck do I get e-mail notification of replies on this thread?)
It works :)
Sorry for the delay, but I just got around to trying your suggestion, and it does work. Thanks!
urlencode($node->audio_file->origname)
Changing Flash Playlist Player under 5.2 w/ Latest Audio Module
Drupal 5.2
Audio 5.x-2.x-dev
pathauto-5.x-2.0-beta2
token-5.x-1.x-dev
... and if it matters:
Views 5.x-1.6
Swftools 5.x-1.1
xspf_playlist-5.x-0.5
Hi. I am trying to figure out how to override the theme player for playlists in the above described scenario and it looks like I may have at last stumbled on a place to ask for some advice...
I have been wrestling with getting a playlist content type up and running w/ the new Audio module for some time now and have finally have succeeded in finding the right module versions, sorting out dependencies-though as a side issue I am not sure if Swftools or even xspf_playlist are actually even needed-and adding necessary overrides in template.php (posting code I found somewhere-thanks so much to whoever posted originally-hoping to save much time and misery for anyone else in the same boat):
... anyway, a link to an example below (dev site so please ignore any nonsense not having to do w/ this issue):
http://dev.majorglitch.hypermediative.net/?q=content/test-playlist
... I would very much like-actually I kind of NEED to-use the Wijering jw_mp3_player instead of the extended player. Ideally I would like to add it to the available players form (Administer | Site configuration | Audio settings | Players) as a choice, but just making it the default would be fine too. It seems like audio_get_players() in the above code could be altered to accommodate this but I can't figure out terminology to accomplish that.
Could anyone around here point me in the right direction?
Thanks...
Ignore this
**just subscribing**
Player info
Please get information about the best way to steam music over the net at#
http://www.audioplexus.co.uk
http://www.icdmastering.co.uk
Feel free to comment