player
player copied to clipboard
MediaPlayer onError does not trigger for unknown src
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/video→ Does not trigger onError, media-player's<shadow-root>is empty. - src:
notaurl.mp4→ Triggers onError, media-player's<shadow-root>contains video. - src:
notaurl→ Does 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
i have same problem