Customizing Brightcove Player Behavior in a Page
In addition to using the Brightcove Console to control Titles and Lineups for your Player, you can edit the Brightcove-provided Player publishing code to customize Player behavior in its published location. For example, you could specify a different "teaser" Lineup in a secondary location of your Player.
To obtain a copy of the Brightcove Player publishing code snippet from the Brightcove Console after creating a Player: Click the Players tab, select the player from the list on the left, and click the Get Publishing Code button at the bottom right. Then, select the appropriate tab (JavaScript, etc.) and click Copy. View sample player publishing code
Player behaviors you can control and their associated publishing code attributes:
- The default video Title loaded into the player (videoId, videoRef)
- The default Lineup loaded into the player (lineupId)
- Whether or not to play the video upon loading into a page or application (autoplay)
- Whether to play through Titles in a Lineup (or Lineups) on playback (continuousPlay)
- The background color displayed while the Player is loading (preloadBackColor)
The publishing code comments generally advise against editing the width and height attributes in the Player publishing code. You can resize Players that are based on the Single Title Player, Chromeless Single Title Player, and Vertical Title List Player templates using these attributes (Resizing a Player). However, changing these dimensions for other Players will only either create excess space around the Player (if made bigger) or crop the Player (if made smaller).
- The width of the player (width)
- The height of the player (height)
For more information on the editable attributes of the Brightcove Player publishing code, see Editing the Player Publishing Code.
