Label texts in Brightcove players are specified in label elements in a player template. This enables you to easily customize the texts of all the labels visible to your viewers. You can customize label texts to localize a player for a particular language, or just because you want your play button to say "Go!" instead of "Play." There are at least three approaches you can take to customizing the labels:
The Labels element in a player template can contain both the path to an XML file to be loaded or individual overrides of labels for a player. You can override these labels to localize or otherwise change the default text displayed in the players.
Note: If you modify labels in a player template, be sure to preview the modified player to make sure that the labels still fit within the player layout. If your customized labels are significantly longer than the default labels, they may no longer fit and might be truncated in display or prevent other player components from rendering correctly. If that happens, you may need either to re-word your custom label or make other modifications to the player layout to make the label fit.
To override any or all of the labels in a player template:
Labels element to point to the URL of the label set XML file. For example:<Labels file="http://server/labels.xml" />
Or, use the Language Options settings in the Publishing module to point to the URL of the label set XML file.
Bear in mind the Flash security constraints that limit a player's ability to interact with other domains. The domain that hosts your label set XML file needs to include <allow-access-from domain="admin.brightcove.com" /> in its crossdomain.xml file.
A label set file is a simple XML file that has just two kinds of elements:
labels container elementlabel elementsThe container element looks like this:
<Labels xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Within the labels container element are one or more label elements, which have this structure:
<label key="label name">Label Text</label>
Use one label element for each label you want to override. You need to include label elements only for the particular labels you want to override. Any other labels will retain their default values. Here is an example of a label set XML file. For information about the label keys and their default values, see the Player Label Reference.
You can also override individual labels, using a label element as a child of the Labels element for each label you want to override. The label element contains a value to be used for a specific label in a player. Using a label element to override label texts is handy if there are only a select few labels that need to be overridden and when a full XML file is not needed, or the additional load of an XML file is not desired. The structure of the label element is:
<Labels> <label key="label name">label value</label> </Labels>
You use the same label names in a label element as you use in a label set XML file. See the Player Label Reference for more information. The text of the label element can use any character set. For example, here is a Japanese label:
<Labels> <label key="controls play">??</label> </Labels>
However, note that due to limitations in Flash, labels in right-to-left languages like Arabic and Hebrew do not function well.
Note: Do not confuse the <label> element, a child of the <Labels> element, with the uppercase <Label> element, which is a UI element within a Layout.
In addition to localizing the labels in a player, you can:
Localize the player error messages that are displayed in cases where the player is unable to be rendered.