cbc video thumbnail urls

Description

Filter the thumbnail URLs of a video, tried in order until one is downloaded. Since version 2.3.1 the plugin always imports the largest thumbnail available (up to 1280 x 720 px); the “Image size” options were removed. Available since Video Hub 2.3.1.

Parameters

$urls
(string[])(required) Thumbnail URLs, largest first.
$video
(\WPYTHub\Video)(required) The video.

Examples

Import the 480 x 360 px “high” thumbnail first, to save disk space.

add_filter( 'cbc_video_thumbnail_urls', function( $urls, $video ) {
    array_unshift( $urls, 'https://i.ytimg.com/vi/' . rawurlencode( $video->get_id() ) . '/hqdefault.jpg' );
    return $urls;
}, 10, 2 );

Start importing in minutes

Bring your YouTube content into WordPress and let it update itself. Includes automatic updates and support.