A cross-device context menu UI for video.js players.
Note: This plugin depends on the videojs-contextmenu plugin, but that plugin is not included with it!
npm install --save videojs-contextmenu videojs-contextmenu-ui
The npm installation is preferred, but Bower works, too.
bower install --save videojs-contextmenu videojs-contextmenu-ui
The plugin is invoked as a method of a video.js
Once the plugin is invoked, a modal will appear with a list of links when the
vjs-contextmenu event is triggered on the
Options may be passed to the plugin in a plain object:
Required Type: Array
The plugin requires that
content be passed as an array. If it is not, an error will be thrown. The array should contain any number of objects which define a series of links that appear in the modal. These objects support the following properties:
href: Defines the value of the
hrefattribute of the generated link.
listener: A function which will be bound to the
clickevent of the generated link.
label: Text for the link.
To include videojs-contextmenu-ui 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.
When using with Browserify, install videojs-contextmenu-ui via npm and
require the plugin as you would any other module.
var videojs = ;;// 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.;var player = ;player;
When using with RequireJS (or another AMD library), get the script in whatever way you prefer and
require the plugin as you normally would:
Apache-2.0. Copyright (c) Brightcove, Inc.