-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple sources for video not working (url as array of string) #1624
Comments
Far from ideal but just for the record what I am doing right now is to handle the iteration of different sources until no error found manually: const handleOnError = useCallback(
(_error: Error) => {
if (currentUrlIndex < urls.length - 1) {
setCurrentUrlIndex(currentUrlIndex + 1);
return;
}
...
},
[/*...*/]
);
<ReactPlayer
key={urls[currentUrlIndex]} // Important so we are able to 'change' the player on every change of the url to render
ref={videoRef}
url={urls[currentUrlIndex]}
...
/> |
Since |
fixed in #1612 |
Hey! It seems we have dropped the possibility to throw errors with this last fix, if you check https://codesandbox.io/s/condescending-water-m6qdjr?file=/src/App.js you will see I am using the latest version of the library and there is no |
Trying the above issue at #1692 |
Current Behavior
Valid video doesn't play when passing a url as array, therefore, we can't take advantage of video element API to fallback to different video sources depending on what the browser can play
It seems like src="undefined" is set on the video and perhaps that can be part of the issue? You seem to have a PR for that #1622
Check code sandbox below to check the behavior:
https://codesandbox.io/embed/loving-mcclintock-vefv65?fontsize=14&hidenavigation=1&theme=light
Expected Behavior
I will expect to behave as the video HTML tag such as: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video in which if the first source is wrong or resolve error then goes to the following.
The text was updated successfully, but these errors were encountered: