The module is not compatible with private file downloads where the files directory is not in the site root.
The problem seems to be with these 2 config lines in jwplayermodule.module (lines 10-11):
define("JWPLAYER_FILES_DIR", file_directory_path() . "/jwplayermodule");
define("JWPLAYER_FILES_URL", $GLOBALS["base_url"] . "/" . file_directory_path() . "/jwplayermodule");
I'd need to look at the implications for the rest of the module about changing them though, so just reporting the issue for now.
Comments
Comment #1
JW Player commented@ducklofty,
Thanks for bringing this to our attention. I'm more than happy to update this.
Shouldn't file_directory_path() correctly return the path to the directory Drupal is using? What do you recommend should be used instead?
Thanks.
Comment #2
ducklofty commentedLooks like this is a bug with the function in 6 - see the comments here:
http://api.drupal.org/api/drupal/includes--file.inc/function/file_direct...
have seen similar issue before with adding CSS, I'd image you need need to do something similar to add the JS - used Chaos Tools API to address the issue as it does the heavy lifting for you:
http://drupal.org/node/902696#comment-4562688
I've got round it by adding the files manually to /sites/default/files/jwplayermodule/ and changing the config in .module:
#define("JWPLAYER_FILES_DIR", file_directory_path() . "/jwplayermodule");
#define("JWPLAYER_FILES_URL", $GLOBALS["base_url"] . "/" . file_directory_path() . "/jwplayermodule");
define("JWPLAYER_FILES_DIR", "sites/default/files/jwplayermodule");
define("JWPLAYER_FILES_URL", $GLOBALS["base_url"] . "/sites/default/files/jwplayermodule");
This means that when called by LongTailFramework.php getEmbedderPath it is working. Need to test other functionality now.
Comment #3
bkamlin commentedI would suggest:
define("JWPLAYER_FILES_DIR", "sites/all/modules/jwplayermodule");
define("JWPLAYER_FILES_URL", $GLOBALS["base_url"] . "/sites/all/modules/jwplayermodule");
Wouldn't it be more inline with Drupal standards?
Comment #4
JW Player commentedThanks for the suggestions guys. I'll be sure to include this in the next update.
Thanks.
Comment #5
dvancamp commentedI manually moved my licensed player underneath the module directory as suggested by bkramlin. It looks like some of the integration files will need updated also.
Like the jwfilefield.module uses:
Seems like using http://api.drupal.org/api/drupal/includes%21file.inc/function/file_creat... might be a better fit:
Comment #6
JW Player commented@dvancamp,
Thanks for the suggestion. I'll investigate the file_create_url function.
Comment #7
marleo commentedDid anyone actually get this working properly?
I've tried both of the above suggestions (just location for the files), checked permissions, etc.
I'm currently testing with the player files in sites/default/files/jwplayermodule since that's what the module does usually.
On the Upgrade tab, the "Install latest JW Player" button returns all of these:
- Error message at top: "The selected file /tmp/fileyHrET6 could not be uploaded, because the destination is not properly configured."
So it can't install the player.
If I manually put in what was originally (and apparently successfully) installed in the private files location, I get:
- Same error message at top (see above).
- Popup js error box: "Couldn't detect player version."
- Solid black box in Player Preview section.
If I try to upload it via the "Manually Upgrade" section (I zipped the mediaplayer-5.9 directory), I get these errors:
So it seems to be seeing the destination as empty. And can't even see the files if they're there.
Also, the [jwplayer...] tags are being printed literally, that is, they're not being rendered as a player at all.
I would really appreciate a working hack. Private files are a must for us, so I can't revert this.
Comment #8
JW Player commented@marleo,
It is also possible to upload the player to the files directory just using normal FTP instead of using the installation functionality. That may work for you.
Thanks.