Added disableContextMenu option to hide the right click context menu (fixes #248 and #225)

This commit is contained in:
Sam
2016-05-26 22:32:18 +01:00
parent 351e1540c5
commit c0909095e3
5 changed files with 46 additions and 31 deletions

View File

@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
// plyr.js v1.6.16
// plyr.js v1.6.17
// https://github.com/selz/plyr
// License: The MIT License (MIT)
// ==========================================================================
@ -44,10 +44,11 @@
displayDuration: true,
loadSprite: true,
iconPrefix: 'plyr',
iconUrl: 'https://cdn.plyr.io/1.6.16/plyr.svg',
iconUrl: 'https://cdn.plyr.io/1.6.17/plyr.svg',
clickToPlay: true,
hideControls: true,
showPosterOnEnd: false,
disableContextMenu: true,
tooltips: {
controls: false,
seek: true
@ -2933,6 +2934,11 @@
});
}
// Disable right click
if (config.disableContextMenu) {
_on(plyr.media, 'contextmenu', function(event) { event.preventDefault(); });
}
// Proxy events to container
_on(plyr.media, config.events.join(' '), function(event) {
_triggerEvent(plyr.container, event.type, true);