souporserious / react-media-player

React audio and video player.

Home Page:https://souporserious.github.io/react-media-player/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Server side rendering support

MikeDevice opened this issue · comments

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.

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

commented

@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.