@@ -127,9 +161,8 @@ const videoJsOptions = {
return
```
-[options]: /docs/guides/options.md
-
+[options]: /docs/guides/options.md
## Using a React Component as a Video JS Component
@@ -178,7 +211,7 @@ class vjsEpisodeList extends vjsComponent {
player.ready(() => {
this.mount();
});
-
+
/* Remove React root when component is destroyed */
this.on("dispose", () => {
ReactDOM.unmountComponentAtNode(this.el())
From c1e93beb4baa2bbd96756622c9ef9bd126c5424a Mon Sep 17 00:00:00 2001
From: FredTsang <979738295@qq.com>
Date: Sat, 21 Aug 2021 09:55:36 +0800
Subject: [PATCH 2/2] docs(react): fix some nit
---
docs/guides/react.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/guides/react.md b/docs/guides/react.md
index 69423a55a1..627aa57319 100644
--- a/docs/guides/react.md
+++ b/docs/guides/react.md
@@ -16,7 +16,7 @@ export const VideoJS = ( props ) => {
const { options, onReady } = props;
React.useEffect(() => {
- // make sure VjsPlayer only initial once
+ // make sure Video.js player is only initialized once
if (!playerRef.current) {
const videoElement = videoRef.current;
if (!videoElement) return;
@@ -33,7 +33,7 @@ export const VideoJS = ( props ) => {
}
}, [options]);
- // Dispose VjsPlayer when functional component actually unmount
+ // Dispose the Video.js player when the functional component unmounts
React.useEffect(() => {
return () => {
if (playerRef.current) {
@@ -76,7 +76,7 @@ const App = () => {
const handlePlayerReady = (player) => {
playerRef.current = player;
- // you can handle player's events here
+ // you can handle player events here
player.on('waiting', () => {
console.log('player is waiting');
});
@@ -87,7 +87,7 @@ const App = () => {
};
// const changePlayerOptions = () => {
- // // you can update player through VjsPlayer instance
+ // // you can update the player through the Video.js player instance
// if (!playerRef.current) {
// return;
// }