https://github.com/murrayee/usevideostate
初始化视频状态
https://github.com/murrayee/usevideostate
Last synced: 7 months ago
JSON representation
初始化视频状态
- Host: GitHub
- URL: https://github.com/murrayee/usevideostate
- Owner: murrayee
- Created: 2020-04-28T00:54:18.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-07T04:00:58.000Z (about 2 years ago)
- Last Synced: 2025-01-26T19:07:46.002Z (over 1 year ago)
- Language: TypeScript
- Size: 64.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-hooks react-usevideostate
**react-usevideostate** 初始化 video 属性以及事件绑定
## Installation
```bash
# with NPM
npm install react-usevideostate --save-dev
# with Yarn
yarn add react-usevideostate
```
## Usage
```jsx
import useVideoState from "react-usevideostate";
const Example = () => {
const videoRef = useRef(null);
const videoState = useVideoState(videoRef);
useEffect(() => {
console.log(videoState);
}, [videoState]);
return (
);
};
```