npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

videojs-contextmenu-ui

v7.0.0

Published

A cross-device context menu UI for video.js players.

Downloads

937

Maintainers

sachin-brightcovesachin-brightcovealexey.kremsaalexey.kremsamelinda.darvasimelinda.darvasijose.luis.sanchezjose.luis.sanchezpedro-cruzpedro-cruzgabor.kiacz.brightcovegabor.kiacz.brightcoveadambertalanbcadambertalanbcmiklospocsaji_bcmiklospocsaji_bcmaraizamaraizaskarukamannaskarukamannaaviel_resnickaviel_resnicknorma.gonzaleznorma.gonzalezjvaldez1jvaldez1fsalazarbcfsalazarbccognatusbgscognatusbgsmbalasubramaniammbalasubramaniamssahssahdgonzalez89dgonzalez89areis10areis10vmnavarrovmnavarroalfredo-reyesalfredo-reyesjterranovajterranovajfloresbcjfloresbcmlopez.bmlopez.bttabrilla-bcttabrilla-bcmsivallsmsivallssstevanussstevanusrwbarber2rwbarber2rwingerrwingerbcc-bfranklinbcc-bfranklinapenigalapatiapenigalapatilmaultsbylmaultsbysravan.pbrsravan.pbrijunaidfijunaidfmgoncalvesmgoncalvesmfregozomfregozoareveloarevelomadhu_gmadhu_ghugocjimhugocjimdaniel_camposdaniel_camposkevin.schickkevin.schickm.morrisonm.morrisonuomaruomarabarstowbcabarstowbcsbarathansbarathankpandiyarajankpandiyarajanimoronesimoroneswalterseymourbcwalterseymourbcddashkevichddashkevichalbertogomezalbertogomezgestrada-brgestrada-bramillerbrightcoveamillerbrightcovelvohralvohramcho-bcmcho-bcawaldronawaldrondawnpackodawnpackoldominguezldominguezbc-srimron-soutterbc-srimron-soutterrsilva_brightcoversilva_brightcovejoeyleshjoeyleshlmelchorx1lmelchorx1juan-sanchezjuan-sanchezeolveraeolveracloewer_bccloewer_bccarredondocarredondobrianhsubrianhsuniklagbrightcoveniklagbrightcovetsraveling_bctsraveling_bcbcbcliffordbcbcliffordbc-acgarciabc-acgarciaadavila1adavila1kreynoldskreynoldsbgs-devopsbgs-devopsalbinjohnsonalbinjohnsonrtezerartezerabcmneilbcmneilrandresfrandresfv.kozlov_bcv.kozlov_bcnagendra_mnagendra_mmichaelmccarthybcmichaelmccarthybcponeill-bcovponeill-bcovmdeltorobcovmdeltorobcovjmohneycovejmohneycoveinbc01inbc01aperezbrightcoveaperezbrightcoveireyes94ireyes94brightcove-adminbrightcove-admintedktedkabradley-brightcoveabradley-brightcovebc-alivebc-alivelasanchezclasanchezcmarguinbcmarguinbcbrightcove-userbrightcove-userkmasonkmasoncbarstowcbarstowhikehhikehmyerramallamyerramallapdiaspdiasjwhisenantjwhisenantebertaudebertauddsalnikovdsalnikovsharanya.muruganandamsharanya.muruganandamxgarcia_npmxgarcia_npmjguerrajguerrarjunerjunejonbwalshjonbwalshkhaiphamkhaiphamwswanbeckwswanbeckgastafurovgastafurovadalwaniadalwaniekelson-bcoveekelson-bcovesysengsysengmcarreiromcarreirohwoodburyhwoodburyjblakerjblakerbcmauleonbcmauleonpaco_oblea_bcpaco_oblea_bcjsepulvedajsepulvedabiswaranjanbiswaranjanbarroyobarroyobmartinezbmartinezbc-jcarlsonbc-jcarlsoneledezmaeledezmajcuetojcuetoerodrigueserodriguespsousapsousamarcogaraymarcogarayjavibrightjavibrightbcpsalasbcpsalasetobinetobinackbabeackbabecvillasenorcvillasenoromartinezomartinezmgonzalez_bcmgonzalez_bcpdohertybcovpdohertybcovmuthukumar.bcmuthukumar.bcbzizmondbzizmondjmpmacedojmpmacedoscorreiascorreialescorciolescorciocavieiracavieiraarunjeyaprasadarunjeyaprasadbvilvanathanbvilvanathananand.gangadharananand.gangadharanrociosantosrociosantosagarciabcovagarciabcovattinderattinderlauralopezlauralopezskumar85skumar85hrodriguez2hrodriguez2jasilvaantoniojasilvaantoniopalvarezbcpalvarezbcericramosericramoscarlosabajocarlosabajoingrid.s.cruzingrid.s.cruzluis_fernando_lopez_ruizluis_fernando_lopez_ruizvishal64vishal64tresa.bajitresa.bajiluis.garcia.brightcoveluis.garcia.brightcoverodrigofdzrodrigofdzpgutierrezgilpgutierrezgilharish17harish17jjeyaprakashjjeyaprakashrrajendran1698rrajendran1698jlomelijlomelisjimenezsjimenezrwenger_brightcoverwenger_brightcoverujordanrujordanstuartmhstuartmhjherrerabcovjherrerabcovmshiwalmshiwalptamizhptamizhakamalakkannanakamalakkannanroman-bcroman-bctnwannatnwannabsahlas.npmbsahlas.npmdherrera1109dherrera1109hswaminathanhswaminathanechengbcechengbcsbarrettbcsbarrettbcmisteroneillmisteroneillgkatsevgkatsevbrandonocaseybrandonocaseyabarstowabarstow

