From f4ddea4a1455c75c30a4afbac24b3033fbd98abc Mon Sep 17 00:00:00 2001 From: thomas morgan Date: Tue, 2 Apr 2019 11:57:17 -0600 Subject: [PATCH] Fix: videojs.getComponent is not a function aka videojs is not defined Adds import video.js into each component, which eliminates the following error when using video-http-source-selector with webpack: ``` videojs-http-source-selector.es.js:36 Uncaught TypeError: videojs.getComponent is not a function at Module. (videojs-http-source-selector.es.js:36) at Module../node_modules/videojs-http-source-selector/dist/videojs-http-source-selector.es.js (videojs-http-source-selector.es.js:264) ``` This change also resolves compiled output in dist/ mixing up use of `videojs` and `videojs$1`. --- src/components/SourceMenuButton.js | 1 + src/components/SourceMenuItem.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/SourceMenuButton.js b/src/components/SourceMenuButton.js index 7bfadbd..f557c11 100644 --- a/src/components/SourceMenuButton.js +++ b/src/components/SourceMenuButton.js @@ -1,3 +1,4 @@ +import videojs from 'video.js'; import SourceMenuItem from './SourceMenuItem'; const MenuButton = videojs.getComponent('MenuButton'); diff --git a/src/components/SourceMenuItem.js b/src/components/SourceMenuItem.js index daf0fb1..ead8716 100644 --- a/src/components/SourceMenuItem.js +++ b/src/components/SourceMenuItem.js @@ -1,3 +1,4 @@ +import videojs from 'video.js'; const MenuItem = videojs.getComponent('MenuItem'); class SourceMenuItem extends MenuItem