Video SEO Schema Generator Plugin

In this topic, you will learn how to use a plugin that generates a video schema for SEO.

Introduction

The plugin detailed in this document adds SEO metadata for the video in your Brightcove Player.

You can learn more about validating your structured data later in the document in the Google's Structured Data Testing Tool section.

Configuring the player

With the latest Video SEO Schema Generator Plugin update, a new transcript function was added that the Google Search Bots have issues with when a Flash plugin is not available. Currently, all Brightcove Players include the Flash tech by default.

To alleviate the issue, you should update the Player configuration to remove the Flash tech. You can do this with the JSON Editor for the player in the Video Cloud Players Module.

To remove the Flash tech from a version 6.x.x player, do the following:

  1. In Video Cloud Studio, navigate to the Players module.
  2. In the left navigation, select JSON Editor.
  3. Add the following highlighted attribute to the player configuration:
    Flash false
    Flash false
  4. Publish the change for the player.

With the next major version release, the player will NOT include the Flash tech.

Installing the plugin

This plugin installs just as any custom plugin would. Following are instructions to add the plugin using Studio and in code.

Installing using the PLAYERS module

  1. Open the PLAYERS module and either create a new player or locate the player to which you wish to add the plugin.
  2. Click the link for the player to open the player's properties.
  3. Click Plugins in the left navigation menu.
  4. From the Add a Plugin dropdown, select Custom Plugin.
    Custom Plugin
  5. For the Plugin Name enter schema.
  6. For the JavaScript URL, enter:
    https://cdn.jsdelivr.net/npm/videojs-schema/dist/videojs-schema.min.js
  7. No CSS URL is needed.
  8. You do not have to enter any options for this plugin in this specific implementation.
  9. Click Save.
  10. To publish the player, click Publish & Embed > Publish Changes.
  11. To close the open dialog, click Close.

Installing using code

If you wish to install the plugin for single player using code, use the following code as a guide:

<video id="myPlayerID"
data-video-id="5796745147001"
data-account="1507807800001"
data-player="default"
data-embed="default"
data-application-id=""
controls=""
width="640"
height="360"></video>
<script src="//players.brightcove.net/1507807800001/default_default/index.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/videojs-schema/dist/videojs-schema.min.js"></script>

<script>
videojs.getPlayer('myPlayerID').ready(function() {
var myPlayer = this;
myPlayer.schema();
});
</script>

Google's Rich Results Test Tool

Once the plugin in installed, and you publish a video in a Brightcove Player you can test to be sure the structured data is correct. Google provide a Rich Results Tool.

On this page, you are prompted to enter the URL for the page containing your player and choose to test based on a desktop or smartphone client:

rich results ui

After you enter the URL to your page and click TEST URL, any errors in your data will be displayed.

Rich testing results

The results show you whether the page passes, but also offers additional valuable information. For example, click on the video title to expand the video information:

Rich Testing Video Information
Rich Testing Video Information

Schema used

This plugin is used to inject metadata from a Video Cloud video in to the page as Schema.org structured data. It uses the JSON-LD format supported by Google for video SEO:

<script type="application/ld+json">
{
"@context":"http://schema.org/",
"@type":"VideoObject",
"name":"Big Buck Bunny",
"description":"(c) copyright 2008, Blender Foundation / www.bigbuckbunny.org",
"thumbnailUrl":"https://cf-images.eu-west-1.prod.boltdns.net/v1/static/906043040001/f7d56300-ffca-460d-8ff6-fef835c12b36/e284fdba-d15a-422f-bebc-6a355e3d4dd3/1280x720/match/image.jpg",
"uploadDate":"2016-10-20",
"@id":"http://players.brightcove.net/906043040001/5WnZb7ptr_default/index.html?videoId=ref:bunnyfull",
"duration":"PT10M35S",
"embedUrl":"http://players.brightcove.net/906043040001/5WnZb7ptr_default/index.html?videoId=1401169490001"
}
</script>

Plugin options

There are six options you can use with this plugin:

  • schemaId: The value to use as @id in the metadata. This must be a unique URI which represents the video, but not necessarily a "real" URL. This is arbitrary and might be values like:
    • https://mydomain.com/videos/{id}
    • https://videos.mydomain.com#{id}
    • https://mydomain.com/article-about-video-{id}#the-video

    The following are accepted as macros:

    • {id}
    • {referenceId}
    • {playerId}
    • {embedId}
    • {accountId}

    The default URI will be:

    https://players.brightcove.net/{accountId}/{playerId}_{embedId}/index.html?videoId={id}
  • keywords: If true, include tags as keywords.

    Default is false.

  • excludeTags: Array of tags to not include as keywords.

    e.g. ["youtubesync"]

  • baseObject: An option object of properties onto which to build the video specific metadata. For example this could be used to include a publisher object:
    "baseObject": {
      "publisher": {
        "@type": "Organization",
        "name": "Publisher name",
        "logo": {
          "@type": "ImageObject",
          "url": "https://example.com/logo.jpg",
          "width": 600,
          "height": 60
        }
      }
    }
  • includeEmbedUrl: If false, no embed url is included. Including this URL may be expected by search engines.

    Default is true.

  • preferLongDescription: If true, use the long description if available. If false, or true and long description is not set, then the (short) description field will be used.

    Default is false.

  • skipRules: Excludes videos from having schema metadata generated. It can be triggered using one or more tags and or custom fields.

    e.g. skipRules.tags

              
                "skipRules": {
                  "tags": ["private"]
                  }
              

    e.g. skipRules.customFields

              
                "skipRules": {
                  "customFields": {"category": "unlisted"}
                  }
              
  • transcript: If true, a transcript will be generated from the first subtitles or captions track matching the player language (which will generally match the page language).

    Default is false.

  • transcriptMatchAny: If true and transcript is also true, a transcript will be added from the first usable track, if there is no language match.

    Default is false.