react-native-jw-media-player icon indicating copy to clipboard operation
react-native-jw-media-player copied to clipboard

How to load a new file while the player is already mounted in the same screen

Open nateshmbhat opened this issue 3 years ago • 1 comments

The example app just shows the player being used in a screen with hardcoded urls. When going to another screen, the component is unmounted.

How do i change the audio or video to be played while the jwplayer is mounted (without unmounting and remounting with different value of "config" which sometimes causes crash in ios)

nateshmbhat avatar Jul 27 '22 09:07 nateshmbhat

Hi @nateshmbhat

We have some apps that requires this exact use case and what we do is we load the player outside of the navigation e.g.

<Main>
  <Navigation />
  {shouldRenderPlayer && <Player />}
</Main>

And make use of redux etc to manage the player.

So even if the current screen unmounts the player is still mounted till we decide to unmount it with redux etc.

Does this help?

chaimPaneth avatar Aug 09 '22 10:08 chaimPaneth

Closing due to inactivity.

chaimPaneth avatar Feb 08 '24 07:02 chaimPaneth