Closed mrlaessig closed 8 years ago
The way TabNavigator switches tabs is that you decide which TabItem has the prop selected={true}
, which is determined by your code. So when you change which tab is selected, that's when you'd know that the user is switching between scenes.
Yes, thats true. I figured out that the video doesn't stop because only the selected
scene is going to be rerendered. This causes the player to continue playing in the background after the scene transition.
We keep the scenes around because they might contain UI state (e.g. scroll position, how far you've watched a video). Sounds like you have enough to work with to come up with a solution.
Just in case someone comes by, my solution to the problem: Since only the selected scene is getting updated ("rendered") you can't update other scenes by passing down props. So I used a EventEmitter to emit a transition event, when the user is switching between scenes.
I'm trying to figure out how to get some kind notification if the user switches between scenes. I need the notification to stop/pause a video in one if my scenes. Otherwise it continues playing in the background. I didn't find anything in the code or in the doc. Is there some workaround for this or did I miss something.
Thanks