Skip to content

Commit

Permalink
Merge branch 'issue/32-remove-css-import' into dev
Browse files Browse the repository at this point in the history
Closes #32
  • Loading branch information
cadenzah committed Oct 7, 2020
2 parents 0dea5c4 + b66c4f4 commit 0d92595
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ yarn add react video.js
import React from 'react';
import videojs from 'video.js';
import VREPlayer from 'videojs-react-enhanced';
import 'video.js/dist/video-js.css';

function App() {
const playerOptions = {
Expand Down Expand Up @@ -85,12 +86,15 @@ export default App;

> NOTE: You should **import `video.js` first than `videojs-react-enhanced`** so that `videojs` object instantiated here is shared with `videojs-react-enhanced`.
> NOTE: You should import `video.js/dist/video-js.css` after you import `videojs-react-enhanced`, otherwise the default style of player UI will be all broken. If you are using [Next.js](https://github.com/vercel/next.js) for your service, you can remove the statement importing CSS style as that is a global CSS style. See [this issue](https://github.com/cadenzah/videojs-react-enhanced/issues/32) for better understanding.
### Typescript Usage

```tsx
import React from 'react';
import videojs from 'video.js';
import VREPlayer from 'videojs-react-enhanced';
import 'video.js/dist/video-js.css';

function App(): JSX.Element {
const playerOptions: VREPlayer.IPlayerOptions = {
Expand Down
1 change: 0 additions & 1 deletion lib/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
generatePlayerOptions,
initializePlayer,
} from './utils/index';
import 'video.js/dist/video-js.css';

function Player(props: Player.PlayerProps):JSX.Element {
let playerRef: React.RefObject<HTMLVideoElement> = useRef<HTMLVideoElement>(null);
Expand Down

0 comments on commit 0d92595

Please sign in to comment.