player icon indicating copy to clipboard operation
player copied to clipboard

MediaPlayer onError does not trigger for unknown src

Open giliamverheide opened this issue 2 years ago • 1 comments

Current Behavior:

MediaPlayer onError event will only trigger when the src contains a file type/extension in the name. For example:

  • src: https://justsomeinvalidwebsite.com/video.mp4 → Triggers onError, media-player's <shadow-root> contains video.
  • src: https://justsomeinvalidwebsite.com/videoDoes not trigger onError, media-player's <shadow-root> is empty.
  • src: notaurl.mp4 → Triggers onError, media-player's <shadow-root> contains video.
  • src: notaurlDoes not trigger onError, media-player's <shadow-root> is empty.

Sandbox to demonstrate issue: https://codesandbox.io/p/sandbox/zealous-mountain-p49kyx?file=/app/page.tsx:22,33 (not sure why the last video doesn't load in codesandbox, but the onError bug still applies).

(Bug may also apply to onHlsError, onPlayFail)

Expected Behavior:

No matter the video src, onError should trigger if there was a problem loading the video. Native video error event works as expected for all cases: https://jsfiddle.net/ar8p41so/4/

Environment:

  • Framework: React
  • Meta Framework: Next.js
  • Node: 18.16.0
  • Browser: Chrome / any

giliamverheide avatar Aug 15 '23 12:08 giliamverheide

i have same problem

roshaninet avatar Mar 16 '24 15:03 roshaninet