{jrCore_media_player}

  • Overview

    The {jrCore_media_player} template function is used to display an audio, video or playlist player in a template.

    You can either pass in parameters to be looked up by the player or an array of items that you already have to have the player play it.
  • Examples

    An example from the jrAudio modules item_list.tpl template where the button player is called for
     {jrCore_media_player type="jrAudio_button" module="jrAudio" field="audio_file" item=$item}
  • An example from the jrAudio modules item_details.tpl template where the full dark player is called for:
    {jrCore_media_player type="jrAudio_player_dark" module="jrAudio" field="audio_file" item=$item autoplay=true}
    
  • An example from the jrPlaylist module where the playlist player is called for:
    {jrCore_media_player type="jrPlaylist_player_dark" module="jrPlaylist" item=$item}
  • {jrCore_media_player}

    Function
    {jrCore_media_player}
    parameter
    type
    default
    required
    description
    module
    string
    -
    on
    The module of the datatsore to look in for the media to play. (if the items is not provided.)
    type
    string
    -
    on
    The name of the player to use. (available players are provided by modules via 'registered_module_features' )
    item_id
    integer
    -
    off
    if you want the player to play a specific item.
    item
    array
    -
    off
    if you want to pass an item in from the templates. (single item)
    items
    array
    -
    off
    if you want to pass an item in from the templates. (multiple items)
    search
    string
    -
    off
    if you dont pass in item or items then you can use the search terms to locate items.
    search1
    string
    -
    off
    an additional search string
    search2
    string
    -
    off
    an addtional search string
    search(x)
    string
    -
    off
    as many search terms can be added as needed search1="" search2="" search4=""...
    order_by
    string
    -
    off
    an order to list by. eg: order_by="_created numerical_desc"
    group_by
    string
    -
    off
    a group_by clause allows the returned results to be grouped. eg: group_by="audio_album_url"
    limit
    limit
    -
    off
    the amount of items to return. eg limit="5"
    assign
    string
    -
    off
    if you want the returned results to be assigned to a variable instead of output. eg: assign="foo" will assign the output to {$foo}
    field
    string
    -
    on
    The base key value for all datastore parameters relative to this media item. eg 'video_file'
    xxxx
    -
    any other parameters passed in will be passed on to the templates. eg: autoplay="true" will be available in the players template at {$autoplay}
    parameter can be passed into this template function to change the output of what is returned.
  • Additional parameters might also be made available by the module that provides the player.

    An example of this is the autoplay="" parameter made available from the jrAudio modules players.

    Any additional parameters can be passed in to the function at call time. These parameters will be passed in to the template and made available to the module to use.


    Setting autoplay="true" has the effect of telling to the player to immediately start playing when it loads.
  • Example: get a single video file

    To get just a single video file where you don't have the whole $item because the template is not part of a {jrCore_list} call, you can use just the item_id to retrieve the item your looking for.

    eg, for video:
    {jrCore_media_player module="jrVideo" field="video_file" item_id=2}
elric
15 Oct 2014 05:44:01PM @elric:
Hello, I've been looking for a way to use this to embed the dark player for video on my index.tpl, and have it play all videos on my site with a specific genre as a play list. Sort of like the old Jamroom 4.x with the admin video play list...Any suggestions?

Cheers,
~E

michael
16 Oct 2014 02:09:08AM @michael:
Better to ask questions in the forums, I almost missed this one. The code you want is:
{jrCore_media_player module="jrVideo" search="video_genre = rock"}

To play all videos in the 'rock' genre.

The other way to do it is to use the {jrCore_list} function to create the list of items, then pass that into the player.

{jrCore_list module="jrVideo" search="video_genre = rock" template="playlist.tpl"}

Then in playlist.tpl
{jrCore_media_player module="jrVideo" items=$_items}

Both ways will work.

elric
16 Oct 2014 05:02:54PM @elric:
Hah! Hi Michael! I had SO many screens open, I posted here thinking the forums. Thank you, will give this a try.

Cheers,
E

elric
16 Oct 2014 10:19:47PM @elric:
I'm going to copy this over to the forums! Still having issues. Will link here to the post.

https://www.jamroom.net/the-jamroom-network/documentation/development/788/jrcore-media-player

nate
05 Apr 2016 10:58:14AM @nate:
Are there any docs on how to register players vs player_skins. I'm trying to have different players for certain pages.

Share This

Tags