A Video.js plugin for displaying age limit icon over the video
npm install --save videojs-age-limit-icon
To include videojs-age-limit-icon on your website or web application, use any of the following methods.
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-age-limit-icon.min.js"></script>
<script>
var player = videojs('my-video');
player.ageLimitIcon({
limit: 18,
duration: 0
});
</script>
When using with Browserify, install videojs-age-limit-icon 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-age-limit-icon');
var player = videojs('my-video');
player.ageLimitIcon({
limit: 18,
duration: 0
});
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-age-limit-icon'], function(videojs) {
var player = videojs('my-video');
player.ageLimitIcon({
limit: 18,
duration: 0
});
});
MIT. Copyright (c) Sergey Gromkov <sgromkov@gmail.com>