Flash "play" button doesn't play anything

sandy-jr - August 22, 2007 - 13:04
Project:Audio
Version:4.7.x-1.0
Component:players
Category:support request
Priority:critical
Assigned:Unassigned
Status:closed
Description

My triangle play button on playlist has quit working. It is displayed but when I click on it, it shows download animation and that's it. The popup player plays audio just fine, but not the one in playlist. I have ID3 enabled. Please help.

#1

sandy-jr - August 23, 2007 - 12:44
Status:active» closed

I just uploaded an older back of the site and it fixed the problem. I still don't what could have caused, I suspect it was getid3 module thou.

#2

redbike - September 14, 2007 - 16:58
Status:closed» active

(I'm not sure why this issue was closed if the issue was not taken care of.)

I've downloaded all of the current 4.7 official and dev releases and they all have this issue: I can download and play the audio file but if I try to play it through the flash player the flash player just spins and does nothing, this just started happening after I upgraded to drupal-4.7.7.

Thanks, having an embedded play button is really nice, I've always thought that was a great touch.

#3

redbike - September 14, 2007 - 17:09

It looks like the url encoding that is embedded in the player is getting garbled, in my case this is the url:
http://community.freespeech.org/modules/audio/players/mp3.swf?song_url=h...
(http%3A/%252F should be http%3A%2F%2F)

#4

redbike - September 14, 2007 - 18:18
Status:active» closed

It appears the problem is with drupal_urlencode(). drupal_urlencode() seems to be garbling the url encoding when clean urls are enabled.

old version that worked:
return str_replace(array('%2F', '%26', '%23'),
array('/', '%2526', '%2523'),
urlencode($text));

new version that garbles the url:
return str_replace(array('%2F', '%26', '%23', '//'),
array('/', '%2526', '%2523', '/%252F'),
urlencode($text));

#5

sandy-jr - September 15, 2007 - 07:42

Thanks Redbike for digging into this issue. So did you just paste the code from 4.7.6 into your 4.7.7 and it started working? Where is that code exactly located? Thanks again.

#6

miiimooo - October 4, 2007 - 10:43

Thanks to the post above here's what fixed the problem:

in audio.theme

$url = $base_url .'/'. drupal_get_path('module', 'audio') .'/players/mp3.swf';
// hack
// if ($options) {
// $url .= '?'. drupal_query_string_encode($options);
// }
foreach($options as $k=>$v) {
$params[] = $k."=".$v;
}
$url .= '?' . implode('&',$params);

#7

jmcclelland - October 30, 2007 - 14:24

The above fix worked for me too.

And, to be a bit more descriptive about how to apply the fix:

The top line in the fix should be left as is.

The lines that are commented out should be commented out in the module.

The lines after the commented out lines are new lines that should be added.

Here's another representation of the changes needed:

--- audio.theme.orig    2006-12-23 01:24:53.000000000 -0500
+++ audio.theme 2007-10-30 10:23:29.000000000 -0400
@@ -165,9 +165,11 @@
   ));

   $url = $base_url .'/'. drupal_get_path('module', 'audio') .'/players/mp3.swf';
-  if ($options) {
-    $url .= '?'. drupal_query_string_encode($options);
-  }
+
+       foreach($options as $k=>$v) {
+               $params[] = $k."=".$v;
+       }
+       $url .= '?' . implode('&',$params);

   $output = '<object type="application/x-shockwave-flash" data="'. $url .'" width="17" height="17">';
   $output .= '<param name="movie" value="'. $url .'" />';

 
 

Drupal is a registered trademark of Dries Buytaert.