react-hls is a simple hls/rtmp live stream player.
It will use hls.js to play your hls live stream if your browser support html 5 video and MediaSource Extension. Otherwise it will downgrade to Flash play your rtmp live stream.
- Start the project
- Write base component structor
- Support Hls live stream playing ability
- Support Rtmp/Flv live stream
- downgrad solution
- bugs & Optimization :)
import ReactHLS from 'react-hls';
// In your render function
<ReactHLS url={"your hls http url"} />-
url
Stringrequiredthe hls url that you want to play
-
autoplay
Booleanautoplay when component is ready default to
false -
constrols
Booleanwhether or not showing the playback controls default to
false -
width
Numbervideo width
-
height
Numbervideo height
-
hlsConfig
Objecthls.jsconfig , you can see all config here -
videoProps
ObjectAll video tag attributes supported. You can check all attributes here