Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

flowplayer/flowplayer-thumbnails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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