Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This page describes how to use two advanced BrightAuthor features: custom autorun plugins and parser scripts. These instructions assume a certain level of familiarity with BrightScript. This is not a comprehensive guide to writing custom scripts for BrightAuthor; rather, it is meant to provide a general outline and best practices for writing those scripts.

...

Overview

Plugins allow you to add script extensions to a standard presentation autorun. Plugins have two primary benefits over custom autoruns:

  • They can be easily inserted into multiple presentations, including newer and older versions of the same presentation

...

  • .

  • They are not dependent on a certain autorun or firmware version, greatly reducing the complexity involved in updating custom BrightScript deployments.

...

BrightAuthor Autorun Plugins

Note

BrightAuthor plugins can be added to presentations in BrightAuthor 3.7 or later.

To designate one or more custom plugins for a BrightAuthor presentation, navigate in BrightAuthor:

  1. Navigate to File > Presentation Properties > Autorun.

...

  1. Select the Add Script Plugin button

...

  1. Give the plugin a name (which must be the same as the <plugin_name> described in the initialization function below),

...

  1. Select the Browse button to locate and select a .brs file to use as a plugin.

Plugin Structure

Plug-in scripts must include an initialization function in the form of <plugin_name>_Initialize(). This initialization function is passed three parameters:

...

Each associative array consists of one or more key-value pairs. All values must be strings–including numerical values. The following table outlines accepted key-value pairs:

Key

Value

Example

Notes

url

A download URL for the file

"www.brightsign.biz/images/myfeedpic1.jpg"

Required – The item will be ignored if this value is not present.

medium

video | image | audio | document

"video"

Suggested – If the medium and type values are not present, the medium value will default to "image".

type

video/*, audio/*, image/*, text/html, application/widget

"video/*"

Suggested – If the medium and type values are not present, the type value will default to "image/*".

duration

The display duration in seconds

"30"

Optional – This value applies to images only, and has no effect on other media types. If not specified, this value defaults to "15".

title

The value for the MRSS Title field

"myfeedpic1"

Optional

description

The value for the MRSS Description field

"$5.99"

Optional

size

The size of the file in bytes

"942061"

Optional

guid

A unique value for the file

"ab05caf"

Optional – When this value changes, the player will re-download the file.

mrssCustomFields

An associative array of arbitrary key-value pairs

{key1:"custom field A", key2:"custom field B"}

Optional – Use this associative array to include custom MRSS fields.

Metadata Specification

The metadata object is an empty associative array when the parser subroutine is entered. This associative array can accept optional key-value pairs that represent properties for the entire feed. All values must be strings–including numerical values. The following table outlines accepted key-value pairs:

Key

Value

Example

Notes

title

A title for the feed

"myfeed1"


ttl

The time-to-live in minutes

"5"

This value represents how long the feed will be stored (whether it's utilized by the presentation or not) before being refreshed. The user will also set an Update Interval when adding the Data Feed to the BrightAuthor presentation; if the ttl value is specified, the presentation will use the lesser of the two values to determine the refresh frequency.