souporserious / react-media-player

React audio and video player.
https://souporserious.github.io/react-media-player/
ISC License
470 stars 100 forks source link

Server side rendering support #26

Closed MikeDevice closed 7 years ago

MikeDevice commented 7 years ago

Now I'm getting a ReferenceError: document is not defined in several files. One of them is request-fullscreen.js I can't even build project, bacause of this error.

souporserious commented 7 years ago

Sorry about that, I'm not too familiar with SSR environments. Any ideas on how to handle it? PR's are welcome :)

oyeanuj commented 7 years ago

@souporserious @MikeDevice Typically, these issues go away by just checking that window and document object are not undefined. In this library, I imagine in the fullscreen utils where the listeners are added, and any other place where window and document are being used need a check before those objects are used.