Error with jquery.media.js in creating embed src path
mikedillon - August 10, 2008 - 12:03
| Project: | jQuery Media |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Description
Using Safari's Developer tools I can look at the DOM and you can see where this module placed the embed tags but this function creates the wrong src="" attribute for the
embed tag. My settings specified my flash player at web root as player.swf, so the embed should look like this:
<embed src="player.swf?File="file/I/want/to/play.mp3""> etc...but instead it is outputing this:
<embed src="<b>/?q=</b>player.swf?File="file/I/want/to/play.mp3"">It is somehow trying to use the drupal index path with the global variable for the player location.

#1
oops the second included bit of code should not have and tags in there... should be :
<embed src="/?q=player.swf?File="file/I/want/to/play.mp3"">#2
Hi Mike,
This is such a simple change that it should be easy for the developer to do. But...
The most conventional and effective way to propose changes in modules and themes would be to submit a patch file. Look in the Drupal handbook for how to create and submit patches. It will make your contributions countless times more effective.
http://drupal.org/patch
#3
Mike, have you tried using a full URL path like
http://host.domain/player.swf?#4
This only seems to be an issue when Clean-URLs is disabled.
jquery_media is using the url() function to generate the embed URLs. Which in this case is wrong, because url() creates absolute URLs or Drupal internal URLs in the form of http://host/folder/?q=page
But in this case we need a URL pointing to a real - not Drupal internal - path.
So, checking if the provided URL is absolute or not and in case it's relative adding base_path() to it, should suffice.
Patch is attached, please review.
#5
Status update.