There are modules which provide swfobject.js inclusion already, and if this is hosted locally it doesn't make sense (?does it?) to then reference it externally as well.

Please consider checking for SWFTools (or possibly SWFObject API?) and utilising its swfobject inclusion in theme_jwplayermodule_render_player() instead of adding a redundant external reference to the SWFObject JS.

This allows sites to utilise Libraries API and reduce bandwidth, code conflicts, etc etc.

NB: This may be a future feature request, as from #535592: Better place to store players and libraries it looks like SWFTools may not do this already. JWPlayer is referenced specifically in that thread, which may be of interest also.

(Libraries API would be worth contemplating to share the JWPlayer library files with other modules utilising JWPlayer also.)

Comments

JW Player’s picture

@grobot,

The goal of including SWFObject was to avoid the need of our users to have to install an additional module or download an additional file. We wanted to make the experience of using this module as easy as possible. However, the skill level of most Drupal users is fairly high, so going forward we will make the effort of leveraging another module or the Libraries API. Whatever will seem to work best and keep things simple.

Thanks.

xurizaemon’s picture

@LongTail

TBH I'm not certain which SWFObject approach is the best path for JWPlayer going forward. I just noticed the external reference when evaluating the module, and thought I should flag it with you.

Ideally, when building a theme or module, it's good to be able to ensure these things are re-used consistently. While that would be an improvement, I think you've started in the right place by making your module cope fine without Libraries.

Thanks for the reply - if we keep using JWPlayer, I'll come back and throw a patch up here.

EDIT: Fixed confused terminology.

izmeez’s picture

swftools 6.x-3.x-dev release uses libraries and includes support for the jw media player from the libraries folder. Also, it seems to be the Drupal approach in other modules.

Granted it is easier to install a module with everything included, but this is unique because the player is written by the module maintainer and can be included with the module, but otherwise needs to be downloaded and placed in the required folder.

If the player is going to be something used in common with other modules, like swftools the libraries folder may be worth consideration and checks for existing components already in the libraries.

JW Player’s picture

Status: Active » Needs work
xurizaemon’s picture

Title: Consider Libraries API for SWFTools inclusion » Consider Libraries API for SWFTools (and JWPlayer SWF too?)

If we implement Libraries API for SWFTools, would it follow for this to apply to the SWF files as well?

That would reduce the steps required to upgrade the module. I dislike having to go digging around in backup/modules/20101124160606 for some JS file so I'm all into getting Libraries support where possible :)

#535592: Better place to store players and libraries says that SWFTools already references the same files in sites/*/libraries, so hopefully we can re-use the same location.

(FWIW, this time I just installed to sites/all/libraries/mediaplayer4 and symlinked to the SWF files from the module folder.)

JW Player’s picture

@grobot,

Yeah, it seems like player.swf and jwplayer.js (when we update to support HTML5 and our new embedder) would be good candidates for the libraries API.

Now we just need to find the time to fit this in. :)

Thanks.

spgd01’s picture

Version: 6.x-1.1 » 6.x-1.7

Any progress on this? Does the module save the jwplayer and swfobject into the libraries folder? Current documentation still says it puts the module files in

sites/default/files/jwplayermodule
sites/default/files/jwplayermodule/player
sites/default/files/jwplayermodule/configs

They really should be :

sites/all/libraries/jwplayermodule
sites/all/libraries/jwplayermodule/player
sites/all/libraries/jwplayermodule/configs

Thanks.