Custom player templates are available only for Brightcove Pro and Enterprise customers. If you are interested in upgrading your Brightcove account, please contact Brightcove for more information.
A Brightcove player is specified by an XML document called a player template. Brightcove includes a number of standard player templates, but also gives you the ability to create custom player templates. This document describes how to write the XML document that specifies your custom player template.
The XML you use in a player template is defined by the document type definition (DTD) for the Brightcove Experience Markup Language (BEML). The BEML DTD Reference describes all of the XML elements and attributes that you can use in a BEML document. The standard player templates may be a useful starting point for your custom player template development. You can download the BEML for each of the standard player templates as a .zip file.
Each element in a player template defines some visual or non-visual aspect of a player. An element can define a UI element, like a text label, a banner, or a video player, or a layout element, that defines how the UI elements are arranged in relation to each other and the overall player layout. The attributes of player elements define such things as the elements' location (in terms of x, y coordinates), the style, and the source of the data to display (video name, image location, etc.) The main elements in a player template include:
Because a BEML player template is an XML document, you need to understand the basics of XML to be able to develop a custom player template using BEML. If you need a primer on XML, here are a few basic resources:
The single problem you are most likely to encounter is with special characters. In XML markup, be sure to escape the following five special characters:
|
Character
|
Escaped form
|
|---|---|
|
<
|
<
|
|
>
|
>
|
|
&
|
&
|
|
'
|
'
|
|
"
|
"
|
In addition, be sure not to include extra white space in XML attributes. For example, do this:
<element id="foo" />
and not this:
<element id = "foo" />
The extra white space before and after the equals sign in this example prevents the player template from being styled in the Publishing module.
Using the Labels element in a player template, you can customize the text of every label in your player. This enables you to create a player with labels in most languages, as well as customize the text for style, branding, promotion, or other purposes. For more information, see Localizing players.
Using the Theme element in a player template, you can customize the look and feel of your custom Brightcove players. Depending on the degree of customization you require, you can use the Theme element and Style elements to:
Note that if a player template does not include a Theme element, then you will not be able to use the Publishing module to modify the styles of a player that is based on that player template. For more detail, see Themes and styles in player templates.
The Layout element controls which UI elements are included in a player and where they are positioned within the player. A Layout element can contain two types of child elements: layout boxes and components. Layout boxes are containers for other elements, which can be either additional layout boxes or components. The containing layout box defines how the child elements are laid out and sized. Components are the UI elements themselves, like a VideoPlayer, Label, or Image.
In general, layout boxes are non-rendering, though you an assign a background color and a background image to a layout box that will be rendered behind all of its child elements. You can use the following standard layout boxes:
For more information about the Layout element and layout boxes, see Layout elements in player templates.
Components include several different classes of objects that you can include in the layout of a player. A component can be visual, like a VideoPlayer or an Image, or non-visual. Here's how some of these elements appear in a player:
Brightcove includes the following standard components, each of which is described in more detail in Components in player templates and the BEML DTD Reference:
You can use the Modules element to load non-rendering custom components into your players. A custom module must be compiled into a SWF file and hosted outside of Brightcove. In order to specify a custom module, include as a child of the Modules element a Module element that contains a file attribute with the path to the SWF to be loaded. For example:
<Modules> <Module file="http://myserver/customReporting.swf" /> </Modules>
The Module element can optionally include any number of parameters, which will be passed through to the SWF when it loads:
<Module file="http://server/file.swf"> <param name="foo" value="bar" /> <param name="food" value="grill" /> </Module>
The values of the parameters can also be bound to other elements in the player template. For instance, if a module needed a flashvar param set in the HTML as well as the name of the video every time it changed, the following BEML would allow for that:
<Module file="http://server/file.swf">
<param name="customParam" value="{player.parameters.customParam}" />
<param name="videoName" value="{videoPlayer.video.displayName}" />
</Module>
A Modules element can include more than one Module child element, if you have more than one SWF you want to load in the player. For custom components that need to be rendered in the player, use the SWFLoader component instead. For more information about custom components, see Creating custom player components and Adding a custom component to a player template.
Learn more about the elements that make up a player template: