jwplayer / jwplayer-react

ISC License
28 stars 13 forks source link

Player not updating when `playlist` attribute changes. #20

Open derweili opened 1 year ago

derweili commented 1 year ago

Bug

When the value passed to the playlist attribute gets changed, the video shown by the jwplayer-react component does not change. Instead it still shows the "old" video.

Expected Behaviour

When changing the playlist attribute, the the jwplayer should show the videos from the new playlist.

Current workaround

Currently I fix this by adding a "key" attribute to the component which is unique to the playlist.

<JWPlayer library={script} playlist={playlist} key={playlist}/>

This forces the component to unmount and mount again, but I think the jwplayer-react component should be able to handle this case by itself.