{"_id":"@at14/videojs-contextmenu-pt","name":"@at14/videojs-contextmenu-pt","dist-tags":{"latest":"5.5.0"},"versions":{"5.5.0":{"name":"@at14/videojs-contextmenu-pt","version":"5.5.0","description":"A cross-device context menu UI for video.js players.","main":"dist/videojs-contextmenu-pt.cjs.js","keywords":["videojs","videojs-plugin","peertube"],"repository":{"type":"git","url":"git+https://github.com/rigelk/videojs-contextmenu-pt.git"},"author":{"name":"Brightcove, Inc."},"license":"Apache-2.0","module":"dist/videojs-contextmenu-pt.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-pt.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"},"vjsstandard":{"jsdoc":false,"ignore":["dist","docs","test/dist"]},"dependencies":{"global":"^4.4.0","video.js":"^7.6.0"},"devDependencies":{"conventional-changelog-cli":"^2.0.23","conventional-changelog-videojs":"^3.0.0","doctoc":"^1.4.0","husky":"^1.3.1","karma":"^4.3.0","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":"^0.67.4","shx":"^0.3.2","sinon":"^6.3.5","videojs-contextmenu":"^2.0.2","videojs-generate-karma-config":"^5.3.1","videojs-generate-postcss-config":"~2.0.1","videojs-generate-rollup-config":"^2.3.2","videojs-generator-verify":"^1.2.0","videojs-standard":"^8.0.4"},"browserslist":["defaults","ie 11"],"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-pt@5.5.0","gitHead":"c163da03502809fdb29db0022470116ab169b9c8","bugs":{"url":"https://github.com/rigelk/videojs-contextmenu-pt/issues"},"homepage":"https://github.com/rigelk/videojs-contextmenu-pt#readme","_nodeVersion":"22.0.0","_npmVersion":"10.5.1","dist":{"integrity":"sha512-qdd4+3PLcWeGPaw+I6Ph8zCSTQfCm+R1Ls6bCIcliFNUq16VD0YNJoRL3nly0rce8JRI/D2KK5tHJ6NXTOcfGQ==","shasum":"10d2ee6133a61df3f3bd4dcfc392db8027839656","tarball":"https://registry.npmjs.org/@at14/videojs-contextmenu-pt/-/videojs-contextmenu-pt-5.5.0.tgz","fileCount":20,"unpackedSize":128478,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHFcF9GUgzxOfsQHI+WrI0EW1gETEM00HiHWHocB2NSIAiEApKaHVeHoz5JyQr3vVupfZvrrWFJH10SMr6tkLJBCR0I="}]},"_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-pt_5.5.0_1757609094457_0.4481134332130332"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-11T16:44:54.391Z","5.5.0":"2025-09-11T16:44:54.688Z","modified":"2025-09-11T16:44:54.978Z"},"maintainers":[{"name":"at14","email":"ankitlal.mail@gmail.com"}],"description":"A cross-device context menu UI for video.js players.","homepage":"https://github.com/rigelk/videojs-contextmenu-pt#readme","keywords":["videojs","videojs-plugin","peertube"],"repository":{"type":"git","url":"git+https://github.com/rigelk/videojs-contextmenu-pt.git"},"author":{"name":"Brightcove, Inc."},"bugs":{"url":"https://github.com/rigelk/videojs-contextmenu-pt/issues"},"license":"Apache-2.0","readme":"# videojs-contextmenu-pt\n\nA cross-device context menu UI for video.js players. Forked from `videojs-contextmenu-ui` to add support for features needed in PeerTube's development, hence the suffix.\n\nFeatures added:\n- support for content as a function, allowing dynamic menus evaluated on `oncontextmenu` event\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-pt\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-pt 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-pt.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-pt 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-pt');\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-pt'], 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[contextmenu]: https://github.com/brightcove/videojs-contextmenu\n[videojs]: http://videojs.com/\n","readmeFilename":"README.md","_rev":"1-0a25ef9e569aa0eb4bd6d434bed52b43"}