To get your AudiencePlayer integration up to speed, customised Wordpress shortcodes are available for the most important features (see overview below). Style, layout and business logic contained in these shortcodes can easily be overwritten, or simply used as a development template for your own customised integration (in which case, please also see the help section code examples).

To overwrite, simply copy the relevant file(s) into a matching folder/file structure in your active "theme" folder. The plugin will first look here for the relevant files, and fallback to its own templates.
For example, copy the file: /wp-content/plugins/audienceplayer/templates/audienceplayer-shortcode-article-detail.php
to: /wp-content/themes/twentytwenty/audienceplayer/templates/audienceplayer-shortcode-article-detail.php
and modify it there to suit your requirements.

Location of the plugin template files:

    /wp-content/plugins/audienceplayer/templates/audienceplayer-shortcode-*.php       # location of the main php/html template files
    /wp-content/plugins/audienceplayer/templates/js/audienceplayer-shortcodes.js      # location of the main javascript business logic
    /wp-content/plugins/audienceplayer/templates/css/audienceplayer-shortcodes.css    # location of the css style file
    /wp-content/plugins/audienceplayer/templates/images                               # location of image placeholders

Important notes:

  1. By default, the plugin makes a modal video player available which is based on the AudiencePlayer Embed Player for JavaScript (also see the code examples for more details).
    Related template: templates/admin-core-html.php
  2. By default, the plugin makes a few simple modal dialogs available to either allow the user to interact (e.g. conduct a purchase) or to inform the user.
    Related template: templates/admin-core-html.php
  3. By default, the plugin makes a few simple translations available that may be overwritten and/or expanded as needed.
    Related template: templates/admin-core-translations.php
  4. The business logic and/or templates may be improved and modified over time, as this plugin evolves. If you use the shortcodes with templates as offered out-of-the-box, it is advised to review the changes and or test these before deplying them to your production environment.


Overview of available shortcodes


[audienceplayer_article_carousel]


This shortcode allows you to easily integrate a carousel. It uses the simple Slick carousel plugin. The main attributes to control the carousel content are "category_id" to display all articles within a given category, and "ancestor_id" to display all the descendant articles for a given parent article (e.g. display all lectures within a series). By default, clicking a thumbnail will open the modal video player. This behaviour can be overridden with attribute "click_action".
The respective php/html template is shared with shortcode "[audienceplayer_article_grid]".
[audienceplayer_article_carousel
    category_id=123           # display articles in category
    ancestor_id=456           # display child articles of ancestor
    aspect_ratio="16x9"       # image aspect ratio (landscape "16x9" or portrait "2x3")
    show_titles=true          # display titles below the images
    click_action=""           # your own custom deeplink pattern, e.g. "/articles/{{ article_id }}"
                              # if a full url or relative path (beginning with "/") is provided, action will redirect user.
                              # else given click_action will be assumed to be a callback function.
    authentication_action=""  # comparable to "click_action", this is executed when a user is not logged in and tries to
                              # view content. (by default, user is redirect to "wp-login?redirect_to=current_url")
    authorisation_action=""   # comparable to "click_action", this is executed when a user is not authorised to view
                              # content. (by default, a modal error dialog "payment required" is shown).
    class=""                  # your own custom class name
]

[audienceplayer_article_grid]


This shortcode allows you to easily integrate a grid. The main attributes to control the carousel content are "category_id" to display all articles within a given category, and "ancestor_id" to display all the descendant articles for a given parent article (e.g. display all lectures within a series). By default, clicking a thumbnail will open the modal video player. This behaviour can be overridden with attribute "click_action".
The respective php/html template is shared with shortcode "[audienceplayer_article_carousel]".
[audienceplayer_article_grid
    category_id=123           # display articles in category
    ancestor_id=456           # display child articles of ancestor
    aspect_ratio="16x9"       # image aspect ratio (landscape "16x9" or portrait "2x3")
    show_titles=true          # display titles below the images
    click_action=""           # your own custom deeplink pattern, e.g. "/articles/{{ article_id }}"
                              # if a full url or relative path (beginning with "/") is provided, action will redirect user.
                              # else given click_action will be assumed to be a callback function.
    authentication_action=""  # comparable to "click_action", this is executed when a user is not logged in and tries to
                              # view content. (by default, user is redirect to "wp-login?redirect_to=current_url")
    authorisation_action=""   # comparable to "click_action", this is executed when a user is not authorised to view
                              # content. (by default, a modal error dialog "payment required" is shown).
    class=""                  # your own custom class name
]

[audienceplayer_play_article_button]


This shortcode allows you to easily display a "play button". Clicking this button will open the modal video player.
[audienceplayer_article_carousel
    article_id=123            # the article id which contains the asset
    asset_id=456              # the asset_id to be played
    label="Afspelen"          # The text label that will appear in the button
    authentication_action=""  # comparable to "click_action", this is executed when a user is not logged in and tries to
                              # view content. (by default, user is redirect to "wp-login?redirect_to=current_url")
    authorisation_action=""   # comparable to "click_action", this is executed when a user is not authorised to view
                              # content. (by default, a modal error dialog "payment required" is shown).
    class=""                  # your own custom class name
]

[audienceplayer_embed_article]


This shortcode allows you to easily display an embedded player. It is mainly intended for content that is freely available, since no authentication/authorisation actions are defined.
[audienceplayer_article_carousel
    article_id=123            # the article id which contains the asset
    asset_id=456              # the asset_id to be played
    height=384                # height of the embedded player
    width=216                 # width of the embedded player
    autoplay=false            # automatically start playback (IF the browser allows this. E.g. Safari does not)
    poster_image_url=""       # image url of poster to be placed in the background
    label="Play video"        # The text label that will appear in the button
    class=""                  # your own custom class name
]

[audienceplayer_purchase_product_button]


This shortcode allows you to easily display a purchase button for a give product. Clicking this button will open a modal dialog flow via which the user can validate a voucher if applicable, conduct the payment with a remote payment provider and return to the page.
[audienceplayer_article_carousel
    product_id=123            # the article id which contains the asset
    label="Buy product"       # The text label that will appear in the button
    authentication_action=""  # comparable to "click_action", this is executed when a user is not logged in and tries to
                              # view content. (by default, user is redirect to "wp-login?redirect_to=current_url")
    authorisation_action=""   # comparable to "click_action", this is executed when a user is not authorised to view
                              # content. (by default, a modal error dialog "payment required" is shown).
    class=""                  # your own custom class name
]