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

No type check on document for full screen

ianrichard opened this issue · comments

Webpack server won't start when using request-fullscreen and exit-fullscreen because it refers to document, which doesn't exist without a browser.

return document.documentElement[curr] ? curr : prev;
           ^
ReferenceError: document is not defined

Fix:

Wrap return with

if (typeof document !== 'undefined') {
...
}

Great library BTW! Nice functionality and I love how decoupled it is.

I have changed it, but still I am getting the same error.

This should be fixed with PR #40. We should, probably, close this issue :)