Skip to content

Commit

Permalink
fix(playlist-plugin): expose playlist plugin version
Browse files Browse the repository at this point in the history
Expose the plugin version by adding a `VERSION` property to the constructor, to
retrieve the version of the component on a given player simply do:

```javascript
// Retrieve the player
const player = document.getElementsByTagName('video')[0].parentElement.player;
// Print the component version
console.log(player.pillarboxPlaylist().version());
```
  • Loading branch information
jboix committed Aug 20, 2024
1 parent 109905e commit 475d934
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/pillarbox-playlist/src/pillarbox-playlist.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import videojs from 'video.js';
import { version } from '../package.json';

/**
* @ignore
Expand Down Expand Up @@ -469,6 +470,7 @@ export class PillarboxPlaylist extends Plugin {
}
}

PillarboxPlaylist.VERSION = version;
PillarboxPlaylist.prototype.options_ = {
autoadvance: false,
repeat: false
Expand Down

0 comments on commit 475d934

Please sign in to comment.