hey guys,
got jplayer going on d7 with media module... and it's working great.

the only issue is how do i add a album cover for these audio nodes i have?
documentation says it takes images for poster frames.
i made an image field for the album cover and am wondering how to get it to show.

thx

Comments

deviantintegral’s picture

Category: support » feature

On one of the sites I've used this module with, we keep covers simple by just displaying the image field above the player. There's no direct integration between jPlayer and the image field. We also only allow one cover image per audio node, even if multiple tracks are uploaded.

If you have a need to actually integrate images with the jPlayer "media" object, there's a few things a patch would have to do:

  1. Add configuration for the display formatter to choose an image field to source the cover from.
  2. When setting the files in the jPlayer, pass in the URL from the associated image field.
  3. For playlist players, I would probably do it by setting the image field to be multi-value. Then the deltas for each field can correspond (first audio file references the first image) and be loaded with each change in the playlist player.
BrockBoland’s picture

I have tried setting a 'poster' variable in a variety of places, and it doesn't appear in the player. deviantintegral pointed out that jPlayer might be adding the image to the player on the page, but it could be hidden by CSS; this doesn't seem to be the case, because I never see the element in the DOM.

I have tried:

  • Adding a poster: key to the two $(player).jPlayer() calls in theme/jplayer.js, so that it appears at the same level as volume, muted, etc.
  • Adding it to each element in the array of files, so that the setMedia call ($(this).jPlayer("setMedia", playerSettings.files);) would pass an array of files with the poster key set in each one.
  • Adding it to the end of the array of files, so that the setMedia call ($(this).jPlayer("setMedia", playerSettings.files);) would pass an array containing objects with MP3 files and one object with the poster key set to the URL.

None of these have worked. deviantintegral also pointed out that the jPlayer library itself has a lot of logic around displaying the poster image; I didn't have time to dig into this, but it seems likely at this point that it's declining to append the post image element to the DOM for some reason.

BrockBoland’s picture

Component: Documentation » Code