videojs-persist-controls

0.0.5-spec • Public • Published

videojs-persist-controls

Save videojs controls value to local storage and retrive the previously stored values to the current session.

Currently, this plugin persists the following controls:

  • Mute
  • Volume
  • Playback rates
  • Captions
  • Audio Tracks

Table of Contents

Installation

npm install --save videojs-persist-controls

Usage

To include videojs-persist-controls on your website or web application, use any of the following methods.

<script> Tag

This is the simplest case. Get the script in whatever way you prefer and include the plugin after you include video.js, so that the videojs global is available.

<script src="//path/to/video.min.js"></script>
<script src="//path/to/videojs-persist-controls.min.js"></script>
<script>
  var player = videojs('my-video');

  player.persistControls();
</script>

Browserify/CommonJS

When using with Browserify, install videojs-persist-controls via npm and require the plugin as you would any other module.

var videojs = require('video.js');

// The actual plugin function is exported by this module, but it is also
// attached to the `Player.prototype`; so, there is no need to assign it
// to a variable.
require('videojs-persist-controls');

var player = videojs('my-video');

player.persistControls();

RequireJS/AMD

When using with RequireJS (or another AMD library), get the script in whatever way you prefer and require the plugin as you normally would:

require(['video.js', 'videojs-persist-controls'], function(videojs) {
  var player = videojs('my-video');

  player.persistControls();
});

License

MIT. Copyright (c) Maheshoo7 <gmahes00@gmail.com>

Readme

Keywords

Package Sidebar

Install

npm i videojs-persist-controls

Weekly Downloads

26

Version

0.0.5-spec

License

MIT

Unpacked Size

37.3 kB

Total Files

13

Last publish

Collaborators

  • maheshoo7