cookpete / react-player

A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion
https://cookpete.github.io/react-player
MIT License
8.94k stars 1.12k forks source link

Reset player after dynamic update of config #1183

Closed madeleineostoja closed 1 month ago

madeleineostoja commented 3 years ago

I'm trying to have a video play in background mode (looping, muted, no controls) until it is clicked, then to restart as per usual with the full player. Updating the Vimeo player's config prop dynamically doesn't seem to work. It would be great to either fix that or to have an instance method to re-initialise the player.

Current Behavior

Changing config dynamically does not update the player

Expected Behavior

Changing config dynamically should update the player, or the player should provide a reset method on the instance

Steps to Reproduce

  1. Set background: true on Vimeo player
  2. Programatically set background: false on playing Vimeo player
  3. Watch as nothing changes

Environment

walidvb commented 3 years ago

Could you provide a code example? I can try to take a look

akash9406 commented 3 weeks ago

i have the same issue how to update config dynamically so that its reflect on the player