yanwsh / videojs-panorama

a plugin for videojs run a full 360 degree panorama video.
http://yanwsh.github.io/videojs-panorama/
Other
483 stars 160 forks source link

Support for isomorphic & webpack configurations? #99

Open moshest opened 7 years ago

moshest commented 7 years ago

I'm trying to import the package videojs-panorama on isomorphic React.js configuration but it's failed do to usage of window on the code:

var Detector = {

   canvas: !!window.CanvasRenderingContext2D,

Seems like this package has no support for server-side compilation.

moshest commented 7 years ago

I manage to use this configuration:

const panorama = (typeof window !== 'undefined') 
  ? require('videojs-panorama') 
  : () => {};