Web Design Forums

Welcome! Please register or log in: Forgot your password? Why register?
You are here: Web Design Forums » CMS Help » Drupal Help » Playing mp3 in Drupal: SWF Tools or just TinyMCE? RSS

Playing mp3 in Drupal: SWF Tools or just TinyMCE?

This thread was started by tabea and has been viewed 498 times, and contains 5 replies, with the last reply made by smoseley.
Post Reply
1
View tabea's reputation
tabea, WDF Noob Private message  
Posted December 18 '09 at 02:11 PM
      Posts: 3
Is there ANY method to use my favourite google mp3 player in Drupal?

... and here is what I did so far to achieve this.
"SWF Tools allows you to easily embed flash content on your [Drupal] pages(...)" according to its documentation site: drupal.org/project/swftools


The EMBED tag for using the google player is:
<OBJECT
classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
width="400" height="27" id="myMovieName">
<PARAM NAME=movie VALUE="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=MY_AUDIO_URL">
<PARAM NAME=quality VALUE=best>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<PARAM NAME=allowscriptaccess VALUE=never >
<PARAM NAME=quality VALUE=best >
<PARAM NAME=wmode VALUE=window >
<PARAM NAME=flashvars VALUE="playerMode=embedded" >
<embed type="application/x-shockwave-flash" src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl=MY_AUDIO_URL"
width="400" height="27" allowscriptaccess="never" quality="best" bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded" /> </div>
</OBJECT>

but I don't know how SWF Tools could help me with using this tag.

SWF Tools comes with some default players but these players are either video players, are large (I need as small as possible) or do not have volume control which is essential. So I found the google reader player, but I don't know how to use it with Drupal.

If it is absolutely not possible to have SWF Tools to use this player, then I have another question: is it possible to use this player by simply inserting the EMBED code into Drupal TinyMCE editor? In my case, I can do it and it plays fine, but when I again edit this node, TinyMCE filters this EMBED tag - just deletes it. And it is so by design according to page:
groups.drupal.org/node/4111

Well I actually have found a workaround to this. In order to have TinyMCE enable EMBED tags, it is necessary to put the following to the tinyMCE.init file:
extended_valid_elements : “object[width|height|classid|codebase],param[name|value],embed[src|type|width|height|flashvars|wmode]“
However, the Drupal init file for TinyMCE does not exist, instead, there is tinymce.module file. I inserted these lines to this file, but it didn't help (means, tinyMCE still filters the EMBED tag):
$plugins['media'] = array();
$plugins['media']['theme_advanced_buttons3'] = array('media');
$plugins['media']['extended_valid_elements'] = array('img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name |obj|param|embed]');


So I think I have basically done everything I could find but it does not work.

Last edited December 18 '09 at 02:16 PM by tabea. Reply

Advertisement Register for free to hide these ads and participate in discussions!

2
1,325 points at 100% Repute WDFplus Member
Posted December 18 '09 at 04:51 PM
      Posts: 8,433
Go with SWF Tools. They're a great simple plug-in, and allow a great deal of customization, including creation of custom content types and views with CCK, etc.

Here's a site I created using SWF Tools for mp3: www.friedonbusiness.com
Steven Moseley
President, Transio
smoseley is online now! Reply

3
View tabea's reputation
tabea, WDF Noob Private message  
Posted March 11 '10 at 05:49 AM
      Posts: 3
From SWFTools documentation for Drupal:

"SWF Tools comes with support for players as listed in the table below.(...) After making sure that the necessary supporting files have been installed you can then activate the module(...)Finally, you need to tell SWF Tools to use the player now it is available."

I understand from the above that there are only specific players supported by SWFTools, not just any player. My original question was about the possibility to use the Google player, example of this player is on page: http://www.thinkinginwordpress.com/2...your-blogsite/

This player is not on SWF tools list of supported players, so I don't see how SWF tools could help.

4
1,325 points at 100% Repute WDFplus Member
Posted March 11 '10 at 10:07 AM
      Posts: 8,433
If you want to use the Google Player, just drop it right in your node content. Just be sure to switch the content type to PHP for that page so you don't get Drupal auto-formatting it.
Steven Moseley
President, Transio
smoseley is online now! Reply

5
View tabea's reputation
tabea, WDF Noob Private message  
Posted Yesterday at 03:11 AM
      Posts: 3
This is what I did. However, as I wrote in my original post:

"I have another question: is it possible to use this player by simply inserting the EMBED code into Drupal TinyMCE editor? In my case, I can do it and it plays fine, but when I again edit this node, TinyMCE filters this EMBED tag - just deletes it. "

So this dropping embed tag into code is a one-direction operation with no user friendly support and with no visual editor support.

If e.g., after inserting the EMBED tag and publishing the node, I realize that there is a mistake in text (e.g. a misspell ) and I want to correct the node later, I can't do it normally via TinyMCE editor, because as soon as TinyMCE opens, the EMBD tag is gone from the node. Clicking the HTML icon and opening the HTML content of the node shows that there is no embed tag at all. So each time I edit such node I have to copy paste the whole node text from a copy on my disk. Or only copy paste the EMBED tag in a correct place within the node, but in such case I would have to remember where this place is (and it is not very easy within html), so it's easier to paste the whole node.

My formatting settings are always set no "No filter", setting to "PHP code" does not change the situation.

[EDIT] I think my problem is related to a bigger problem of TinyMCE deleting all non -html code, described here:
http://drupal.org/node/249743

Last edited Yesterday at 03:39 AM by tabea. Reply

6
1,325 points at 100% Repute WDFplus Member
Posted Yesterday at 10:35 AM
      Posts: 8,433
Why is TinyMCE turned on for "php" mode? It should only appear in "full html" mode.

Did you manually install TinyMCE on your drupal site? If so, you should scrap that and use the WYSIWYG module, which will allow you to select from several editors and define when they turn on / off while editing.
Steven Moseley
President, Transio
Last edited Yesterday at 10:39 AM by smoseley. smoseley is online now! Reply

Post Reply