Documentation says:

Download jPlayer from http://www.jplayer.org/download/. The downloaded
directory only contains 2 files, 'jquery.jplayer.min.js' and
'Jplayer.swf'. Place these two files in 'sites/all/libraries/jplayer/'.

... but the download links now point to a github repo which contains more than these two files. The location of jquery.jplayer.min.js varies by version and some versions only have a jquery.jplayer.js file and no min version. To get this working, you will need a file named jquery.jplayer.min.js which lists its version in the format "Version: x.x[.x]" and it needs to be at the root of the jplayer library folder. Here are a couple examples:

  • 2.7 has no jquery.jplayer.min.js but the jquery.jplayer.js file has the text "Version: 2.7.0" so you can rename this file and put it into .../libraries/jplayer
  • 2.8.1 has a jquery.jplayer.min.js and jquery.jplayer.js file but the min version lists the version like "/*! jPlayer 2.8.1" so you can rename the verbose version or edit the min version to "/*! jPlayer Version: 2.8.1" and put it into .../libraries/jplayer
CommentFileSizeAuthor
#5 2376929-player_install-5.patch1.42 KBmarkie

Comments

Mackee’s picture

+1 just had this issue with 2.8.1

dreambubbler’s picture

+1

For 2.8.1, when extracted the two files which you need are located in the extracted folder at:
jPlayer-2.8.1/js/jplayer/jquery.jplayer.min.js
jPlayer-2.8.1/js/jplayer/jquery.jplayer.swf

If you wish to use the jquery.jplayer.min.js, you'll need to edit the beginning of the file to read:
/*! jPlayer Version: 2.8.1

as described above.

Cheers.

markie’s picture

If you wish to submit a patch, the files that I need to target are located in the /dist/jplayer directory.

Reuben Unruh’s picture

Title: Update install documentation » Find jPlayer library directory programmatically
Component: Documentation » Code
Category: Task » Bug report

I don't think this is a documentation issue after all since the info added above is pretty user unfriendly for a README. I've changed this to a bug report since the module won't recognize current jPlayer library versions. Only problem is we have no control over how they build the library. In v2.8.1 there was only a min file available in the jplayer/js/jplayer folder but there is already a v2.9 with a min and pretty version in jplayer/dist/jplayer... so the path has changed just in the last 2 weeks.

Here are some options that all assume we put the entire jPlayer library into the site's libraries folder:
We could require a specific library version but then the user doesn't have the freedom to update.
We scan the whole library for jquery.jplayer[.min].js using file_scan_directory. But the way they are reporting the version has changed even though the filenames haven't.
From v2.3 on there is a package.json file which has the version and a path to the main library file listed. This means depending on npm remaining popular (seems safe for now).

Maybe we just stop checking for the version and the install docs suggest a couple folders to check for the jquery.jplayer[.min].js files.

I would want some maintainer feedback before trying to create a patch.

markie’s picture

Status: Active » Needs review
StatusFileSize
new1.42 KB

So I gave this some thought and for the time being I have updated the readme to reflect the fact that when you download the player now, the build version resides inside the dist/jplayer folder of the zipped (or tar.gz depending) folder. Please see attached patch. I don't disagree that there should probably be some better player detection going on.

markie’s picture

All
I have gone ahead and pushed some changes to the dev branch (7.x-2.x) which should solve a lot of this issue. The first way I implemented this was half ass, not using the libraries as it should be. I have updated the checker to find either the jquery.jplayer.js or the jquery.jplayer.min files either in the libraries folder (sites/all/libraries/jplayer) OR the interior folder if they just expanded the zip file (sites/all/libraries/jplayer/dist/jplayer). The fallback is the min file for production joy. Also I update the way the version is sniffed as the prod file and the min file have different results. I also added some general code review changes (which made this too much for an issue patch.. sorry).

Please give it a test run and let me know if you have any questions or.. umm.. issues.

markie

Reuben Unruh’s picture

Tested and working for version 2.9.2 for all these install scenarios:

  • Drag dist/ from the library into libraries/jplayer
  • Drag jquery.jplayer.min.js and jquery.jplayer.swf into libraries/jplayer
  • Unzip the whole library to libraries/jplayer

Works for versions 2.8.2 and up since this is when the dist folder was added. The dist folder is only 1 month old but I think this commit fixes the issue because:

  • People that are using the module for the first time will get the install documentation and code that matches the most recent version of the library.
  • For people that update the module but not the library it will still work.
markie’s picture

Status: Needs review » Fixed

marking as fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.