{"_id":"@at14/videojs-contextmenu-ui","name":"@at14/videojs-contextmenu-ui","dist-tags":{"latest":"7.0.0"},"versions":{"7.0.0":{"name":"@at14/videojs-contextmenu-ui","version":"7.0.0","description":"A cross-device context menu UI for video.js players.","main":"dist/videojs-contextmenu-ui.cjs.js","keywords":["videojs","videojs-plugin"],"author":{"name":"Brightcove, Inc."},"license":"Apache-2.0","module":"dist/videojs-contextmenu-ui.es.js","generator-videojs-plugin":{"version":"7.3.2"},"scripts":{"prebuild":"npm run clean","build":"npm-run-all -p build:*","build:css":"postcss -o dist/videojs-contextmenu-ui.css --config scripts/postcss.config.js src/plugin.css","build:js":"rollup -c scripts/rollup.config.js","clean":"shx rm -rf ./dist ./test/dist","postclean":"shx mkdir -p ./dist ./test/dist","docs":"npm-run-all docs:*","docs:toc":"doctoc README.md","lint":"vjsstandard","server":"karma start scripts/karma.conf.js --singleRun=false --auto-watch","start":"npm-run-all -p server watch","pretest":"npm-run-all lint build","test":"karma start scripts/karma.conf.js","update-changelog":"conventional-changelog -p videojs -i CHANGELOG.md -s","preversion":"npm test","version":"is-prerelease || npm run update-changelog && git add CHANGELOG.md","watch":"npm-run-all -p watch:*","watch:css":"npm run build:css -- -w","watch:js":"npm run build:js -- -w","posttest":"shx cat test/dist/coverage/text.txt","prepublishOnly":"npm run build && vjsverify --skip-es-check"},"vjsstandard":{"jsdoc":false,"ignore":["dist","docs","test/dist"]},"dependencies":{"global":"^4.4.0","video.js":"^8.0.0"},"devDependencies":{"conventional-changelog-cli":"^2.1.1","conventional-changelog-videojs":"^3.0.2","doctoc":"^1.4.0","husky":"^1.3.1","karma":"^4.4.1","lint-staged":"^8.2.1","not-prerelease":"^1.0.1","npm-merge-driver-install":"^1.1.1","npm-run-all":"^4.1.5","pkg-ok":"^2.3.1","postcss-cli":"^6.1.3","rollup":"^2.61.1","shx":"^0.3.3","sinon":"^6.3.5","videojs-contextmenu":"^2.0.2","videojs-generate-karma-config":"^8.0.1","videojs-generate-postcss-config":"~2.0.1","videojs-generate-rollup-config":"^7.0.0","videojs-generator-verify":"^4.0.1","videojs-standard":"^9.0.1"},"lint-staged":{"*.js":["vjsstandard --fix","git add"],"README.md":["npm run docs:toc","git add"]},"husky":{"hooks":{"pre-commit":"lint-staged"}},"publishConfig":{"access":"public"},"_id":"@at14/videojs-contextmenu-ui@7.0.0","gitHead":"1925cae888bdb8a3a8c49704c5a5f10bc313b14f","_nodeVersion":"22.0.0","_npmVersion":"10.5.1","dist":{"integrity":"sha512-eaOPA6Mgq14JqUT1pTVNNLuxg0TChTAnmF8KgtJA4mzcCOhT5BUL7zKCl3X33T0LPl6PFpZWyu3YkEs3a2LwsQ==","shasum":"8fa44fb3478246ca37a3483b1c4bd4ebc67d7e36","tarball":"https://registry.npmjs.org/@at14/videojs-contextmenu-ui/-/videojs-contextmenu-ui-7.0.0.tgz","fileCount":20,"unpackedSize":125434,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCeKfX+qG1L2cWKaGNI4vV2RoldBHooHmq7iuK9TaBp7gIhAL1w81GG6OVKlI0DvkyEWBQ4G1tnMQEyIM62v9dvvzgf"}]},"_npmUser":{"name":"at14","email":"ankitlal.mail@gmail.com"},"directories":{},"maintainers":[{"name":"at14","email":"ankitlal.mail@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/videojs-contextmenu-ui_7.0.0_1757663508482_0.5786789045432823"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-12T07:51:48.381Z","7.0.0":"2025-09-12T07:51:48.649Z","modified":"2025-09-12T07:51:48.994Z"},"maintainers":[{"name":"at14","email":"ankitlal.mail@gmail.com"}],"description":"A cross-device context menu UI for video.js players.","keywords":["videojs","videojs-plugin"],"author":{"name":"Brightcove, Inc."},"license":"Apache-2.0","readme":"# videojs-contextmenu-ui\n\n[![Build Status](https://travis-ci.org/brightcove/videojs-contextmenu-ui.svg?branch=master)](https://travis-ci.org/brightcove/videojs-contextmenu-ui)\n[![Greenkeeper badge](https://badges.greenkeeper.io/brightcove/videojs-contextmenu-ui.svg)](https://greenkeeper.io/)\n[![Slack Status](http://slack.videojs.com/badge.svg)](http://slack.videojs.com)\n\n[![NPM](https://nodei.co/npm/videojs-contextmenu-ui.png?downloads=true&downloadRank=true)](https://nodei.co/npm/videojs-contextmenu-ui/)\n\nA cross-device context menu UI for video.js players.\n\n> **Note:** Versions 4.x and lower of this plugin depended on the [videojs-contextmenu][contextmenu] plugin, but that plugin is not included with it. It must be included separately.\n>\n> Versions 5.x and newer does not use the videojs-contextmenu plugin, so do not include it. Versions 5.x and newer rely on the native `contextmenu` event.\n\nMaintenance Status: Stable\n\n<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->\n\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Options](#options)\n  - [`content`](#content)\n  - [`keepInside`](#keepinside)\n  - [`excludeElements`](#excludeelements)\n- [Inclusion](#inclusion)\n  - [`<script>` Tag](#script-tag)\n  - [CommonJS/Browserify](#commonjsbrowserify)\n  - [RequireJS/AMD](#requirejsamd)\n- [License](#license)\n\n<!-- END doctoc generated TOC please keep comment here to allow auto update -->\n\n\n## Installation\n\n```sh\nnpm install --save videojs-contextmenu-ui\n```\n\n## Usage\n\nThe plugin is invoked as a method of a video.js `Player` object:\n\n```js\nplayer.contextmenuUI();\n```\n\nOnce the plugin is invoked, a modal will appear with a list of links when the `contextmenu` event is triggered on the `Player` object.\n\n## Options\n\nOptions may be passed to the plugin in a plain object:\n\n```js\nplayer.contextmenuUI({\n  content: [{\n\n    // A plain old link.\n    href: 'https://www.brightcove.com/',\n    label: 'Brightcove'\n  }, {\n\n    // A link with a listener. Its `href` will automatically be `#`.\n    label: 'Example Link',\n    listener: function() {\n      alert('you clicked the example link!');\n    }\n  }]\n});\n```\n\n### `content`\n\n**Required**\n**Type**: Array\n\nThe 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:\n\n- `href`: Defines the value of the `href` attribute of the generated link.\n- `listener`: A function which will be bound to the `click` event of the generated link.\n- `label`: Text for the link.\n\n### `keepInside`\n\n**Type**: Boolean\n\nIf `true` (default), the context menu will be kept within the bounds of the player. If `false`, it may extend outside. When set to `false`, the menu would still stay within the player if the menu would otherwise extend outside the document body, including fullscreen players and players in an iframe.\n\n### `excludeElements`\n\n**Type**: Function\n**Parameters**: The DOM element that is being targeted\n**Returns**: Boolean | Returns `true` if the targeted element should be excluded from displaying context menu\n\nDefines which elements should be excluded from displaying the context menu. `input` and `textarea` elements are excluded by the default function.\n\n```js\nplayer.contextmenuUI({\n  ...\n  excludeElements: (targetEl) => {\n    const tagName = targetEl.tagName.toLowerCase();\n\n    return tagName === 'input';\n  }\n});\n```\n\n## Inclusion\n\nTo include videojs-contextmenu-ui on your website or web application, use any of the following methods.\n\n### `<script>` Tag\n\nThis is the simplest case. Get the script in whatever way you prefer and include the plugin _after_ you include [video.js][videojs], so that the `videojs` global is available.\n\n```html\n<script src=\"//path/to/video.min.js\"></script>\n<script src=\"//path/to/videojs-contextmenu-ui.min.js\"></script>\n<script>\n  var player = videojs('my-video');\n\n  player.contextmenuUI();\n</script>\n```\n\n### CommonJS/Browserify\n\nWhen using with Browserify, install videojs-contextmenu-ui via npm and `require` the plugin as you would any other module.\n\n```js\nvar videojs = require('video.js');\n\n// The actual plugin function is exported by this module, but it is also\n// attached to the `Player.prototype`; so, there is no need to assign it\n// to a variable.\nrequire('videojs-contextmenu-ui');\n\nvar player = videojs('my-video');\n\nplayer.contextmenuUI();\n```\n\n### RequireJS/AMD\n\nWhen using with RequireJS (or another AMD library), get the script in whatever way you prefer and `require` the plugin as you normally would:\n\n```js\nrequire(['video.js', 'videojs-contextmenu-ui'], function(videojs) {\n  var player = videojs('my-video');\n\n  player.contextmenuUI();\n});\n```\n\n## License\n\nApache-2.0. Copyright (c) Brightcove, Inc.\n\n\n[contextmenu]: https://github.com/brightcove/videojs-contextmenu\n[videojs]: http://videojs.com/\n","readmeFilename":"README.md","_rev":"1-455727cb76f008b23f309ad21de2aeb8"}