Bindings to Clappr video player for Purescript.
This binding covers:
-
basic options
-
most of event handlers binders
-
most of built-in plugins
-
two extra plugins:
ResponsiveContainer
andReplayOnBuffering
-
ResponsiveContainer
keeps proportions provided by user and resizing to the parent container -
ReplayOnBuffering
reloads playback after a given timeout of buffering.
This library installs some dependencies using bower-npm-resolver
, so you have to install this resolver and use .bowerrc
like this:
{
"resolvers": [
"bower-npm-resolver"
]
}
If you work with webpack I can suggest taking a look into examples webpack files. I think the most important piece is this:
alias: { Clappr: 'clappr/dist/clappr.js', 'clappr-thumbnails-plugin': 'clappr-thumbnails-plugin/dist/clappr-thumbnails-plugin.js' },
Please check for example this file: ./examples/simple/webpack.config.js
for details.
There are separate examples provided:
-
examples/simple
- just shows how to use basic clappr player, -
examples/events
- provides example of how to attach event handlers, -
examples/plugins
- contains code which configures and uses some provided by this lib plugins.
You can build examples against cloned library code:
-
$ npm install
-
$ echo '{ "resolvers": [ "bower-npm-resolver" ] }' >> .bowerrc
-
$ bower install
Here we are building example for plugins
usage:
-
$ ./bin/examples.sh
- this script runsmake
and starts simple http server (python -m http.server
). -
Please follow the instruction on the examples page on
http://localhost:8000
.