react-native-jw-media-player
react-native-jw-media-player copied to clipboard
How to load a new file while the player is already mounted in the same screen
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)
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?
Closing due to inactivity.