Yes, you can get thumbnail image url of a BrightCove video from player instance. Which means when a player is loaded and we get instance object of player (e.g. playerInstance), we can get the thumbnail url from playerInstance.mediainfo.poster
.
mediainfo
can't be called directly when player is loaded because video information loads after the player is initialized so we need to wait for mediainfo
object to have required information. Hence we need to call playerInstance.mediainfo.poster
on loadeddata
event. Please refer the code example underneath.
// After loading BrightCove script
i.e. https://players.brightcove.net/[ACCOUNT_ID]/[PLAYER_ID]_default/index.min.js
// Initialise player using videojs object
let playerInstance;
videojs.getPlayer('[ID_PROVIDED_IN_BRIGHTCOVEPLAYER_ELEMENT]',).ready(() => {
playerInstance = this; // Assigning player instance
playerInstance.on('loadeddata', () => {
console.log(playerInstance.mediainfo.poster); // Thumbnail URL
});
});
But if you need thumbnail image before you initialise Brightcove player, there is no exact way to get it from the same API. There is another API provide by brightcove, please refer the same. https://apis.support.brightcove.com/playback/code-samples/thumbnail-grid.html