davidohayon669/react-native-youtube

Backgrounding an iOS while rendering YouTube causes the app to be stopped by iOS

Opened this issue · 0 comments

Within my app I am rendering the YouTube component like so:

<YouTube
  videoId={id} 
  play={false} 
  fullscreen={false} 
  loop={false} 
  style={videoStyles.image}
  />

If the app is backgrounded while this component is being rendered, and then the app is foregrounded after around 30 seconds the app is restarted. I verified this behavior by not rendering the YouTube component while the app is backgrounded, and that resulted in the expected behavior of the app resuming where it was when it was backgrounded. To reproduce this, a release build of the iOS app must be used. Debug builds do not have the same iOS app background restrictions.

I suspect this is due to the interface between RCTYouTube and youtube-ios-player-helper, but have not confirmed. I am not sure it is worth my time to investigate right now, as the workaround is simple and works. But wanted to report the issue in case others ran into it or someone might know what the issue might be.