gesdinet/videothumbnailextensionbundle

Video Thumbnail Extension Bundle

0.2.2 2018-04-28 10:18 UTC

README

Install

composer require "gesdinet/videothumbnailextensionbundle": "~0.1.0"

Symfony 2.x

app/AppKernel.php:

$bundles = array(
    // ...
    new Gesdinet\Bundle\VideoThumbnailExtensionBundle\VideoThumbnailExtensionBundle(),
    // ...
);

Silex

use Gesdinet\Bundle\VideoThumbnailExtensionBundle\Twig\VideoThumbnailExtension;

$app['twig'] = $app->share($app->extend('twig', function($twig, $app) {
    $twig->addExtension(new VideoThumbnailExtension());

    return $twig;
}));

Usage

For youtube:

{{ video.code|video_thumbnail }}

For other service like Vimeo (WIP):

{{ video.code|video_thumbnail('vimeo') }}