mister-ben / videojs-flvjs

Video.js tech using flv.js for FLV playback
https://mister-ben.github.io/videojs-flvjs/
Other
127 stars 31 forks source link

do not work when using require() with webpack #8

Open hexray-newbee opened 6 years ago

hexray-newbee commented 6 years ago

VIDEOJS: ERROR: The "flvjs" tech is undefined. Skipped browser support check for that tech.

jdmoody commented 6 years ago

@hxl-dy, I was able to get around this issue by setting global videojs and flvjs properties in Webpack using ProvidePlugin:

new webpack.ProvidePlugin({
    'window.videojs': path.resolve('node_modules/video.js/dist/video'),
    'window.flvjs': path.resolve('node_modules/flv.js/dist/flv.js')
  })