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

mikedillon - August 10, 2008 - 12:04

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

seaneffel - August 19, 2008 - 01:08

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

wad - September 25, 2008 - 17:31

Mike, have you tried using a full URL path like http://host.domain/player.swf ?

#4

sanduhrs - March 6, 2009 - 15:58
Version:5.x-1.3» 5.x-1.x-dev
Priority:critical» normal

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.

AttachmentSize
clean_urls_01.patch 2.29 KB

#5

sanduhrs - March 7, 2009 - 16:03
Status:active» needs review

Status update.

 
 

Drupal is a registered trademark of Dries Buytaert.