This is because the file path is absolute; replacing
$audio_url = $file;
with
$audio_url = file_create_url($file);
in mp3player.module at line 1196
fixes the problem, but I don't know if that would break it when the download method is set to public.

Comments

ad1957’s picture

My test site is set to have private upload but I can’t get the mp3player to work under these circumstances (with public file system it works right out of the box) …

My test clearly shows that the upload itself works (see Upload link below) but when mp3player handles the file something happens, please any other suggestions …

- Upload link -

The file and link to the file which is shown on the same node as the player shows correctly and works: http://clearos.lan/test_01/?q=system/files/admin/ringo_01.mp3

But …

- Mp3player -

Original code ($audio_url = $file;) in mp3player.module gives the following result:

Play the file through mp3player (the link as seen through the source code):

<object id="mp3player_1" … <param value="soundFile=/test_01//var/www/audio/admin/ringo_01.mp3&amp;playerID=mp3player_1" name="flashvars"></object>

The changes you suggest ($audio_url = file_create_url($file);) gives the following result:

<object id="mp3player_1" … <param value="soundFile=http://clearos.lan/test_01/?q=system/files//test_01//var/www/audio/admin/ringo_01.mp3&amp;playerID=mp3player_1" name="flashvars"></object>

P. S. The filefieldmp3player.module doesn’t give the right address either when the file system is set to private

Kind regards

hcabalic’s picture

Using:
$audio_url = file_create_url($file);

Actually works for me with my file system set to private.

It doesn't work when set to public

jdelaune’s picture

Status: Active » Closed (duplicate)