-
-
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 not refreshing #302
Comments
Good spot. I think the problem lies here: I'm using a very crude prop comparison function for The solution is probably to use a better comparison util between |
Nice catch - I've checked my use of the component and you're right, where there are no other prop changes (other than the However, I also have instances where other props change (i.e. Looks like there may be two separate issues exhibiting similar behaviour? Just a thought - have you measured performance without |
Yeah you're right. There are two things going on: The problem with using a If you were to do what the spec suggests, you could override the <ReactPlayer
url={[...]}
config={{
file: {
attributes: {
src: 'file.mp4'
}
}
}}
/>
I honestly haven't given it that much thought. I assumed it would be wise not to re-render the player unnecessarily, especially if your app updates a progress bar or something on an interval and |
Thanks @cookpete - really appreciate all your good work. I'll implement a fix for updating multiple sources in my wrapper component for now - may revisit if I have something to contribute. |
When specifying multiple local sources in
v1.0.0-beta.7
video does not refresh when new sources are provided (i.e. the browser keeps playing the first video sources passed inprops.url
).This seems to be expected behaviour:
I'm currently using a quick-fix where applying one of the source
url
's as akey
prop to<ReactPlayer>
forces a refresh of the child<video>
element when theurl
changes, as suggested in https://stackoverflow.com/a/47382850/1823021If reproducible, it would be great to handle this in the player - where a
key
could be applied to the<video>
element, or approach changed such that a non-server render usescanPlayType()
to modifysrc
directly onvideo
.I don't have experience with
canPlayType()
in the wild but Modernizr hints at unreliability on mobile.The text was updated successfully, but these errors were encountered: