Open eduardoarandah opened 5 years ago
I'm trying to use videojs with yarn, es6 and all the modern tools.
videojs works fine, but videojs-background doesn't
This code gives me error "TypeError: videojs is undefined"
import videojs from "video.js" import "videojs-background/lib/videojs-Background.js" export default { init() { videojs("bg-video").Background(); }, };
I read the code and it seems that videojs-Background depends on window.videojs to exist. But in this example, videojs is a local variable.
I tried to apply the variable to window with no success:
import videojs from "video.js"; import "videojs-background/lib/videojs-Background.js"; export default { init() { window.videojs = videojs; window.videojs("bg-video").Background(); }, };
how to make it work?
I'm trying to use videojs with yarn, es6 and all the modern tools.
videojs works fine, but videojs-background doesn't
This code gives me error "TypeError: videojs is undefined"
I read the code and it seems that videojs-Background depends on window.videojs to exist. But in this example, videojs is a local variable.
I tried to apply the variable to window with no success:
how to make it work?