1

In Wordpress (3.8.1) and JW Plugin (v2.1.2) with JW Player (v5), I need to read off the items contained in the Playlists of the JWPlayer Plugin.

Normally

The JWPlayer Plugin works like this, via Shortcode:

[jwplayer playlistid="1234"]

.. then a Video Player will be being rendered on the Page, together with a Playlist inside.


What i want to do (The Customizing)

So now how do i customly do by myself .. if i want to know (or pull out) the items inside a Playlist, by using its playlistid or 1234.

Lets say in a totally New Page (without using JWPlayer Shortcodes), i will use my own Custom Shortcode, like:

[playlistitems id="1234"]

(The id is the ID of JWPlayer "existing" Playlist)
Then The New Page will be showing (just list down) the Items inside, like:

- intro.mp4
- chapter-1.mp4
- chapter-6.mp4
- wrapup.mp4

.. something like that which needs to be done by my custom module (or) functions.


In more simple words:

  • I want to list down the Items inside the JWPlayer's playlist (by using its ID)
  • How does JWPlayer reads a Playlist. Then i may need to clone its function.

Thank you.

3
  • have you tried looking in the jwplayer plugin code for the function which outputs the shortcode?
    – Milo
    Commented Apr 4, 2014 at 2:57
  • Honestly not yet, because i can't find where is it :( Commented Apr 4, 2014 at 2:58
  • 1
    search for add_shortcode in the plugin files and look at the function name hooked to the shortcode with tag jwplayer.
    – Milo
    Commented Apr 4, 2014 at 3:02

1 Answer 1

1

Got it, after making a Custom Shortcode (this can be found on standard WP docs), then by direct calling one of JW player's function, from the Template File, like:

generate_playlist( '1234' );

It will then return a complete Array of the JW Playlist Object, so we can parse it out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.