Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

andrefilimono/clappr-flvjs-playback

Repository files navigation

npm version License: MIT js-standard-style

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>
  <!--
  THIS PLUGIN IS ALSO COMPATIBLE WITH CLAPPR-CORE
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@clappr/core@latest/dist/clappr-core.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, // default is "false"
      // Params from flv.js
    }
  }
});

Configuration

The parameters of flvjsConfig are completely equal to the parameters of flv.js

enableLogging - enable or disable flv.js logging

Development

Install dependencies:

yarn install

Start HTTP dev server http://localhost:8080:

yarn start

Upgrade packages to latest version:

yarn upgrade --latest

Build

Minified version of plugin will be placed at dist/clappr-flvjs-playback.min.js

yarn build

Lint

Run linter:

yarn lint

Fix lint errors:

yarn lint:fix

Issues

Feel free to submit issues and enhancement requests.