Play button doesn't work with video.js 6.2.0 and webpack
Description
Playing the recorded video doesn't work with video.js ~~6.0.0~~ ~6.2.0 When you record a video and then press the play button noting happens.
Steps to reproduce
Install video.js ~6.2.0
Results
Expected
Should play the video.
Error output
Uncaught TypeError: videojs.getComponent is not a function
Additional Information
versions
videojs
what version of videojs does this occur with? video.js 6.2.0 videojs-record 1.6.1
browsers
what browser are affected? Tested in Firefox and Chrome
OSes
what platforms (operating systems and devices) are affected? Linux
Confirmed it's an issue (tested with videojs 6.1.0). Also looks like CSS is screwed:

It works in Firefox (53) now but not in Chrome (60), closed this too soon (only worked around css issues).
@alsar can you confirm it's working now with the latest master and video.js 6.2.0 or newer?
@thijstriemstra With 6.2.0 i get an Uncaught TypeError: videojs.getComponent is not a functionerror.
With 6.1.0 it works now in both Firefox and Chrome.
@alsar really, it works with 6.1.0 but not with 6.2.0?
Yes, is looks that way.
what os/version of firefox/chrome? I can't reproduce that..
Linux with Firefox 54 and Chromium 58. Maybe it's an Webpack problem. I'll investigate in the next days and get back to you.
Getting same issue with
"video.js": "^6.1.0",
"videojs-record": "^1.6.2"
TypeError: videojs.getComponent is not a function
Just tested, it works if I use video.js like: "video.js": "6.1.0",
What line does this error occur on? Can someone post a screenshot or stacktrace? (with unminified versions)
This fix in a different plugin could be related: https://github.com/videojs/videojs-youtube/commit/ad7275caf4b9d102354fbceda86ab9f20e216ee8#diff-41489607c076711cf7440b328fb7a065R37.
Also tested on OSX with Chrome 60.0.3112.40, still cannot reproduce.
@thijstriemstra I could get down to the root of the problem.
The problem is the combination of ES6 exports export default videojs and requirejs imports require('video.js)
video.js switched from module.exports = videojs in 6.1.0 to export default videojs in 6.2.0
And while videojs-record still uses require('video.js) and if you use ES6 stops working.
https://github.com/videojs/video.js/blob/v6.1.0/src/js/video.js#L727 https://github.com/videojs/video.js/blob/v6.2.0/src/js/video.js#L726
So the fix to this is as I understand it to switch to ES6 imports or to change the require to require('video.js).default
But I'm not really an expert regarding this subject.
Explanations of this problem: https://github.com/videojs/video.js/issues/2698#issuecomment-148151327 https://medium.com/@kentcdodds/misunderstanding-es6-modules-upgrading-babel-tears-and-a-solution-ad2d5ab93ce0
Thanks for the research @alsar! There's also a webpack guide now but that doesn't mention anything related: https://github.com/videojs/video.js/blob/master/docs/guides/webpack.md
Hmm, @gkatsev should we use require('video.js).default as suggested in order to support both versions of video.js?
@alsar I assume you (will) have the same issue with https://github.com/collab-project/videojs-wavesurfer when recording audio-only?
Hm... when making the changes in 6.2.0 I tested to make sure that it works without requiring es6: https://github.com/videojs/videojs-bundler-sample Maybe the issue is that this is a separate project that requires videojs and not an end-user which is what the bundler-sample project is?
Though, thinking about it some more, what version of webpack is used? We're outputting both CJS and ESM outputs and specify a main and a module property in the config. If webpack 2 is used, it probably tries to load the ESM module and things break.
Maybe the issue is that this is a separate project that requires videojs and not an end-user which is what the bundler-sample project is?
This sounds confusing to me, can you elaborate?
If webpack 2 is used, it probably tries to load the ESM module and things break.
@alsar what version are you using?
A new release of this plugin (in short term) would pin video.js to anything < 6.2.0.