Readme

videojs-contextmenu-ui

Build Status Greenkeeper badge Slack Status

NPM

A cross-device context menu UI for video.js players.

Note: Versions 4.x and lower of this plugin depended on the videojs-contextmenu plugin, but that plugin is not included with it. It must be included separately.

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.

Maintenance Status: Stable

Installation

npm install --save videojs-contextmenu-ui

Usage

The plugin is invoked as a method of a video.js Player object:

player.contextmenuUI();

Once the plugin is invoked, a modal will appear with a list of links when the contextmenu event is triggered on the Player object.

Options

Options may be passed to the plugin in a plain object:

player.contextmenuUI({
  content: [{

    // A plain old link.
    href: 'https://www.brightcove.com/',
    label: 'Brightcove'
  }, {

    // A link with a listener. Its `href` will automatically be `#`.
    label: 'Example Link',
    listener: function() {
      alert('you clicked the example link!');
    }
  }]
});

content

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 href attribute of the generated link.
  • listener: A function which will be bound to the click event of the generated link.
  • label: Text for the link.

keepInside

Type: Boolean

If 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.

excludeElements

Type: Function Parameters: The DOM element that is being targeted Returns: Boolean | Returns true if the targeted element should be excluded from displaying context menu

Defines which elements should be excluded from displaying the context menu. input and textarea elements are excluded by the default function.

player.contextmenuUI({
  ...
  excludeElements: (targetEl) => {
    const tagName = targetEl.tagName.toLowerCase();

    return tagName === 'input';
  }
});

Inclusion

To include videojs-contextmenu-ui 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-contextmenu-ui.min.js"></script>
<script>
  var player = videojs('my-video');

  player.contextmenuUI();
</script>

CommonJS/Browserify

When using with Browserify, install videojs-contextmenu-ui 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-contextmenu-ui');

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

player.contextmenuUI();

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-contextmenu-ui'], function(videojs) {
  var player = videojs('my-video');

  player.contextmenuUI();
});

License

Apache-2.0. Copyright (c) Brightcove, Inc.