angular-thumbnails
AngularJS directive to render thumbnails of images, videos, and PDF files in canvas elements.
Installation
This library is available via Bower:
bower install angular-thumbnails --save
Usage
Including the directive
Add the script to your index.html:
Add the module to your angular application:
var myApp = angular.module('myApp', [ 'angular-thumbnails' ];
The thumbnail
element becomes available:
Within a controller's scope, you can bind the thumbnail settings to your scope variables:
Directive attributes
file-type
: Specifies the type of the source media. Accepted values areimage
,video
,pdf
.source
: URI (can be a data encoded URI) to the media to render.max-height
: Maximum height of the thumbnail in pixels.max-width
: Maximum width of the thumbnail in pixels.
There currently is no way to set the actual height/width of the thumbnail. The values will calculated based on the dimensions of the rendered element, respecting the height/width ratio of the element.