Skip to content

Commit

Permalink
fix: remove deprecation warning on bcp 7 (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
mister-ben authored Nov 22, 2022
1 parent d080812 commit a0803d2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const defaults = {
transcriptMatchAny: false
};

const mergeOptions = videojs.obj ? videojs.obj.merge : videojs.mergeOptions;

/**
* Schema plugin. Adds schema.org metadata in json+ld format
* to the DOM for Google and other search engines which will
Expand Down Expand Up @@ -46,7 +48,7 @@ const schema = function(options) {
this.schemaEl_.type = 'application/ld+json';
document.head.appendChild(this.schemaEl_);

options = videojs.mergeOptions(defaults, options);
options = mergeOptions(defaults, options);

// This listens to error because Googlebot cannot play video
this.on(['loadstart', 'error'], e => {
Expand All @@ -58,7 +60,7 @@ const schema = function(options) {

const mediainfo = this.catalog.getMetadata ? this.catalog.getMetadata({lang: this.language()}) : this.mediainfo;

const ld = videojs.mergeOptions(options.baseObject, {
const ld = mergeOptions(options.baseObject, {
'@context': 'http://schema.org/',
'@type': 'VideoObject',
'name': mediainfo.name,
Expand Down

0 comments on commit a0803d2

Please sign in to comment.