diff --git a/packages/pillarbox-playlist/src/pillarbox-playlist.js b/packages/pillarbox-playlist/src/pillarbox-playlist.js index e536fa6..b1eb63d 100644 --- a/packages/pillarbox-playlist/src/pillarbox-playlist.js +++ b/packages/pillarbox-playlist/src/pillarbox-playlist.js @@ -1,4 +1,5 @@ import videojs from 'video.js'; +import { version } from '../package.json'; /** * @ignore @@ -467,6 +468,10 @@ export class PillarboxPlaylist extends Plugin { currentIndex: this.currentIndex_ }); } + + static get VERSION() { + return version; + } } PillarboxPlaylist.prototype.options_ = { diff --git a/packages/skip-button/src/skip-button.js b/packages/skip-button/src/skip-button.js index 960d360..42fc339 100644 --- a/packages/skip-button/src/skip-button.js +++ b/packages/skip-button/src/skip-button.js @@ -1,4 +1,5 @@ import pillarbox from '@srgssr/pillarbox-web'; +import { version } from '../package.json'; import './lang'; /** @@ -74,6 +75,10 @@ class SkipButton extends Button { this.controlText(text); this.show(); } + + static get VERSION() { + return version; + } } pillarbox.registerComponent('SkipButton', SkipButton); diff --git a/scripts/template/src/{{kebabCase name}}.js.hbs b/scripts/template/src/{{kebabCase name}}.js.hbs index babec0f..be9e43b 100644 --- a/scripts/template/src/{{kebabCase name}}.js.hbs +++ b/scripts/template/src/{{kebabCase name}}.js.hbs @@ -1,4 +1,5 @@ import {{platform}} from '{{importAlias}}'; +import { version } from '../package.json'; {{#if wantLocalization}}import './lang';{{/if}} {{#ifEq type 'Plugin'}} @@ -21,6 +22,10 @@ class {{properCase name}} extends Plugin { constructor(player, options) { super(player, options); } + + static get VERSION() { + return version; + } } {{platform}}.registerPlugin('{{camelCase name}}', {{properCase name}}); @@ -52,6 +57,10 @@ class {{properCase name}} extends {{type}} { handleLanguagechange() { super.handleLanguagechange(); } + + static get VERSION() { + return version; + } } {{platform}}.registerComponent('{{properCase name}}', {{properCase name}});