{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}

Tags