mingxinstar / react-hls

simple react component for playing hls/rtmp live stream
44 stars 75 forks source link

how this component play rtmp stream? #4

Open x313253805 opened 6 years ago

x313253805 commented 6 years ago

I try to play rtmp stream in my project,this component is well with m3u8 stream.can this component support rtmp stream as well?

MCDELTAT commented 6 years ago

Yes it will. See the first paragraph of the README which says:

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.

xiaomengheiheihei commented 5 years ago

Can you give a simple example?

coder054 commented 5 years ago

Yes it will. See the first paragraph of the README which says:

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.

In the to do list of Readme, The work for RTMP is not check(not done)

MCDELTAT commented 5 years ago

@coder054 Really had to downvote something from a year ago huh? I might have tested this package and gotten it working but don't remember how. IMO I haven't recently looked for any packages that do all 3 (HLS, RTMP, MPEG-DASH) but your best bet is sticking with the video.js family of tech. Here's a gist of what I did 2 years ago to get it working:

https://gist.github.com/MCDELTAT/91829acd6752815dc4e88c9c0120a315

Basically, I have a component for HLS streaming, one regular video.js Component for RTMP, and then a Component that can destroy one player and create the other.

Again that was 2.5 years ago and a lot has changed so dunno.