Skip to content

Latest commit

 

History

History
68 lines (51 loc) · 1.59 KB

README.md

File metadata and controls

68 lines (51 loc) · 1.59 KB

Flowplayer thumbnails plugin

This plugin displays preview thumbnail images on the timeline.

Usage

See: https://flowplayer.org/docs/plugins.html#thumbnails

Initialize player

flowplayer('#player', {
  ratio: 0.4167,
  clip: {
    title: 'Bauhaus',
    thumbnails: {
      template: 'thumbnails/bauhaus{time}.jpg',
      time_format: function (t) {
        // An example using left padding.
        var padding = "0000";
        var formatted_time = padding.substring(0, padding.length - t.toString().length) + t;
        return formatted_time + "-thumb.jpg";
      }
    },
    sources: [{
      type: 'video/webm',
      src: '//stream.flowplayer.org/bauhaus.webm'
    }, {
      type: 'video/mp4',
      src: '//stream.flowplayer.org/bauhaus.mp4'
    }]
  }
});

Demo

http://demos.flowplayer.org/api/thumbnails.html

CommonJS

The plugin can be used in a browserify and/or webpack environment with a commonjs loader:

var flowplayer = require('flowplayer'),
    plugin = require('flowplayer-thumbnails');

plugin(flowplayer); // plugin injects itself into Flowplayer

Building the plugin

Build requirement:

cd flowplayer-thumbnails
make deps
make