videojs-hotkeys
videojs-hotkeys copied to clipboard
Doesn't work with the latest video.js (export/import issue)
The issue seems to be quite simple; video.js changed how they expose their lib at some point (?) so the code
import videojs from 'video.js'; require('videojs-hotkeys');
would yield Uncaught TypeError: (e.registerPlugin || e.plugin) is not a function
;
It seems that this is because var registerPlugin = videojs.registerPlugin || videojs.plugin;
in videojs-hotkeys/videojs.hotkeys.js evaluates into undefined because videojs
object there has .default
property now that is supposed to be called instead.
A code like
var vjs = videojs.default || videojs;
var registerPlugin = vjs.registerPlugin || vjs.plugin;
would fix the issue but I'm not sure if It fixes the real problem instead of "symptoms"