jfujita / videojs-http-source-selector

VideoJS plugin that leverages videojs-contrib-quality-levels plugin to offer manual user-select able level selection options for adaptive http streams.
MIT License
62 stars 49 forks source link

Uncaught ReferenceError: videojs is not defined #1

Closed blumonn closed 5 years ago

blumonn commented 6 years ago

Hi,

after building the plugin and importing in my project, trying to run the project gives me the following error :

videojs-http-source-selector.es.js:57 Uncaught ReferenceError: videojs is not defined
at eval (videojs-http-source-selector.es.js:57)
at Module../node_modules/videojs-http-source-selector/dist/videojs-http-source-selector.es.js (bundle.js:704)
at __webpack_require__ (bundle.js:20)
at eval (index.js:6)
at Module../index.js (bundle.js:97)
at __webpack_require__ (bundle.js:20)
at bundle.js:84
at bundle.js:87

after some digging, seems like this is a problem related to this generator-videojs-plugin issue, which happened because of something funky with rollup.

How to resolve this? Any help is much appreciated.

bricesanchez commented 5 years ago

Hi @blumonn, I've the same error, did you find a solution?

bricesanchez commented 5 years ago

I think the dist is broken in ES : https://github.com/pivotshare/videojs-http-source-selector/blob/master/dist/videojs-http-source-selector.es.js#L1

Should it be videojs instead of videojs$1 ?

blumonn commented 5 years ago

@bricesanchez I imported videojs in the components and built the plugin again. that seemed to work for me.

molten-firescar96 commented 5 years ago

Until this is fixed via PR, I've been importing this library as

import videojs from 'video.js';
window.videojs = videojs;
require('videojs-http-source-selector');