Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 17aae9e

Browse files
committed
Fix references to new property values
1 parent b051444 commit 17aae9e

1 file changed

Lines changed: 29 additions & 30 deletions

File tree

README.md

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,54 @@
11
# React HLS Player V1
2+
23
![NPM Downloads](https://img.shields.io/npm/dm/react-hls-player?style=flat-square)
34
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)
5+
![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/react-hls-player)
6+
![npm bundle size](https://img.shields.io/bundlephobia/min/react-hls-player)
47

5-
## Pre-Intro
8+
## Overview
69

7-
This is the official release of React HLS Player V1. I originally forked this project so I could fix some underlying issues that I was running in to and the original project was no longer being maintained. Since then, this project has seen a gradual increase of usage, and I've decided on maintaining and improving it for the long term. This V1 release is a rewrite of the original, includes Typescript definitions to take advantage of VSCode's intellisense, and has completely migrated to Webpack from Parcel.
10+
V2 is now out and includes better TypeScript support. I had to make a large jump from the previous V1 as this new version included a couple small breaking changes, primarily to the way props are named. One big difference, is that the component now accepts all video element props in the formatting you would expect them with (previously autoPlay was passed as autoplay, and various other props weren't being handled properly). We're also using `src` instead of `url` to provide the source to the underlying video player.
811

9-
This project will continue to be a work in progress, and I will always welcome PRs, issues, and recommendations. I'll continue to look for better ways of handling things, as well as look for ways to improve and add on to this module.
12+
As always, PRs, issues and recommendations are always welcome.
1013

1114
## Introduction
1215

13-
`react-hls-player` is a simple hls/rtmp live stream player.
16+
`react-hls-player` is a simple HLS live stream player.
1417
It uses [hls.js](https://github.com/video-dev/hls.js) to play your hls live stream if your browser supports `html 5 video` and `MediaSource Extension`.
1518

1619
## Examples
1720

1821
```javascript
19-
// General Usage
20-
<ReactHlsPlayer
21-
url='https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8'
22-
autoplay={false}
23-
controls={true}
24-
width={500}
25-
height={375}
26-
/>
27-
```
22+
import React from 'react';
23+
import ReactDOM from 'react-dom';
24+
import ReactHlsPlayer from 'react-hls-player';
2825

29-
```javascript
30-
// Responsive
31-
<ReactHlsPlayer
32-
url='https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8'
33-
autoplay={false}
26+
// General Usage
27+
ReactDOM.render(
28+
<ReactHlsPlayer
29+
src="https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8"
30+
autoPlay={false}
3431
controls={true}
3532
width="100%"
3633
height="auto"
37-
/>
34+
/>,
35+
document.getElementById('app')
36+
);
3837
```
38+
3939
## Props
4040

4141
All [video properties](https://www.w3schools.com/tags/att_video_poster.asp) are supported and passed down to the underlying video component
4242

43-
Prop | Description
44-
------------ | -------------
45-
style `Object` | React CSS properties
46-
className `String` | Custom classes
47-
url `String`, `required` | The hls url that you want to play
48-
autoplay `Boolean` | Autoplay when component is ready. Defaults to `false`
49-
controls `Boolean` | Whether or not to show the playback controls. Defaults to `false`
50-
width `Number` | Video width. Defaults to `100%`
51-
height `Number` | Video height. Defaults to `auto`
52-
hlsConfig `Object` | `hls.js` config, you can see all config [here](https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning)
53-
playerRef `React Ref` | Pass in your own ref to interact with the video player directly. This will override the default ref.
43+
| Prop | Description |
44+
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
45+
| src `String`, `required` | The hls url that you want to play |
46+
| autoPlay `Boolean` | Autoplay when component is ready. Defaults to `false` |
47+
| controls `Boolean` | Whether or not to show the playback controls. Defaults to `false` |
48+
| width `Number` | Video width. Defaults to `100%` |
49+
| height `Number` | Video height. Defaults to `auto` |
50+
| hlsConfig `Object` | `hls.js` config, you can see all config [here](https://github.com/video-dev/hls.js/blob/master/docs/API.md#fine-tuning) |
51+
| playerRef `React Ref` | Pass in your own ref to interact with the video player directly. This will override the default ref. |
5452

5553
### Additional Notes
5654

@@ -72,6 +70,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
7270

7371
<!-- markdownlint-enable -->
7472
<!-- prettier-ignore-end -->
73+
7574
<!-- ALL-CONTRIBUTORS-LIST:END -->
7675

7776
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

0 commit comments

Comments
 (0)