{{ page.title }}

{{ page.description }}

The Overlay plugin allows both text and images to be used as overlays. The overlay plugin can also be configured for when the overlay appears and for how long. To add a simple image overlay to a player, use the player styling options. See Styling Players for information.

Overlays can be simple messages or images that appear on top of the player. In this player, a Brightcove logo is displayed in the bottom right of the player at the 2 second point until the 6 second point of the video.

You can control the display of the overlay based on:

Overlays are configured using the overlay plugin. When configuring the plugin, a JavaScript URL, CSS file, plugin name and plugin options will need to be provided.

Overlay plugin options

The plugin options are used to configure when the overlay appears, when it disappears, what will be displayed, and where it will be displayed. The following plugin options (formatted as JSON) are supported:

The following sample options will display a Brightcove logo image starting at the 2 seconds point in the video and ending when the video passes the 6 second point:


{
  "overlays": [
    {
      "start": 2,
      "end": 6,
      "content": "<a href='https://www.brightcove.com' target='_blank'><img src='http://solutions.brightcove.com/bcls/assets/images/brightcove-logo.png'></a>",
      "align": "bottom-right"
    }
  ]
}
  

Configuring a player overlay

To implement the Overlay Plugin using the Players module, follow these steps:

  1. Open the Players module and locate the player.
  2. Click the link for the player to open the player properties.
  3. Click Plugins in the left navigation.
  4. Click Add a Plugin > Custom Plugin.
  5. For the Plugin Name, enter overlay.
  6. For the JavaScript URL, enter:
    //players.brightcove.net/videojs-overlay/2/videojs-overlay.min.js
  7. For the CSS URL, enter:
    //players.brightcove.net/videojs-overlay/2/videojs-overlay.css
    	
  8. Enter the Options(JSON). The example below will display a clickable image at the bottom of the player starting at the 2 second mark and ending at the 6 second mark.
    {
    	  "overlays": [
    	    {
    	      "start": 2,
    	      "end": 6,
    	      "content": "<a href='https://www.brightcove.com' target='_blank'><img src='http://solutions.brightcove.com/bcls/assets/images/brightcove-logo.png'></a>",
    	      "align": "bottom-right"
    	    }
    	  ]
    	}
  9. Click Save and Publish the player. Note that it may take up to 5 minutes for the changes to appear in published players.

Note that it is possible to have multiple overlays configured for a player. See the developer documentation for more information.

For an example of how to use CSS to style a player overlay, see the Logo Overlay Plugin developer document.