Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/holoarchivists/react-srv3

React component to render YouTube SRV3 closed captions
https://github.com/holoarchivists/react-srv3

captions react youtube

Last synced: 14 days ago
JSON representation

React component to render YouTube SRV3 closed captions

Awesome Lists containing this project

README

        

# react-srv3

> React component to render YouTube SRV3 closed captions

[![NPM](https://img.shields.io/npm/v/react-srv3.svg)](https://www.npmjs.com/package/react-srv3)

[View demo](https://react-srv3.vercel.app/)

## Install

```bash
yarn add react-srv3
```

## Usage

```tsx
import { CaptionsRenderer } from 'react-srv3';

```

### Example

```tsx
import React from 'react';
import { CaptionsRenderer } from 'react-srv3';

const VideoPlayer = () => {
const [currentTime, setCurrentTime] = React.useState(0);
const [captionsText, setCaptionsText] = React.useState('');

React.useEffect(() => {
fetch('')
.then(res => res.text())
.then(setCaptionsText)
}, []);

return (


setCurrentTime(e.target.currentTime)}
/>


)
}
```

## License

MIT © [hizkifw](https://github.com/hizkifw)