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.89k stars 1.12k forks source link

Provide error levels and more error info to onError callback #1771

Closed tpettrov closed 3 weeks ago

tpettrov commented 1 month ago

Current Behavior

These two warnings:

[warn] > Playback stalling at @2402.355654 due to low buffer (buffer=0.050512000000253465)
[warn] > [playback-rate-controller]: Stall detected, adjusting target latency

call onError with argument just "hlsError" string.

Expected Behavior

Provide error levels to onError arguments in order to know if user should see error message.

Steps to Reproduce

  1. Use file player.
  2. Set onError to ReactPlayer to get the error.
  3. Set hlsOptions: debug: true if you want to see the warnings in the console.
  4. Start playing any HLS video and seek around the video until you see the warning and the onError callback called.

Environment