An .inc file in the 'players' directory may provide a theme function for displaying an XSPF player, but that function never gets registered into the theme registry.

This patch solves that issue. After applying this patch, one may invoke the 'xspf_extended' player with code similar to this:

  if ($player = audio_get_players('name', 'xspf_extended')) {
    return theme($player['theme_xspf'], $xspf_playlist_url));
  }

... where $xspf_playlist_url is a variable containing the URL of an XSPF playlist.

Comments

David Lesieur’s picture

StatusFileSize
new1.84 KB

This patch improves on the previous one by allowing:

  • Multiple players per .inc file in the players directory.
  • Passing custom options to the player's theme function (those options being defined in hook_audio_player()).

I'm trying to integrate a skinnable player. I'm providing an item for each skin in hook_audio_player(), all of which are actually pointing to the same theme function. The options passed to the theme function identify the skin to use.

I can't have a separate theme function for each skin because my goal is to (eventually) dynamically find the skins by scanning files in the player's directory.

drewish’s picture

Status: Needs review » Fixed

looks good. committed to HEAD.

Status: Fixed » Closed (fixed)

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