Custom player templates are available only for Video Cloud Pro and Enterprise customers. If you are interested in upgrading your Video Cloud account, please contact Brightcove for more information.
Many BEML components, such as Labels, enable you to display a dynamic property value. One property you'll want to display in many contexts is the length of a video. Time values like a video's length often need to be formatted for display. For example, the VideoPlayer has access to a video's duration through the mediaDuration property, but this property is a time in seconds, which is not a very user-friendly measure to display to your viewers. You can instead use a format function with a Formatter to display a time in hh:mm:ss format. The format function takes two arguments: the name of the value you want to display and the Formatter class you want to use to format or transform the value. In this release of Video Cloud, you can use one of two Formatter classes that format time values into hh:mm:ss format, SecondsTimecodeFormatter and MillisecondsTimecodeFormatter. The format function returns a string, so you can use it in any BEML context where you could use a string value.
You can apply a time Formatter to the following values:
To display a milliseconds value in hh:mm:ss format, use a format function with MillisecondsTimecodeFormatter. For example:
<Label width="31" height="17"
text="{format(videoPlayer.video.length,
MillisecondsTimecodeFormatter)}" />
Or, for a video in a list item:
text="{format(currentItem.length,
MillisecondsTimecodeFormatter)}"
To display a seconds value in hh:mm:ss format, use a format function with SecondsTimecodeFormatter. For example:
<Label width="31" height="17"
text="{format(videoPlayer.mediaDuration,
SecondsTimecodeFormatter)}" />