Active
Project:
jQuery Media
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Feb 2009 at 21:00 UTC
Updated:
1 Nov 2010 at 15:27 UTC
Hi,
In jquery_media.jq.inc, function _jquery_media_add(), the use of url() in the following code causes problems on multi-lingual sites:
if (!($default_js_loaded || isset($defaults['flvplayer'])) || $options['flvplayer']) {
$defaults['flvplayer'] = $options['flvplayer'] ? url($options['flvplayer']) : url(variable_get('jquery_media_flvplayer', JQUERY_MEDIA_FLVPLAYER_DEFAULT));
$js .= " $.fn.media.defaults.flvPlayer = '{$defaults['flvplayer']}';\n";
}
In the above, the url() transforms, for example, "flvplayer.swf" to "/en/flvplayer.swf". i.e. the resulting html in the page is:
$.fn.media.defaults.flvPlayer = '/en/player.swf';
What's the best way to solve this?
Thanks,
mathieu
Comments
Comment #1
d.jankovics commentedsubscribing, i've got the same issue with using i18n 6.x-1.0
Comment #2
-Anti- commentedDamn... I just noticed this.
It wasn't happening on my site 3 months ago, now it is.
Anyway, I partially solved the problem by putting the full absolute path to the player into the jquerymedia settings page.
That's a pain, because nothing else on the site needs an full absolute path, but it seems to work ok.
The important thing is that the link in the content to the media file can still be 'partial absolute' Eg. /sites/default/files/
Comment #3
mattez commentedI think this is duplicate of #244494: Incorrect path to default players when using i18n. Its issue for D5 - however its still relevant.
Here its explained more exactly.
Comment #4
brandontrew commentedanyone know how to fix this? I've tried everything...
Comment #5
bgm commentedI haven't check recent versions of the module, but replacing the use of url() by file_create_url() should do the trick.
matt
Comment #6
ar-jan commentedI tried replacing url() with file_create_url(), but the player remained broken on pages with a language prefix. I'm not sure if I tried the correct way though, I simply replaced all four instances of
urlwithfile_create_url, nothing else. What else could I try?Luckily putting the absolute path in the default settings worked for me, but it would be nice if we could fix this.