FLVJSPlayback
A clappr FLV playback based on flv.js
Usage
Add Clappr, flv.js and the plugin scripts to your HTML:
<head>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/clappr@latest/dist/clappr.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/flv.js@latest/dist/flv.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/clappr-flvjs-playback@latest/dist/clappr-flvjs-playback.min.js"></script>
</head>
Then just add FLVJSPlayback
into the list of plugins of your player instance, and the options for the plugin go in the flvjsConfig
property as shown below.
var player = new Clappr.Player({
source: "http://your.flv.video",
mimeType: 'video/flv',
plugins: [ FLVJSPlayback ],
playback: {
flvjsConfig: {
enableLogging: true,
}
}
});
Configuration
The parameters of flvjsConfig
are completely equal to the parameters of flv.js
enableLogging
- enable or disable flv.js logging
Development
Install dependencies:
npm install
Start HTTP dev server http://localhost:8080
:
npm start
Build
Minified version of plugin will be placed at dist/clappr-flvjs-playback.min.js
npm run build
Lint
Run linter:
npm run lint
Fix lint errors:
npm run lint:fix
Issues
Feel free to submit issues and enhancement requests.