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

d.jankovics’s picture

subscribing, i've got the same issue with using i18n 6.x-1.0

-Anti-’s picture

Damn... 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/

mattez’s picture

Version: 6.x-1.4-beta1 » 6.x-1.x-dev

I 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.

brandontrew’s picture

anyone know how to fix this? I've tried everything...

bgm’s picture

I haven't check recent versions of the module, but replacing the use of url() by file_create_url() should do the trick.

matt

ar-jan’s picture

I 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 url with file_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.