Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I needed a jPlayer with a manually compiled list of items not based on a field. Instead of reimplenting the whole theme function, it was actually really easy to make theme('jplayer') work without providing an entity and a field name, but just a list of items.
With the attached patch, it's possible to use theme('jplayer', $vars)
, with
$vars => array('items' => $items, 'settings' => $settings)
.
Comment | File | Size | Author |
---|---|---|---|
jplayer_without_entities.patch | 1.6 KB | Frando |
Comments
Comment #1
EJx64 CreditAttribution: EJx64 commentedOk, so I'm quite stuck- I've been trying to figure out a way to better control a feed of audio/video items. I just want the user to see one item at a time (Not a playlist), and play a continuous feed of nodes, controlled by database access requests (or node requests). (When the current item finishes, grab another from the system and play that).
Not sure if that's what this patch is trying to accomplish, but I've applied it and trying to get it to work as described. However I don't know how to build my array of items. Also I'm not sure if my settings are formatted correctly, they don't seem to be... I'm using hook_page_menu() to call this function below.
Any assistance will be greatly appreciated! Thanks in advance!
Comment #2
Frando CreditAttribution: Frando commentedHere's how I display a jPlayer with the patch above:
Comment #3
tripper54 CreditAttribution: tripper54 commentedReally useful patch, RTBC!