cookpete / react-player

A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion
https://cookpete.github.io/react-player
MIT License
8.94k stars 1.12k forks source link

m3u8 trouble with playing #298

Closed Muskos closed 6 years ago

Muskos commented 6 years ago

I try to use your player. I inserted in your demo ( here: http://cookpete.com/react-player/ ) url with my m3u8 audio track. m3u8 file was created by wowza (as you ccan see on screen).

screenshot from 2017-12-24 01-10-51

It didn't play. And there is no any error messages. Can you help with debug this problem?

cookpete commented 6 years ago

ReactPlayer just uses hls.js when playing m3u8 files. Does your m3u8 file work on the hls.js demo page?

Muskos commented 6 years ago

I got CORS error on this page. cannot Load http://***/msx/_definst_/mp3:audio/b1/a6/50/b1a650491c4aae6eab7eada7562d31c6.mp3/playlist.m3u8 HTTP response code:0 this might be a CORS issue, consider installing Allow-Control-Allow-Origin Chrome Extension,network error ...

Now, i am trying remove CORS error.

Can you help me? In your example, you use m3u8 file from(by) https protocol. Why?

Muskos commented 6 years ago

You can try. https://stream.musix.ru/msx/_definst_/mp3:audio/b1/a6/50/b1a650491c4aae6eab7eada7562d31c6.mp3/playlist.m3u8 This url work in hls.js and doesn't work in react-player.

cookpete commented 6 years ago

@Muskos Do you have another stream I can use to test? I started to debug what was going on last week but the stream is now not available.

arj-ary commented 6 years ago

Hi @CookPete , i am trying to play a m3u8 file, gives me a " Hls is not a contructor " error. It worked fine when i loaded the url on the demo page. The video file url is -

https://content.uplynk.com/980ef33fdc594e86aba425f2eee31fb3.m3u8

Please let me know if it is possible to play m3u8 files.

Thanks.

cookpete commented 6 years ago

@arj-ary Hls is not a contructor implies that the loading of hls.js was not successful before trying to instantiate a player. Do you get any errors from the network request for https://cdn.jsdelivr.net/hls.js/latest/hls.min.js?

arj-ary commented 6 years ago

@CookPete nope, no errors when i hit the cdn directly. Also i am using the react player on a MAC/Chrome. Is that an issue? In a recent commit to FilePlayer.js i noticed there is a change to not load the Hls.js for apple devices?

_this2.hls = new Hls(); gets executed even before the promise to load the cdn file is resolved?

cookpete commented 6 years ago

Also i am using the react player on a MAC/Chrome. Is that an issue?

It shouldn't be. It works fine for me using Chrome on a Macbook.

In a recent commit to FilePlayer.js i noticed there is a change to not load the Hls.js for apple devices?

I think this is unrelated. If you are getting an error regarding Hls then you are getting to this line which is erroring:

https://github.com/CookPete/react-player/blob/a3273806ff9ed2b47157db365224628bbd827b5b/src/players/FilePlayer.js#L92

arj-ary commented 6 years ago

@CookPete that line is exactly where it is erroring. I have react-player v 1.1.1 is that the right version?

Muskos commented 6 years ago

@CookPete sorry, we stoped our wowza server for a month or two. Can I write you later?

cookpete commented 6 years ago

@arj-ary I'm afraid I can't be much more help unless you have an example page/repo/jsfiddle where the error is occurring? 1.1.1 is the right version, and if it works on the demo page then it must be something specific to your implementation.

sorry, we stoped our wowza server for a month or two. Can I write you later?

@Muskos Sure!

cookpete commented 6 years ago

The version of hls.js used was bumped in version 1.1.2 so hopefully this resolves any problems with m3u8 files. If there is still a stream that works in the hls.js demo page but not in ReactPlayer, then feel free to reopen this issue (or create a new one).

case-dubs commented 3 years ago

@CookPete I've run into the same problem. I'm able to play videos on Safari, but not on Chrome. When I try to play videos on Chrome, I get a CORS error, as well as this error: "[error] > 0 while loading" I'd really appreciate any insight you have on this issue.

JustRedTTG commented 8 months ago

I am not getting any errors, no sound or video, the part list is loaded part 0 of m3u8 is loaded, the length is defined, black screen, nothing, in vlc it totally loads and plays normally