# react-reddit-video

> A utility for React to convert Reddit HLS URLs into playable video components using Video.js

Latest version **1.0.0** (published 2023-09-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-reddit-video
pnpm add react-reddit-video
yarn add react-reddit-video
bun add react-reddit-video
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-09-08 |
| First published | 2023-09-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Scripton |
| Maintainers | scripton |
| Keywords | Reddit, HLS, video player, Video.js |

## Links

- npm: https://www.npmjs.com/package/react-reddit-video
- npm.io page: https://npm.io/package/react-reddit-video

## Dependencies (1)

- [video.js](https://npm.io/package/video.js.md) ^8.5.2

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-09-08

## README

# react-reddit-video

`react-reddit-video` is a React component that allows you to easily embed Reddit videos in your web application. It uses the Video.js player to provide a video playback experience. 
It does not require installation of ffmpeg, and solves the issue of adding a Reddit video with sound and playback into your react app.

## Installation

You can install the package using npm or yarn:
```bash
npm install react-reddit-video
```
Please ensure video.js is also installed
```bash
npm i video.js
```

## Usage
- Please note: it is assumed that you are using the reddit API to retrieve your post which includes a video, and therefore you should be able to retrieve the 'hls_url' field from the API response.
- Since the reddit API does not provide any direct mp4 url with audio to act as a source within a Video tag for instance, this component is able to retrieve and combine the video with audio from the hls_url, with the help of video.js

import the package
```javascript
import RedditVideo from "react-reddit-video";
```

add the RedditVideo component to your react-app
```HTML
    <div>
      <h1>Reddit Video Player Example</h1>
      <RedditVideo HLSurl="YOUR_REDDIT_VIDEO_URL" width="640px" height="360px" />
    </div>
```

---
_Source: https://npm.io/package/react-reddit-video · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
