Skip to content

Commit

Permalink
Fix: videojs.getComponent is not a function
Browse files Browse the repository at this point in the history
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.<anonymous> (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`.
  • Loading branch information
zarqman committed Apr 2, 2019
1 parent 31b750a commit f4ddea4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/SourceMenuButton.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import videojs from 'video.js';
import SourceMenuItem from './SourceMenuItem';

const MenuButton = videojs.getComponent('MenuButton');
Expand Down
1 change: 1 addition & 0 deletions src/components/SourceMenuItem.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import videojs from 'video.js';
const MenuItem = videojs.getComponent('MenuItem');

class SourceMenuItem extends MenuItem
Expand Down

0 comments on commit f4ddea4

Please sign in to comment.