Video SEO Schema Generator Plugin

Product(s)
Video Cloud
Brightcove Player
Role(s)
Player Developer
Topic(s)
Plugins
SEO
Type
Support Doc

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. An example result that Google would see for a video is shown here:

structured data video result

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

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. Next click Plugins from the three options.
    Select Plugin
  5. From the Add a Plugin select Custom Plugin.
  6. For the Plugin Name enter schema.
  7. For the JavaScript URL, enter:
    https://cdn.jsdelivr.net/npm/videojs-schema/dist/videojs-schema.min.js
  8. No CSS URL is needed.
  9. You do not have to enter any options for this plugin in this specific implementation.
  10. Click Save.
  11. To publish the player, click Publish & Embed > Publish Changes.
  12. 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
class="video-js"
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 Structured Data Testing 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 Structured Data Testing Tool. On that page you are prompted to enter the URL for the page containing your player:

structured data ui

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

structured data error

Here you see the full result from the testing tool for a video with no errors. This instance shows a Standard (iframe) player implementation, but the plugin works with Advanced (in-page) implementations also.

structured data full result

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.