6
votes

Assuming I have the video IDs can I access a still of the video?

I have read of the media API and the read functions for thumbnailURL and videoStillURL but have no idea how to implement.

Are there examples of using a still from an asset given the ID?

3

3 Answers

1
votes

The URl provided is no longer active.

0
votes

Yes, most all of the Media API read methods will return the videoStillURL and thumbnailURL if you specify them in the video_fields, or just return all fields. Once you get the URL, you can use it as the src value for an tag or you can browse to the URL if you want to download the image. There are many examples on the Brightcove sites of using these URLS to populate image tags src values -- see http://solutions.brightcove.com/bcls/AnalyticsAPI/most-popular-videos.html for example.

0
votes

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